SheafSystem  0.0.0.0
met_e3.cc
Go to the documentation of this file.
1 
2 //
3 // Copyright (c) 2014 Limit Point Systems, Inc.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 
20 
21 #include "SheafSystem/met_e3.impl.h"
22 
23 #include "SheafSystem/abstract_poset_member.impl.h"
24 #include "SheafSystem/assert_contract.h"
25 #include "SheafSystem/at0.h"
26 #include "SheafSystem/at1_space.h"
27 #include "SheafSystem/stp_space.h"
28 #include "SheafSystem/fiber_bundles_namespace.h"
29 #include "SheafSystem/schema_poset_member.h"
30 #include "SheafSystem/wsv_block.h"
31 
32 
33 using namespace std;
34 using namespace fiber_bundle; // Workaround for MS C++ bug.
35 
36 
37 //==============================================================================
38 // CLASS MET_E3_ROW_DOFS_TYPE
39 //==============================================================================
40 
41 
42 //==============================================================================
43 // CLASS MET_E3_LITE
44 //==============================================================================
45 
46 //==============================================================================
47 // EUCLIDEAN METRIC 3D (MET_E3) FACET OF CLASS MET_E3_LITE
48 //==============================================================================
49 
50 // PUBLIC MEMBER FUNCTIONS
51 
54 {
55  // Preconditions:
56 
57  // Body:
58 
59  // Postconditions:
60 
61  ensure(invariant());
62 
63  // Exit:
64 }
65 
67 met_e3_lite(const met_e3_lite& xother)
68 {
69  // Preconditions:
70 
71  // Body:
72 
73  *this = xother;
74 
75  // Postconditions:
76 
77  ensure(invariant());
78 
79  // Exit:
80 }
81 
84 operator=(const met_e3_lite& xother)
85 {
86  // Preconditions:
87 
88  // Body:
89 
90 
91  if(this == &xother)
92  return *this;
93 
94  _row_dofs = xother._row_dofs;
95 
96  // Postconditions:
97 
98  ensure(invariant());
99  ensure_for_all(i, 0, d(), component(i) == xother[i]);
100 
101  // Exit:
102 
103  return *this;
104 }
105 
108 {
109  // Preconditions:
110 
111  // Body:
112 
113  // Postconditions:
114 
115  // Exit:
116 
117 }
118 
120 met_e3_lite(const row_dofs_type& xrow_dofs)
121 {
122  // Preconditions:
123 
124  // Body:
125 
126  *this = xrow_dofs;
127 
128  // Postconditions:
129 
130  ensure(invariant());
131 
132  // Exit:
133 }
134 
137 operator=(const row_dofs_type& xrow_dofs)
138 {
139  // Preconditions:
140 
141  // Body:
142 
143  _row_dofs = xrow_dofs;
144 
145  // Postconditions:
146 
147  ensure(invariant());
148 
149  // Exit:
150 
151  return *this;
152 
153 }
154 
156 met_e3_lite(const matrix_type& xmatrix)
157 {
158  // Preconditions:
159 
160  // Body:
161 
162  *this = xmatrix;
163 
164  // Postconditions:
165 
166  ensure(invariant());
167 
168  // Exit:
169 }
170 
173 operator=(const matrix_type& xmatrix)
174 {
175  // Preconditions:
176 
177  // Body:
178 
179  //_row_dofs = xmatrix;
180  _row_dofs = reinterpret_cast<const row_dofs_type&>(xmatrix);
181 
182  // Postconditions:
183 
184  ensure(invariant());
185 
186  // Exit:
187 
188  return *this;
189 
190 }
191 
192 fiber_bundle::met_e3_lite::
194 {
195  // Preconditions:
196 
197  // Body:
198 
199  matrix_type& result = _row_dofs;
200 
201  // Postconditions:
202 
203  // Exit:
204 
205  return result;
206 }
207 
208 fiber_bundle::met_e3_lite::
209 operator const met_e3_lite::matrix_type& () const
210 {
211  // Preconditions:
212 
213  // Body:
214 
215  const matrix_type& result = _row_dofs;
216 
217  // Postconditions:
218 
219  // Exit:
220 
221  return result;
222 }
223 
224 fiber_bundle::met_e3_lite::
226 {
227  // Preconditions:
228 
229  // Body:
230 
231  row_dofs_type& result = _row_dofs;
232 
233  // Postconditions:
234 
235  // Exit:
236 
237  return result;
238 }
239 
240 fiber_bundle::met_e3_lite::
241 operator const met_e3_lite::row_dofs_type& () const
242 {
243  // Preconditions:
244 
245  // Body:
246 
247  const row_dofs_type& result = _row_dofs;
248 
249  // Postconditions:
250 
251  // Exit:
252 
253  return result;
254 }
255 
257 met_e3_lite(const value_type& xx_comp,
258  const value_type& xy_comp,
259  const value_type& xz_comp,
260  const value_type& yy_comp,
261  const value_type& yz_comp,
262  const value_type& zz_comp)
263 {
264  // Preconditions:
265 
266  // Body:
267 
268  put_components(xx_comp, xy_comp, xz_comp, yy_comp, yz_comp, zz_comp);
269 
270  // Postconditions:
271 
272  ensure(invariant());
273  ensure(isunordered_or_equals(component(0), xx_comp));
274  ensure(isunordered_or_equals(component(1), xy_comp));
275  ensure(isunordered_or_equals(component(2), xz_comp));
276  ensure(isunordered_or_equals(component(3), yy_comp));
277  ensure(isunordered_or_equals(component(4), yz_comp));
278  ensure(isunordered_or_equals(component(5), zz_comp));
279 
280  // Exit:
281 }
282 
283 void
285 put_components(const value_type& xx_comp,
286  const value_type& xy_comp,
287  const value_type& xz_comp,
288  const value_type& yy_comp,
289  const value_type& yz_comp,
290  const value_type& zz_comp)
291 
292 {
293  // Preconditions:
294 
295  // Body:
296 
297  put_component(0, xx_comp);
298  put_component(1, xy_comp);
299  put_component(2, xz_comp);
300  put_component(3, yy_comp);
301  put_component(4, yz_comp);
302  put_component(5, zz_comp);
303 
304  // Postconditions:
305 
306  ensure(invariant());
307  ensure(isunordered_or_equals(component(0), xx_comp));
308  ensure(isunordered_or_equals(component(1), xy_comp));
309  ensure(isunordered_or_equals(component(2), xz_comp));
310  ensure(isunordered_or_equals(component(3), yy_comp));
311  ensure(isunordered_or_equals(component(4), yz_comp));
312  ensure(isunordered_or_equals(component(5), zz_comp));
313 
314  // Exit:
315 }
316 
317 // PROTECTED MEMBER FUNCTIONS
318 
319 // PRIVATE MEMBER FUNCTIONS
320 
321 
322 //==============================================================================
323 // EUCLIDEAN METRIC (MET_ED) FACET OF CLASS MET_E3_LITE
324 //==============================================================================
325 
326 // PUBLIC MEMBER FUNCTIONS
327 
328 // PROTECTED MEMBER FUNCTIONS
329 
330 // PRIVATE MEMBER FUNCTIONS
331 
332 
333 //==============================================================================
334 // METRIC TENSOR (MET) FACET OF CLASS MET_E3_LITE
335 //==============================================================================
336 
337 // PUBLIC MEMBER FUNCTIONS
338 
339 // PROTECTED MEMBER FUNCTIONS
340 
341 // PRIVATE MEMBER FUNCTIONS
342 
343 
344 //==============================================================================
345 // ST2 FACET OF CLASS MET_E3_LITE
346 //==============================================================================
347 
348 // PUBLIC MEMBER FUNCTIONS
349 
350 // PROTECTED MEMBER FUNCTIONS
351 
352 // PRIVATE MEMBER FUNCTIONS
353 
354 
355 //==============================================================================
356 // INTERIOR ALGEBRA (STP) FACET OF CLASS MET_E3_LITE
357 //==============================================================================
358 
359 // PUBLIC MEMBER FUNCTIONS
360 
361 // PROTECTED MEMBER FUNCTIONS
362 
363 // PRIVATE MEMBER FUNCTIONS
364 
365 
366 //==============================================================================
367 // TENSOR ALGEBRA (TP) FACET OF CLASS MET_E3_LITE
368 //==============================================================================
369 
370 // PUBLIC MEMBER FUNCTIONS
371 
372 int
374 dd() const
375 {
376  // Preconditions:
377 
378  // Body:
379 
380  int result = 3;
381 
382  // Postconditions:
383 
384  ensure(invariant());
385  ensure(result == 3);
386 
387  // Exit:
388 
389  return result;
390 }
391 
392 // PROTECTED MEMBER FUNCTIONS
393 
394 // PRIVATE MEMBER FUNCTIONS
395 
396 
397 //==============================================================================
398 // VECTOR ALGEBRA (VD) FACET OF CLASS MET_E3_LITE
399 //==============================================================================
400 
401 // PUBLIC MEMBER FUNCTIONS
402 
405 tp_prototype(int xp) const
406 {
407  // Preconditions:
408 
409  require(precondition_of(e3_lite::static_tp_prototype(xp)));
410 
411  // Body:
412 
413  const tp_lite& result = e3_lite::static_tp_prototype(xp);
414 
415  // Postconditions:
416 
417  ensure(postcondition_of(e3_lite::static_tp_prototype(xp)));
418 
419  // Exit:
420 
421  return result;
422 }
423 
426 atp_prototype(int xp) const
427 {
428  // Preconditions:
429 
430  require(precondition_of(e3_lite::static_atp_prototype(xp)));
431 
432  // Body:
433 
434  const atp_lite& result = e3_lite::static_atp_prototype(xp);
435 
436  // Postconditions:
437 
438  ensure(postcondition_of(e3_lite::static_atp_prototype(xp)));
439 
440  // Exit:
441 
442  return result;
443 }
444 
447 stp_prototype(int xp) const
448 {
449  // Preconditions:
450 
451  require(precondition_of(e3_lite::static_stp_prototype(xp)));
452 
453  // Body:
454 
455  const stp_lite& result = e3_lite::static_stp_prototype(xp);
456 
457  // Postconditions:
458 
459  ensure(postcondition_of(e3_lite::static_stp_prototype(xp)));
460 
461  // Exit:
462 
463  return result;
464 }
465 
466 // PROTECTED MEMBER FUNCTIONS
467 
468 // PRIVATE MEMBER FUNCTIONS
469 
470 
471 //==============================================================================
472 // CARTESIAN ALGEBRA (TUPLE) FACET OF CLASS MET_E3_LITE
473 //==============================================================================
474 
475 // PUBLIC MEMBER FUNCTIONS
476 
477 // PROTECTED MEMBER FUNCTIONS
478 
479 // PRIVATE MEMBER FUNCTIONS
480 
481 
482 //==============================================================================
483 // ABSTRACT POSET MEMBER FACET OF CLASS MET_E3_LITE
484 //==============================================================================
485 
486 // PUBLIC MEMBER FUNCTIONS
487 
488 const std::string&
490 class_name() const
491 {
492  // Preconditions:
493 
494  // Body:
495 
496  const string& result = static_class_name();
497 
498  // Postconditions:
499 
500  ensure(!result.empty());
501 
502  // Exit:
503 
504  return result;
505 }
506 
507 const std::string&
510 {
511  // Preconditions:
512 
513  // Body:
514 
515  static const string result("met_e3_lite");
516 
517  // Postconditions:
518 
519  ensure(!result.empty());
520 
521  // Exit:
522 
523  return result;
524 }
525 
528 clone() const
529 {
530  met_e3_lite* result = 0;
531 
532  // Preconditions:
533 
534  // Body:
535 
536  result = new met_e3_lite();
537 
538  // Postconditions:
539 
540  ensure(result != 0);
541  ensure(is_same_type(*result));
542 
543  // Exit:
544 
545  return result;
546 }
547 
548 // PROTECTED MEMBER FUNCTIONS
549 
550 // PRIVATE MEMBER FUNCTIONS
551 
552 
553 //==============================================================================
554 // ANY FACET OF CLASS MET_E3_LITE
555 //==============================================================================
556 
557 // PUBLIC MEMBER FUNCTIONS
558 
559 bool
561 is_ancestor_of(const any_lite& xother) const
562 {
563  // Preconditions:
564 
565  require(&xother != 0);
566 
567  // Body:
568 
569  // True if other conforms to this.
570 
571  bool result = dynamic_cast<const met_e3_lite*>(&xother) != 0;
572 
573  // Postconditions:
574 
575  return result;
576 }
577 
578 bool
580 invariant() const
581 {
582  bool result = true;
583 
584  if(invariant_check())
585  {
586  // Prevent recursive calls to invariant.
587 
588  disable_invariant_check();
589 
590  // Must satisfy base class invariant.
591 
592  invariance(met_ed_lite::invariant());
593 
594  // Invariances for this class:
595 
596  // Finished, turn invariant checking back on.
597 
598  enable_invariant_check();
599  }
600 
601  // Exit
602 
603  return result;
604 }
605 
606 void*
609 {
610  return &_row_dofs;
611 }
612 
613 const void*
615 row_dofs() const
616 {
617  return &_row_dofs;
618 }
619 
620 // PROTECTED MEMBER FUNCTIONS
621 
622 // PRIVATE MEMBER FUNCTIONS
623 
624 
625 //==============================================================================
626 // CLASS MET_E3
627 //==============================================================================
628 
629 // ===========================================================
630 // HOST FACTORY FACET OF CLASS MET_E3
631 // ===========================================================
632 
633 // PUBLIC MEMBER FUNCTIONS
634 
635 const sheaf::poset_path&
638 {
639  // Preconditions:
640 
641 
642  // Body:
643 
644  static const poset_path result(standard_schema_poset_name(), "met_e3_schema");
645 
646  // Postconditions:
647 
648  // Exit:
649 
650  return result;
651 }
652 
653 void
656 {
657  // Preconditions:
658 
659  require(xns.state_is_read_write_accessible());
660  require(xns.contains_poset(standard_schema_poset_name()));
661  require(!xns.contains_poset_member(standard_schema_path()));
662 
663  // Body:
664 
665  string lmember_names = "xx DOUBLE false ";
666  lmember_names += "xy DOUBLE false ";
667  lmember_names += "yy DOUBLE false ";
668  lmember_names += "xz DOUBLE false ";
669  lmember_names += "yz DOUBLE false ";
670  lmember_names += "zz DOUBLE false";
671 
672  schema_poset_member lschema(xns,
673  standard_schema_path().member_name(),
674  met_ed::standard_schema_path(),
675  lmember_names,
676  false);
677 
678  lschema.detach_from_state();
679 
680  // Postconditions:
681 
682  ensure(xns.contains_poset_member(standard_schema_path()));
683 
684  // Exit:
685 
686  return;
687 }
688 
692  const poset_path& xhost_path,
693  const poset_path& xschema_path,
694  const poset_path& xvector_space_path,
695  bool xauto_access)
696 {
697  // cout << endl << "Entering met_e3::new_host." << endl;
698 
699  // Preconditions:
700 
701  require(xns.state_is_auto_read_write_accessible(xauto_access));
702 
703  require(!xhost_path.empty());
704  require(!xns.contains_path(xhost_path, xauto_access));
705 
706  require(xschema_path.full());
707  require(xns.path_is_auto_read_accessible(xschema_path, xauto_access));
708  require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
709  require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 6);
710 
711  require(xns.path_is_auto_read_accessible(xvector_space_path, xauto_access));
712  require(xns.contains_poset<vector_space_type::host_type>(xvector_space_path, xauto_access));
713  require(xns.member_poset(xvector_space_path, xauto_access).schema(xauto_access).conforms_to(vector_space_type::standard_schema_path()));
714  require(xns.member_poset<vector_space_type::host_type>(xvector_space_path, xauto_access).d(xauto_access) == 3);
715 
716  // Body:
717 
718  host_type& result =
719  host_type::new_table(xns, xhost_path, xschema_path, 2, xvector_space_path, xauto_access);
720 
721  // Postconditions:
722 
723  ensure(xns.owns(result, xauto_access));
724  ensure(result.path(true) == xhost_path);
725  ensure(result.state_is_not_read_accessible());
726  ensure(result.schema(true).path(xauto_access) == xschema_path);
727 
728  ensure(result.factor_ct(true) == 6);
729  ensure(result.d(true) == 6);
730  ensure(result.scalar_space_path(true) == xns.member_poset<vector_space_type::host_type>(xvector_space_path, xauto_access).scalar_space_path());
731  ensure(result.p(true) == 2);
732  ensure(result.dd(true) == 3);
733  ensure(result.vector_space_path(true) == xvector_space_path);
734 
735  // Exit:
736 
737  // cout << "Leaving met_e3::new_host." << endl;
738  return result;
739 }
740 
743 standard_host(namespace_type& xns, const std::string& xsuffix, bool xauto_access)
744 {
745  // cout << endl << "Entering met_e3::new_host." << endl;
746 
747  // Preconditions:
748 
749  require(xns.state_is_auto_read_write_accessible(xauto_access));
750 
751  require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
752  require(standard_host_is_available<met_e3>(xns, xsuffix, xauto_access));
753 
754  require(xns.path_is_auto_read_accessible(standard_schema_path(), xauto_access));
755 
756  require(xns.path_is_auto_read_available(standard_host_path<vector_space_type>(xsuffix), xauto_access));
757 
758  // Body:
759 
760  // Create the vector space if necessary.
761 
762  poset_path lvector_space_path = vector_space_type::standard_host(xns, xsuffix, xauto_access).path(true);
763 
764  poset_path lpath(standard_host_path<met_e3>(xsuffix));
765 
766  host_type* result_ptr;
767  if(xns.contains_path(lpath, xauto_access))
768  {
769  result_ptr = &xns.member_poset<host_type>(lpath, xauto_access);
770  }
771  else
772  {
773  result_ptr = &new_host(xns, lpath, standard_schema_path(), lvector_space_path, xauto_access);
774  }
775 
776  host_type& result = *result_ptr;
777 
778  // Postconditions:
779 
780  ensure(xns.owns(result, xauto_access));
781  ensure(result.path(true) == standard_host_path<met_e3>(xsuffix));
782  ensure(result.state_is_not_read_accessible());
783  ensure(result.schema(true).path(xauto_access) == standard_schema_path());
784 
785  ensure(result.factor_ct(true) == 6);
786  ensure(result.d(true) == 6);
787  ensure(result.scalar_space_path(true) == standard_host_path<vector_space_type::scalar_type>(xsuffix) );
788  ensure(result.p(true) == 2);
789  ensure(result.dd(true) == 3);
790  ensure(result.vector_space_path(true) == standard_host_path<vector_space_type>(xsuffix) );
791 
792  // Exit:
793 
794  // cout << "Leaving met_e3::new_host." << endl;
795  return result;
796 }
797 
798 // PROTECTED MEMBER FUNCTIONS
799 
800 // PRIVATE MEMBER FUNCTIONS
801 
802 
803 //==============================================================================
804 // MET_E3 FACET OF CLASS MET_E3
805 //==============================================================================
806 
807 // PUBLIC MEMBER FUNCTIONS
808 
811 {
812  // Preconditions:
813 
814  // Body:
815 
816  // Postconditions:
817 
818  ensure(invariant());
819 }
820 
823 {
824  // Preconditions:
825 
826  require(xhost != 0);
827  require(xhost->state_is_read_accessible());
828  require(xhost->contains_member(xhub_id));
829 
830  // Body:
831 
832  attach_to_state(xhost, xhub_id);
833 
834  // Postconditions:
835 
836  ensure(invariant());
837  // ensure(host() == xhost);
838  ensure(index() == xhub_id);
839  ensure(is_attached());
840 }
841 
843 met_e3(const poset_state_handle* xhost, const scoped_index& xid)
844 {
845  // Preconditions:
846 
847  require(xhost != 0);
848  require(xhost->state_is_read_accessible());
849  require(xhost->contains_member(xid));
850 
851  // Body:
852 
853  attach_to_state(xhost, xid.hub_pod());
854 
855  // Postconditions:
856 
857  ensure(invariant());
858  // ensure(host() == xhost);
859  ensure(index() ==~ xid);
860  ensure(is_attached());
861 }
862 
864 met_e3(const poset_state_handle* xhost, const std::string& xname)
865 {
866 
867  // Preconditions:
868 
869  require(xhost != 0);
870  require(xhost->state_is_read_accessible());
871  require(!xname.empty());
872  require(xhost->contains_member(xname));
873 
874  // Body:
875 
876  attach_to_state(xhost, xname);
877 
878  // Postconditions:
879 
880  ensure(invariant());
881  // ensure(host() == xhost);
882  ensure(name() == xname);
883  ensure(is_attached());
884 
885 }
886 
889 {
890 
891  // Preconditions:
892 
893  require(xother != 0);
894 
895  // Body:
896 
897  attach_to_state(xother);
898 
899  // Postconditions:
900 
901  ensure(invariant());
902  ensure(is_attached());
903  ensure(is_same_state(xother));
904 
905 }
906 
908 met_e3(poset_state_handle* xhost, bool xauto_access)
909 {
910 
911  // Preconditions:
912 
913  require(precondition_of(new_jim_state(xhost, 0, false, xauto_access)));
914 
915  // Body:
916 
917  new_jim_state(xhost, 0, false, xauto_access);
918 
919  // Postconditions:
920 
921  ensure(postcondition_of(new_jim_state(xhost, 0, false, xauto_access)));
922 
923  // Exit:
924 
925  return;
926 }
927 
930  const row_dofs_type& xrdt,
931  bool xauto_access)
932 {
933 
934  // Preconditions:
935 
936  require(precondition_of(new_jim_state(&xhost, 0, false, xauto_access)));
937 
938  // Body:
939 
940  new_jim_state(&xhost, 0, false, xauto_access);
941 
942  if(xauto_access)
943  {
944  xhost.get_read_write_access();
945  }
946 
947  *this = xrdt;
948 
949  if(xauto_access)
950  {
951  xhost.release_access();
952  }
953 
954  // Postconditions:
955 
956  ensure(postcondition_of(new_jim_state(&xhost, 0, false, xauto_access)));
957 
958  // Exit:
959 
960  return;
961 }
962 
966 {
967  // Preconditions:
968 
969  require(state_is_read_write_accessible());
970 
971  // Body:
972 
973  sheaf::row_dofs(*this) = xrdt;
974 
975  // Postconditions:
976 
977  ensure_for_all(i, 0, d(), component(i) == xrdt.components[i]);
978 
979  // Exit:
980 
981  return *this;
982 
983 }
984 
989 {
990  // Preconditions:
991 
992  require(is_ancestor_of(&xother));
993  require(precondition_of(attach_to_state(&xother)));
994 
995  // Body:
996 
997  attach_to_state(&xother);
998 
999  // Postconditions:
1000 
1001  ensure(postcondition_of(attach_to_state(&xother)));
1002 
1003  // Exit:
1004 
1005  return *this;
1006 }
1007 
1011 operator=(const met_e3& xother)
1012 {
1013  // Preconditions:
1014 
1015  require(precondition_of(attach_to_state(&xother)));
1016 
1017  // Body:
1018 
1019  attach_to_state(&xother);
1020 
1021  // Postconditions:
1022 
1023  ensure(postcondition_of(attach_to_state(&xother)));
1024 
1025  // Exit:
1026 
1027  return *this;
1028 }
1029 
1032 {
1033 
1034  // Preconditions:
1035 
1036  // Body:
1037 
1038  // Postconditions:
1039 
1040 }
1041 
1045 {
1046  // Preconditions:
1047 
1048  // Body:
1049 
1050  static const volatile_type result;
1051 
1052  // Postconditions:
1053 
1054  // Exit:
1055 
1056  return result;
1057 }
1058 
1062 lite_type() const
1063 {
1064  // Preconditions:
1065 
1066  // Body:
1067 
1068  volatile_type* result = new volatile_type(sheaf::row_dofs(*this));
1069 
1070  // Postconditions:
1071 
1072  // Exit:
1073 
1074  return result;
1075 }
1076 
1077 fiber_bundle::met_e3::
1079 {
1080  // Preconditions:
1081 
1082  // Body:
1083 
1084  row_dofs_type& result = sheaf::row_dofs(*this);
1085 
1086  // Postconditions:
1087 
1088  // Exit:
1089 
1090  return result;
1091 }
1092 
1093 fiber_bundle::met_e3::
1094 operator const met_e3::row_dofs_type& () const
1095 {
1096  // Preconditions:
1097 
1098  // Body:
1099 
1100  const row_dofs_type& result = sheaf::row_dofs(*this);
1101 
1102  // Postconditions:
1103 
1104  // Exit:
1105 
1106  return result;
1107 }
1108 
1109 // PROTECTED MEMBER FUNCTIONS
1110 
1111 // PRIVATE MEMBER FUNCTIONS
1112 
1113 
1114 //==============================================================================
1115 // MET_ED FACET OF CLASS MET_E3
1116 //==============================================================================
1117 
1118 // PUBLIC MEMBER FUNCTIONS
1119 
1120 // PROTECTED MEMBER FUNCTIONS
1121 
1122 // PRIVATE MEMBER FUNCTIONS
1123 
1124 
1125 //==============================================================================
1126 // MET FACET OF CLASS MET_E3
1127 //==============================================================================
1128 
1129 // PUBLIC MEMBER FUNCTIONS
1130 
1131 // PROTECTED MEMBER FUNCTIONS
1132 
1133 // PRIVATE MEMBER FUNCTIONS
1134 
1135 
1136 //==============================================================================
1137 // ST2 FACET OF CLASS MET_E3
1138 //==============================================================================
1139 
1140 // PUBLIC MEMBER FUNCTIONS
1141 
1142 // PROTECTED MEMBER FUNCTIONS
1143 
1144 // PRIVATE MEMBER FUNCTIONS
1145 
1146 
1147 //==============================================================================
1148 // STP FACET OF CLASS MET_E3
1149 //==============================================================================
1150 
1151 // PUBLIC MEMBER FUNCTIONS
1152 
1153 // PROTECTED MEMBER FUNCTIONS
1154 
1155 // PRIVATE MEMBER FUNCTIONS
1156 
1157 
1158 //==============================================================================
1159 // TP FACET OF CLASS MET_E3
1160 //==============================================================================
1161 
1162 // PUBLIC MEMBER FUNCTIONS
1163 
1164 // PROTECTED MEMBER FUNCTIONS
1165 
1166 // PRIVATE MEMBER FUNCTIONS
1167 
1168 
1169 //==============================================================================
1170 // VD FACET OF CLASS MET_E3
1171 //==============================================================================
1172 
1173 // PUBLIC MEMBER FUNCTIONS
1174 
1175 // PROTECTED MEMBER FUNCTIONS
1176 
1177 // PRIVATE MEMBER FUNCTIONS
1178 
1179 
1180 //==============================================================================
1181 // TUPLE FACET OF CLASS MET_E3
1182 //==============================================================================
1183 
1184 // PUBLIC MEMBER FUNCTIONS
1185 
1188 new_tp(int xp, bool xauto_access) const
1189 {
1190  // Preconditions:
1191 
1192  require(precondition_of(e3::new_tp(vector_space(xauto_access), xp)));
1193 
1194  // Body:
1195 
1196  tp* result = e3::new_tp(vector_space(xauto_access), xp);
1197 
1198  // Postconditions:
1199 
1200  ensure(postcondition_of(e3::new_tp(vector_space(xauto_access), xp)));
1201 
1202  // Exit:
1203 
1204  return result;
1205 }
1206 
1209 new_atp(int xp, bool xauto_access) const
1210 {
1211  // Preconditions:
1212 
1213  require(precondition_of(e3::new_atp(vector_space(xauto_access), xp)));
1214 
1215  // Body:
1216 
1217  atp* result = e3::new_atp(vector_space(xauto_access), xp);
1218 
1219  // Postconditions:
1220 
1221  ensure(postcondition_of(e3::new_atp(vector_space(xauto_access), xp)));
1222 
1223  // Exit:
1224 
1225  return result;
1226 }
1227 
1230 new_stp(int xp, bool xauto_access) const
1231 {
1232  // Preconditions:
1233 
1234  require(precondition_of(e3::new_stp(vector_space(xauto_access), xp)));
1235 
1236  // Body:
1237 
1238  stp* result = e3::new_stp(vector_space(xauto_access), xp);
1239 
1240  // Postconditions:
1241 
1242  ensure(postcondition_of(e3::new_stp(vector_space(xauto_access), xp)));
1243 
1244  // Exit:
1245 
1246  return result;
1247 }
1248 
1249 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
1250 
1251 // PROTECTED MEMBER FUNCTIONS
1252 
1253 // PRIVATE MEMBER FUNCTIONS
1254 
1255 
1256 //==============================================================================
1257 // ABSTRACT POSET MEMBER FACET OF CLASS MET_E3
1258 //==============================================================================
1259 
1260 // PUBLIC MEMBER FUNCTIONS
1261 
1262 const std::string&
1264 class_name() const
1265 {
1266  // Preconditions:
1267 
1268  // Body:
1269 
1270  const string& result = static_class_name();
1271 
1272  // Postconditions:
1273 
1274  ensure(!result.empty());
1275 
1276  // Exit:
1277 
1278  return result;
1279 }
1280 
1281 const std::string&
1284 {
1285  // Preconditions:
1286 
1287  // Body:
1288 
1289  static const string result("met_e3");
1290 
1291  // Postconditions:
1292 
1293  ensure(!result.empty());
1294 
1295  // Exit:
1296 
1297  return result;
1298 }
1299 
1302 clone() const
1303 {
1304 
1305  // Preconditions:
1306 
1307  // Body:
1308 
1309  // Create new handle of the current class..
1310 
1311  met_e3* result = new met_e3();
1312 
1313  // Postconditions:
1314 
1315  ensure(result != 0);
1316  ensure(result->invariant());
1317 
1318  // Exit:
1319 
1320  return result;
1321 
1322 }
1323 
1324 // PROTECTED MEMBER FUNCTIONS
1325 
1326 // PRIVATE MEMBER FUNCTIONS
1327 
1328 
1329 //==============================================================================
1330 // ANY FACET OF CLASS MET_E3
1331 //==============================================================================
1332 
1333 // PUBLIC MEMBER FUNCTIONS
1334 
1335 bool
1337 is_ancestor_of(const any* xother) const
1338 {
1339 
1340  // Preconditions:
1341 
1342  require(xother != 0);
1343 
1344  // Body:
1345 
1346  // If xother may be dynamically cast to the type of this then this is an
1347  // ancestor of xother.
1348 
1349  bool result = dynamic_cast<const met_e3*>(xother) != 0;
1350 
1351  // Postconditions:
1352 
1353  // ensure(invariant());
1354 
1355  // Exit:
1356 
1357  return result;
1358 
1359 }
1360 
1361 bool
1363 invariant() const
1364 {
1365  bool result = true;
1366 
1367  // Preconditions:
1368 
1369  // Body:
1370 
1371  // Must satisfy base class invariant.
1372 
1373  invariance(met_ed::invariant());
1374 
1375  if (invariant_check())
1376  {
1377  // Prevent recursive calls to invariant.
1378 
1379  disable_invariant_check();
1380 
1381  // Invariants for this class:
1382 
1383  invariance(is_attached() ? (d() == 6) : true);
1384 
1385  // Finished, turn invariant checking back on.
1386 
1387  enable_invariant_check();
1388  }
1389 
1390  // Postconditions:
1391 
1392  ensure(is_derived_query);
1393 
1394  // Exit:
1395 
1396  return result;
1397 }
1398 
1399 // PROTECTED MEMBER FUNCTIONS
1400 
1401 // PRIVATE MEMBER FUNCTIONS
1402 
1403 
1404 //==============================================================================
1405 // NON-MEMBER FUNCTIONS
1406 //==============================================================================
1407 
1408 //==============================================================================
1409 // MET FACET
1410 //==============================================================================
1411 
1412 // PUBLIC MEMBER FUNCTIONS
1413 
1414 void
1416 raise(const met_e3_lite& xmetric, const e3_lite& xcovector, e3_lite& xresult)
1417 {
1418  // Preconditions:
1419 
1420  require(unexecutable("xmetric.is_contravariant())"));
1421  require(unexecutable("xcovector.is_covariant())")); // is_dual;
1422 
1423  // Body:
1424 
1425  // Left matrix multiply xcovector with current.
1426 
1427  //
1428  // This class is a 3x3 matrix and we may therefore make optimizations
1429  // in light of this fact.
1430 
1431  typedef met_e3_lite::value_type value_type;
1432 
1433  value_type m00 = xmetric.component(0);
1434  value_type m01 = xmetric.component(1);
1435  value_type m02 = xmetric.component(2);
1436 
1437  value_type m10 = xmetric.component(1);
1438  value_type m11 = xmetric.component(3);
1439  value_type m12 = xmetric.component(4);
1440 
1441  value_type m20 = xmetric.component(2);
1442  value_type m21 = xmetric.component(4);
1443  value_type m22 = xmetric.component(5);
1444 
1445  value_type comp0 = xcovector.component(0);
1446  value_type comp1 = xcovector.component(1);
1447  value_type comp2 = xcovector.component(2);
1448 
1449  value_type result_comp;
1450 
1451  result_comp = m00*comp0 + m01*comp1 + m02*comp2;
1452  xresult.put_component(0, result_comp);
1453 
1454  result_comp = m10*comp0 + m11*comp1 + m12*comp2;
1455  xresult.put_component(1, result_comp);
1456 
1457  result_comp = m20*comp0 + m21*comp1 + m22*comp2;
1458  xresult.put_component(2, result_comp);
1459 
1460  // Postconditions:
1461 
1462  ensure(unexecutable("xresult.is_contravariant())")); // !is_dual
1463 
1464  // Exit:
1465 
1466 }
1467 
1470 raise(const met_e3_lite& xmetric, const e3_lite& xcovector)
1471 {
1472  // Preconditions:
1473 
1474  require(precondition_of(raise(xmetric, xcovector, *result)));
1475 
1476  // Body:
1477 
1478  e3_lite* result = new e3_lite();
1479 
1480  raise(xmetric, xcovector, *result);
1481 
1482  // Postconditions:
1483 
1484  ensure(result != 0);
1485  ensure(postcondition_of(raise(xmetric, xcovector, *result)));
1486 
1487  // Exit:
1488 
1489  return result;
1490 }
1491 
1492 void
1494 lower(const met_e3_lite& xmetric, const e3_lite& xvector, e3_lite& xresult)
1495 {
1496  // Preconditions:
1497 
1498  require(unexecutable("xmetric.is_covariant())"));
1499  require(unexecutable("xvector.is_contravariant())")); // !is_dual;
1500 
1501  // Body:
1502 
1503  // Right matrix multiply xvector with current.
1504 
1505  //
1506  // This class is a 3x3 matrix and we may therefore make optimizations
1507  // in light of this fact.
1508 
1509  typedef met_e3_lite::value_type value_type;
1510 
1511  value_type m00 = xmetric.component(0);
1512  value_type m01 = xmetric.component(1);
1513  value_type m02 = xmetric.component(2);
1514 
1515  value_type m10 = xmetric.component(1);
1516  value_type m11 = xmetric.component(3);
1517  value_type m12 = xmetric.component(4);
1518 
1519  value_type m20 = xmetric.component(2);
1520  value_type m21 = xmetric.component(4);
1521  value_type m22 = xmetric.component(5);
1522 
1523  value_type comp0 = xvector.component(0);
1524  value_type comp1 = xvector.component(1);
1525  value_type comp2 = xvector.component(2);
1526 
1527  value_type result_comp;
1528 
1529  result_comp = m00*comp0 + m10*comp1 + m20*comp2;
1530  xresult.put_component(0, result_comp);
1531 
1532  result_comp = m01*comp0 + m11*comp1 + m21*comp2;
1533  xresult.put_component(1, result_comp);
1534 
1535  result_comp = m02*comp0 + m12*comp1 + m22*comp2;
1536  xresult.put_component(2, result_comp);
1537 
1538  // Postconditions:
1539 
1540  ensure(unexecutable("xresult.is_covariant())")); // is_dual
1541 
1542  // Exit:
1543 
1544 }
1545 
1548 lower(const met_e3_lite& xmetric, const e3_lite& xvector)
1549 {
1550  // Preconditions:
1551 
1552  require(precondition_of(lower(xmetric, xvector, *result)));
1553 
1554  // Body:
1555 
1556  e3_lite* result = new e3_lite();
1557 
1558  lower(xmetric, xvector, *result);
1559 
1560  // Postconditions:
1561 
1562  ensure(result != 0);
1563  ensure(postcondition_of(lower(xmetric, xvector, *result)));
1564 
1565  // Exit:
1566 
1567  return result;
1568 }
1569 
1570 void
1572 raise(const met_e3& xmetric, const e3& xcovector, e3& xresult, bool xauto_access)
1573 {
1574  // Preconditions:
1575 
1576  require(xmetric.state_is_auto_read_accessible(xauto_access));
1577  require(xcovector.state_is_auto_read_accessible(xauto_access));
1578  require(xresult.state_is_auto_read_write_accessible(xauto_access));
1579  require(xcovector.d(xauto_access) == xmetric.dd(xauto_access));
1580  require(xresult.d(xauto_access) == xmetric.dd(xauto_access));
1581  require(xmetric.is_contravariant(0, xauto_access));
1582  require(xcovector.is_covariant(0, xauto_access)); // is_dual;
1583 
1584  // Body:
1585 
1586  if(xauto_access)
1587  {
1588  xmetric.get_read_access();
1589  xcovector.get_read_access();
1590  xresult.get_read_write_access(true);
1591  }
1592 
1593  // Left matrix multiply xcovector with xmetric.
1594 
1595  //
1596  // This class is a 3x3 matrix and we may therefore make optimizations
1597  // in light of this fact.
1598 
1599  typedef met_e3::value_type value_type;
1600 
1601  value_type m00 = xmetric.component(0);
1602  value_type m01 = xmetric.component(1);
1603  value_type m02 = xmetric.component(2);
1604 
1605  value_type m10 = m01;
1606  value_type m11 = xmetric.component(3);
1607  value_type m12 = xmetric.component(4);
1608 
1609  value_type m20 = m02;
1610  value_type m21 = m12;
1611  value_type m22 = xmetric.component(5);
1612 
1613  value_type comp0 = xcovector.component(0);
1614  value_type comp1 = xcovector.component(1);
1615  value_type comp2 = xcovector.component(2);
1616 
1617  value_type result_comp;
1618 
1619  result_comp = m00*comp0 + m01*comp1 + m02*comp2;
1620  xresult.put_component(0, result_comp);
1621 
1622  result_comp = m10*comp0 + m11*comp1 + m12*comp2;
1623  xresult.put_component(1, result_comp);
1624 
1625  result_comp = m20*comp0 + m21*comp1 + m22*comp2;
1626  xresult.put_component(2, result_comp);
1627 
1628 
1629  // Make sure the result is contravariant/p_vector.
1630 
1631  if(!xresult.is_p_vector(false))
1632  {
1633  xresult.put_is_p_vector(false);
1634  }
1635 
1636 
1637  if(xauto_access)
1638  {
1639  xmetric.release_access();
1640  xcovector.release_access();
1641  xresult.release_access();
1642  }
1643 
1644  // Postconditions:
1645 
1646  ensure(xresult.is_contravariant(0, xauto_access)); // !is_dual
1647 
1648  // Exit:
1649 
1650 }
1651 
1652 void
1654 lower(const met_e3& xmetric, const e3& xvector, e3& xresult, bool xauto_access)
1655 {
1656  // Preconditions:
1657 
1658  require(xmetric.state_is_auto_read_accessible(xauto_access));
1659  require(xvector.state_is_auto_read_accessible(xauto_access));
1660  require(xresult.state_is_auto_read_write_accessible(xauto_access));
1661  require(xvector.d(xauto_access) == xmetric.dd(xauto_access));
1662  require(xresult.d(xauto_access) == xmetric.dd(xauto_access));
1663  require(xmetric.is_covariant(0, xauto_access));
1664  require(xvector.is_contravariant(0, xauto_access)); // !is_dual;
1665 
1666  // Body:
1667 
1668  if(xauto_access)
1669  {
1670  xmetric.get_read_access();
1671  xvector.get_read_access();
1672  xresult.get_read_write_access(true);
1673  }
1674 
1675  // Right matrix multiply xvector with xmetric.
1676 
1677  //
1678  // This class is a 3x3 matrix and we may therefore make optimizations
1679  // in light of this fact.
1680 
1681  typedef met_e3::value_type value_type;
1682 
1683  value_type m00 = xmetric.component(0);
1684  value_type m01 = xmetric.component(1);
1685  value_type m02 = xmetric.component(2);
1686 
1687  value_type m10 = m01;
1688  value_type m11 = xmetric.component(3);
1689  value_type m12 = xmetric.component(4);
1690 
1691  value_type m20 = m02;
1692  value_type m21 = m12;
1693  value_type m22 = xmetric.component(5);
1694 
1695  value_type comp0 = xvector.component(0);
1696  value_type comp1 = xvector.component(1);
1697  value_type comp2 = xvector.component(2);
1698 
1699  value_type result_comp;
1700 
1701  result_comp = m00*comp0 + m10*comp1 + m20*comp2;
1702  xresult.put_component(0, result_comp);
1703 
1704  result_comp = m01*comp0 + m11*comp1 + m21*comp2;
1705  xresult.put_component(1, result_comp);
1706 
1707  result_comp = m02*comp0 + m12*comp1 + m22*comp2;
1708  xresult.put_component(2, result_comp);
1709 
1710 
1711  // Make sure the result is covariant/p_form.
1712 
1713  if(!xresult.is_p_form(false))
1714  {
1715  xresult.put_is_p_form(false);
1716  }
1717 
1718 
1719  if(xauto_access)
1720  {
1721  xmetric.release_access();
1722  xvector.release_access();
1723  xresult.release_access();
1724  }
1725 
1726  // Postconditions:
1727 
1728  ensure(xresult.is_covariant(0, xauto_access)); // is_dual
1729 
1730  // Exit:
1731 
1732 }
1733 
1734 
1735 //==============================================================================
1736 // TEMPLATE SPECIALIZATIONS
1737 //==============================================================================
1738 
SHEAF_DLL_SPEC void lower(const met &xmetric, const ed &xvector, ed &xresult, bool xauto_access)
Lower vector (pre-allocated version for persistent type).
Definition: met.cc:943
virtual void get_read_write_access(bool xrelease_read_only_access=false)
Get read write access to the state associated with this. If release_read_only_access is requested...
virtual bool is_contravariant(bool xauto_access) const
True if and only if all tensor index positions are contravariant.
Definition: tp.cc:1160
virtual poset_path path(bool xauto_access=true) const
The path of this poset.
met_e3_lite()
Default constructor.
Definition: met_e3.cc:53
bool state_is_auto_read_write_accessible(bool xauto_access) const
True if state is auto accessible for read and write, that is, if the state is already accessible for ...
A symmetric tensor of degree p over an abstract vector space.
Definition: stp.h:190
static const std::string & static_class_name()
The name of this class.
Definition: met_e3.cc:509
virtual int dd() const
Dimension of the underlying vector space.
Definition: tp.cc:788
bool full() const
True if both poset name and member name are not empty.
Definition: poset_path.cc:311
An antisymmetric tensor of degree p.
Definition: atp.h:190
void put_is_p_vector(bool xauto_access)
Sets is_p_vector to true; synonym for put_is_contravariant(xauto_access).
Definition: atp.cc:743
Euclidean vector space of dimension 3 (volatile version).
Definition: e3.h:116
row_dofs_type _row_dofs
Row_dofs_type.
Definition: met_e3.h:263
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: st2.h:56
static int d(const namespace_poset &xns, int xp, const poset_path &xvector_space_path, bool xauto_access)
The tensor dimension implied by tensor degree xp and the dimension of the domain vector space specifi...
Definition: atp_space.cc:86
A metric tensor over a 1 dimensional Euclidean vector space (volatile version).
Definition: met_e3.h:145
virtual const std::string & class_name() const
The name of this class.
Definition: met_e3.cc:1264
poset_path path(bool xauto_access=true) const
A path to this component.
bool conforms_to(const schema_poset_member &xother) const
True if the dofs defined by this agree in type and in order with the dofs defined by xother...
The default name space; a poset which contains other posets as members.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
bool path_is_auto_read_accessible(const poset_path &xpath, bool xauto_access) const
True if the state referred to xpath exists and is auto read accessible.
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
poset_path vector_space_path() const
The path of the underlying vector space.
Definition: tp_space.cc:365
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
Definition: met_e3.cc:1044
virtual int dd() const
Dimension of the underlying vector space.
Definition: met_e3.cc:374
bool contains_poset_member(pod_index_type xposet_hub_id, pod_index_type xmember_hub_id, bool xauto_access=true) const
True if this contains a poset with hub id xposet_hub_id which contains a member with hub id xmember_h...
bool state_is_auto_read_accessible(bool xauto_access) const
True if the state is auto accessible for read, that is, if the state is already accessible for read o...
A client handle for a general, abstract partially order set.
A path defined by a poset name and a member name separated by a forward slash (&#39;/&#39;). For example: "cell_definitions/triangle".
Definition: poset_path.h:48
met_e3 & operator=(const row_dofs_type &xrdt)
Assignment to an instance of the associated row dofs type.
Definition: met_e3.cc:965
STL namespace.
value_type component(int xindex) const
The xindex-th component.
Definition: vd.cc:209
T components[6]
The xx, xy and yy dofs.
Definition: met_e3.h:129
virtual value_type component(int xrow, int xcolumn) const
The value of the component in a specified row and column.
Definition: st2.cc:145
virtual void get_read_access() const
Get read access to the state associated with this.
poset_state_handle & member_poset(pod_index_type xhub_id, bool xauto_access=true) const
The poset_state_handle object referred to by hub id xhub_id.
A metric tensor over an abstract vector space (volatile version).
Definition: met.h:43
Euclidean vector space of dimension 3 (persistent version).
Definition: e3.h:467
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
virtual void * row_dofs()
The row dofs for this instance (mutable version).
Definition: met_e3.cc:608
virtual bool is_covariant(bool xauto_access) const
True if and only if all tensor index positions are covariant.
Definition: tp.cc:1078
An antisymmetric tensor of degree p over an abstract vector space (volatile version).
Definition: atp.h:44
static int d(const namespace_poset &xns, int xp, const poset_path &xvector_space_path, bool xauto_access)
The tensor dimension implied by tensor degree xp and the dimension of the domain vector space specifi...
Definition: stp_space.cc:86
A general tensor of "degree" p and given "variance" over an abstract vector space.
Definition: tp.h:253
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
Abstract base class with useful features for all volatile objects.
Definition: any_lite.h:48
Abstract base class with useful features for all objects.
Definition: any.h:39
met_e3()
Default constructor.
Definition: met_e3.cc:810
met_e3_lite & operator=(const met_e3_lite &xother)
Assignment operator.
Definition: met_e3.cc:84
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, const poset_path &xvector_space_path, bool xauto_access)
Creates a new host table for members of this type. The poset is created in namespace xns with path xh...
Definition: met_e3.cc:691
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
bool state_is_read_write_accessible() const
True if this is attached and if the state is accessible for read and write or access control is disab...
bool owns(const poset_state_handle &xposet, bool xauto_access) const
True if and only if this contains the poset xposet. synonym for contains_poset(xposet.poset_path(true), xauto_access)
virtual void detach_from_state()
Detach this handle from its state, if any.
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
virtual stp * new_stp(int xp, bool xauto_access) const
Virtual constructor for symmetric tensors of degree xp over vector space xvector_space.
Definition: met_e3.cc:1230
bool is_p_form(bool xauto_access) const
True if this is a p-form; synonym for is_covariant(xauto_access).
Definition: atp.cc:677
virtual bool contains_member(pod_index_type xmbr_hub_id, bool xauto_access=true) const
True if some version of this poset contains poset member with hub id xmbr_hub_id. ...
int p(int xd, int xdd) const
Tensor degree as a function of tensor dimension xd and domain dimension xdd.
Definition: tp_space.cc:235
virtual value_type component(int xindex) const
The value of the xi-th component.
Definition: vd.cc:1115
bool empty() const
True if both poset name and member name are empty.
Definition: poset_path.cc:291
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
virtual met_e3_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
Definition: met_e3.cc:528
virtual void put_components(const value_type &xx_comp, const value_type &xy_comp, const value_type &xz_comp, const value_type &yy_comp, const value_type &yz_comp, const value_type &zz_comp)
Definition: met_e3.cc:285
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
Definition: tp.h:59
A metric tensor over a 3 dimensional Euclidean vector space (persistent version). ...
Definition: met_e3.h:461
bool contains_poset(pod_index_type xhub_id, bool xauto_access=true) const
True if this contains a poset with hub id xhub_id..
bool path_is_auto_read_available(const poset_path &xpath, bool xauto_access) const
True if the state referred to xpath does not exist or exists and is auto read accessible.
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
Definition: met_e3.cc:561
poset_path scalar_space_path() const
The path of the underlying space of scalars.
Definition: vd_space.cc:250
static host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path<met_e3>(xsuffix). Returns the host if it already exists...
Definition: met_e3.cc:743
bool invariant() const
Class invariant.
Definition: met_e3.cc:580
virtual void get_read_write_access(bool xrelease_read_only_access=false)
Get read write access to the state associated with this. If release_read_only_access is requested...
void put_component(int xindex, value_type xcomp)
Set the xindex-th component to xcomp.
Definition: vd.cc:230
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
Definition: at1_space.h:42
bool invariant() const
Class invariant.
Definition: met_e3.cc:1363
virtual const tp_lite & tp_prototype(int xp) const
Prototype for general tensors of degree xp over this vector space.
Definition: met_e3.cc:405
virtual volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
Definition: met_e3.cc:1062
static const std::string & static_class_name()
The name of this class.
Definition: met_e3.cc:1283
virtual tp * new_tp(int xp, bool xauto_access) const
Virtual constructor for general tensors of degree xp over vector space xvector_space.
Definition: met_e3.cc:1188
virtual const std::string & class_name() const
The name of this class.
Definition: met_e3.cc:490
static int factor_ct(int xd)
Factor_ct() as a function of dimension xd.
Definition: vd_space.cc:167
virtual met_e3 * clone() const
Make a new handle, no state instance of current.
Definition: met_e3.cc:1302
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
vd_value_type value_type
The POD ("plain old data") type of scalar in the vector space of this.
Definition: vd.h:423
int dd() const
The dimension of the underlying ("domain") vector space.
Definition: tp_space.cc:317
~met_e3()
Destructor.
Definition: met_e3.cc:1031
bool is_p_vector(bool xauto_access) const
True if this is a p-vector; synonym for is_contravariant(xauto_access).
Definition: atp.cc:722
virtual ~met_e3_lite()
Destructor.
Definition: met_e3.cc:107
bool is_ancestor_of(const any *xother) const
True if other conforms to current.
Definition: met_e3.cc:1337
virtual int d() const
Dimension of this as a vector space.
Definition: vd.cc:1017
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
Definition: met_e3.cc:637
An abstract client handle for a member of a poset.
std::string path() const
The full path as a string.
Definition: poset_path.cc:450
virtual atp * new_atp(int xp, bool xauto_access) const
Virtual constructor for antisymmetric tensors of degree xp over vector space xvector_space.
Definition: met_e3.cc:1209
virtual const stp_lite & stp_prototype(int xp) const
Prototype for symmetric tensors of degree xp over this vector space.
Definition: met_e3.cc:447
virtual void put_component(int xindex, value_type xvalue)
Sets the value of the xindex-th component to xvalue.
Definition: vd.cc:1169
virtual const atp_lite & atp_prototype(int xp) const
Prototype for antisymmetric tensors of degree xp over this vector space.
Definition: met_e3.cc:426
void put_is_p_form(bool xauto_access)
Sets is_p_form to true; synonym for put_is_covariant(xauto_access).
Definition: atp.cc:699
A symmetric tensor of degree p over an abstract vector space (volatile version).
Definition: stp.h:44
An abstract symmetric tensor space of degree p.
Definition: stp_space.h:42
Namespace for the fiber_bundles component of the sheaf system.
value_type component(int xrow, int xcolumn) const
The component with row index xrow and column index xcolumn.
Definition: st2.cc:751
SHEAF_DLL_SPEC void raise(const met &xmetric, const ed &xcovector, ed &xresult, bool xauto_access)
Raise covector (pre-allocated version for persistent type).
Definition: met.cc:886
bool state_is_not_read_accessible() const
True if this is attached and if the state is accessible for read or if access control is disabled...
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: met_e3.cc:655
A client handle for a poset member which has been prepared for use as a schema.
met_e3_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
Definition: met_e3.h:169
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
Definition: scoped_index.h:710
SHEAF_DLL_SPEC bool isunordered_or_equals(float x1, float x2)
True if isunordered(x1, x2) or x1 == x2.
Definition: sheaf.cc:102