SheafSystem  0.0.0.0
at2_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/at2_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/fiber_bundles_namespace.h"
28 #include "SheafSystem/schema_poset_member.h"
29 #include "SheafSystem/wsv_block.h"
30 
31 using namespace std;
32 using namespace fiber_bundle; // Workaround for MS C++ bug.
33 
34 
35 //==============================================================================
36 // CLASS AT2_E3_LITE
37 //==============================================================================
38 
39 //==============================================================================
40 // AT2_E3 FACET OF CLASS AT2_E3_LITE
41 //==============================================================================
42 
43 // PUBLIC MEMBER FUNCTIONS
44 
47 {
48  // Preconditions:
49 
50  // Body:
51 
52  // Postconditions:
53 
54  ensure(invariant());
55 
56  // Exit:
57 }
58 
60 at2_e3_lite(const at2_e3_lite& xother)
61 {
62  // Preconditions:
63 
64  // Body:
65 
66  *this = xother;
67 
68  // Postconditions:
69 
70  ensure(invariant());
71 
72  // Exit:
73 }
74 
77 operator=(const at2_e3_lite& xother)
78 {
79 
80  // Preconditions:
81 
82  // Body:
83 
84  if(this == &xother)
85  return *this;
86 
87  _row_dofs = xother._row_dofs;
88 
89  // Postconditions:
90 
91  ensure(invariant());
92 
93  // Exit:
94 
95  return *this;
96 }
97 
100 {
101  // Preconditions:
102 
103  // Body:
104 
105  // Postconditions:
106 
107  // Exit:
108 }
109 
111 at2_e3_lite(const row_dofs_type& xrow_dofs)
112 {
113  // Preconditions:
114 
115  // Body:
116 
117  *this = xrow_dofs;
118 
119  // Postconditions:
120 
121  ensure(invariant());
122 
123  // Exit:
124 }
125 
128 operator=(const row_dofs_type& xrow_dofs)
129 {
130  // Preconditions:
131 
132  // Body:
133 
134  _row_dofs = xrow_dofs;
135 
136  // Postconditions:
137 
138  ensure(invariant());
139 
140  // Exit:
141 
142  return *this;
143 
144 }
146 at2_e3_lite(const matrix_type& xmatrix)
147 {
148  // Preconditions:
149 
150  // Body:
151 
152  *this = xmatrix;
153 
154  // Postconditions:
155 
156  ensure(invariant());
157 
158  // Exit:
159 }
160 
161 
164 operator=(const matrix_type& xmatrix)
165 {
166  // Preconditions:
167 
168  // Body:
169 
170  _row_dofs = reinterpret_cast<const row_dofs_type&>(xmatrix);
171 
172  // Postconditions:
173 
174  ensure(invariant());
175 
176  // Exit:
177 
178  return *this;
179 
180 }
181 
182 fiber_bundle::at2_e3_lite::
184 {
185  // Preconditions:
186 
187  // Body:
188 
189  matrix_type& result = _row_dofs;
190 
191  // Postconditions:
192 
193  // Exit:
194 
195  return result;
196 }
197 
198 fiber_bundle::at2_e3_lite::
199 operator const at2_e3_lite::matrix_type& () const
200 {
201  // Preconditions:
202 
203  // Body:
204 
205  const matrix_type& result = _row_dofs;
206 
207  // Postconditions:
208 
209  // Exit:
210 
211  return result;
212 }
213 
214 fiber_bundle::at2_e3_lite::
216 {
217  // Preconditions:
218 
219  // Body:
220 
221  row_dofs_type& result = _row_dofs;
222 
223  // Postconditions:
224 
225  // Exit:
226 
227  return result;
228 }
229 
230 fiber_bundle::at2_e3_lite::
231 operator const at2_e3_lite::row_dofs_type& () const
232 {
233  // Preconditions:
234 
235  // Body:
236 
237  const row_dofs_type& result = _row_dofs;
238 
239  // Postconditions:
240 
241  // Exit:
242 
243  return result;
244 }
245 
247 at2_e3_lite(const value_type& xy, const value_type& xz, const value_type& yz)
248 {
249  // Preconditions:
250 
251  // Body:
252 
253  put_components(xy, xz, yz);
254 
255  // Postconditions:
256 
257  // Exit:
258 }
259 
260 void
262 put_components(const value_type& xy_comp,
263  const value_type& xz_comp,
264  const value_type& yz_comp)
265 {
266  // Preconditions:
267 
268  // Body:
269 
270  put_component(0, xy_comp);
271  put_component(1, xz_comp);
272  put_component(2, yz_comp);
273 
274  // Postconditions:
275 
276  ensure(invariant());
277  ensure(isunordered_or_equals(component(0), xy_comp));
278  ensure(isunordered_or_equals(component(1), xz_comp));
279  ensure(isunordered_or_equals(component(2), yz_comp));
280 
281  // Exit:
282 }
283 
284 // PROTECTED MEMBER FUNCTIONS
285 
286 // PRIVATE MEMBER FUNCTIONS
287 
288 
289 //==============================================================================
290 // INTERIOR ALGEBRA (AT2) FACET OF CLASS AT2_E3_LITE
291 //==============================================================================
292 
293 // PUBLIC MEMBER FUNCTIONS
294 
295 // PROTECTED MEMBER FUNCTIONS
296 
297 // PRIVATE MEMBER FUNCTIONS
298 
299 
300 //==============================================================================
301 // EXTERIOR ALGEBRA (ATP) FACET OF CLASS AT2_E3_LITE
302 //==============================================================================
303 
304 // PUBLIC MEMBER FUNCTIONS
305 
306 // PROTECTED MEMBER FUNCTIONS
307 
308 // PRIVATE MEMBER FUNCTIONS
309 
310 
311 //==============================================================================
312 // TENSOR ALGEBRA (TP) FACET OF CLASS AT2_E3_LITE
313 //==============================================================================
314 
315 // PUBLIC MEMBER FUNCTIONS
316 
317 int
319 dd() const
320 {
321  // Preconditions:
322 
323  // Body:
324 
325  int result = 3;
326 
327  // Postconditions:
328 
329  ensure(invariant());
330  ensure(result == 3);
331 
332  // Exit:
333 
334  return result;
335 }
336 
337 // PROTECTED MEMBER FUNCTIONS
338 
339 // PRIVATE MEMBER FUNCTIONS
340 
341 
342 //==============================================================================
343 // VECTOR ALGEBRA (VD) FACET OF CLASS AT2_E3_LITE
344 //==============================================================================
345 
346 // PUBLIC MEMBER FUNCTIONS
347 
348 
351 tp_prototype(int xp) const
352 {
353  // Preconditions:
354 
355  require(precondition_of(e3_lite::static_tp_prototype(xp)));
356 
357  // Body:
358 
359  const tp_lite& result = e3_lite::static_tp_prototype(xp);
360 
361  // Postconditions:
362 
363  ensure(postcondition_of(e3_lite::static_tp_prototype(xp)));
364 
365  // Exit:
366 
367  return result;
368 }
369 
372 atp_prototype(int xp) const
373 {
374  // Preconditions:
375 
376  require(precondition_of(e3_lite::static_atp_prototype(xp)));
377 
378  // Body:
379 
380  const atp_lite& result = e3_lite::static_atp_prototype(xp);
381 
382  // Postconditions:
383 
384  ensure(postcondition_of(e3_lite::static_atp_prototype(xp)));
385 
386  // Exit:
387 
388  return result;
389 }
390 
393 stp_prototype(int xp) const
394 {
395  // Preconditions:
396 
397  require(precondition_of(e3_lite::static_stp_prototype(xp)));
398 
399  // Body:
400 
401  const stp_lite& result = e3_lite::static_stp_prototype(xp);
402 
403  // Postconditions:
404 
405  ensure(postcondition_of(e3_lite::static_stp_prototype(xp)));
406 
407  // Exit:
408 
409  return result;
410 }
411 
412 // PROTECTED MEMBER FUNCTIONS
413 
414 // PRIVATE MEMBER FUNCTIONS
415 
416 
417 //==============================================================================
418 // CARTESIAN ALGEBRA (TUPLE) FACET OF CLASS AT2_E3_LITE
419 //==============================================================================
420 
421 // PUBLIC MEMBER FUNCTIONS
422 
423 // PROTECTED MEMBER FUNCTIONS
424 
425 // PRIVATE MEMBER FUNCTIONS
426 
427 
428 //==============================================================================
429 // ABSTRACT POSET MEMBER FACET OF CLASS AT2_E3_LITE
430 //==============================================================================
431 
432 // PUBLIC MEMBER FUNCTIONS
433 
434 const std::string&
436 class_name() const
437 {
438  // Preconditions:
439 
440  // Body:
441 
442  const string& result = static_class_name();
443 
444  // Postconditions:
445 
446  ensure(!result.empty());
447 
448  // Exit:
449 
450  return result;
451 }
452 
453 const std::string&
456 {
457  // Preconditions:
458 
459  // Body:
460 
461  static const string result("at2_e3_lite");
462 
463  // Postconditions:
464 
465  ensure(!result.empty());
466 
467  // Exit:
468 
469  return result;
470 }
471 
474 clone() const
475 {
476  at2_e3_lite* result = 0;
477 
478  // Preconditions:
479 
480  // Body:
481 
482  result = new at2_e3_lite();
483 
484  // Postconditions:
485 
486  ensure(result != 0);
487  ensure(is_same_type(*result));
488 
489  // Exit:
490 
491  return result;
492 }
493 
494 // PROTECTED MEMBER FUNCTIONS
495 
496 // PRIVATE MEMBER FUNCTIONS
497 
498 
499 //==============================================================================
500 // ANY FACET OF CLASS AT2_E3_LITE
501 //==============================================================================
502 
503 // PUBLIC MEMBER FUNCTIONS
504 
505 bool
507 is_ancestor_of(const any_lite& xother) const
508 {
509  // Preconditions:
510 
511  require(&xother != 0);
512 
513  // Body:
514 
515  // True if other conforms to this.
516 
517  bool result = dynamic_cast<const at2_e3_lite*>(&xother) != 0;
518 
519  // Postconditions:
520 
521  return result;
522 }
523 
524 bool
526 invariant() const
527 {
528  bool result = true;
529 
530  if(invariant_check())
531  {
532  // Prevent recursive calls to invariant.
533 
534  disable_invariant_check();
535 
536  // Must satisfy base class invariant.
537 
538  invariance(at2_lite::invariant());
539 
540  // Invariances for this class:
541 
542  // Finished, turn invariant checking back on.
543 
544  enable_invariant_check();
545  }
546 
547  // Exit
548 
549  return result;
550 }
551 
552 void*
555 {
556  return &_row_dofs;
557 }
558 
559 const void*
561 row_dofs() const
562 {
563  return &_row_dofs;
564 }
565 
566 // PROTECTED MEMBER FUNCTIONS
567 
568 // PRIVATE MEMBER FUNCTIONS
569 
570 
571 //==============================================================================
572 // CLASS AT2_E3
573 //==============================================================================
574 
575 // ===========================================================
576 // HOST FACTORY FACET OF CLASS AT2_E3
577 // ===========================================================
578 
579 // PUBLIC MEMBER FUNCTIONS
580 
581 const sheaf::poset_path&
584 {
585  // Preconditions:
586 
587 
588  // Body:
589 
590  static const poset_path result(standard_schema_poset_name(), "at2_e3_schema");
591 
592  // Postconditions:
593 
594  // Exit:
595 
596  return result;
597 }
598 
599 void
602 {
603  // Preconditions:
604 
605  require(xns.state_is_read_write_accessible());
606  require(xns.contains_poset(standard_schema_poset_name()));
607  require(!xns.contains_poset_member(standard_schema_path()));
608 
609 
610  // Body:
611 
612  string lmember_names = "xy DOUBLE false ";
613  lmember_names += "xz DOUBLE false ";
614  lmember_names += "yz DOUBLE false";
615 
616  schema_poset_member lschema(xns,
617  standard_schema_path().member_name(),
618  at2::standard_schema_path(),
619  lmember_names,
620  false);
621 
622  lschema.detach_from_state();
623 
624  // Postconditions:
625 
626  ensure(xns.contains_poset_member(standard_schema_path()));
627 
628  // Exit:
629 
630  return;
631 }
632 
636  const poset_path& xhost_path,
637  const poset_path& xschema_path,
638  const poset_path& xvector_space_path,
639  bool xauto_access)
640 {
641  // cout << endl << "Entering at2_e3::new_host." << endl;
642 
643  // Preconditions:
644 
645  require(xns.state_is_auto_read_write_accessible(xauto_access));
646 
647  require(!xhost_path.empty());
648  require(!xns.contains_path(xhost_path, xauto_access));
649 
650  require(xschema_path.full());
651  require(xns.path_is_auto_read_accessible(xschema_path, xauto_access));
652  require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
653  require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 3);
654 
655  require(xns.path_is_auto_read_accessible(xvector_space_path, xauto_access));
656  require(xns.contains_poset<vector_space_type::host_type>(xvector_space_path, xauto_access));
657  require(xns.member_poset(xvector_space_path, xauto_access).schema(xauto_access).conforms_to(vector_space_type::standard_schema_path()));
658  require(xns.member_poset<vector_space_type::host_type>(xvector_space_path, xauto_access).d(xauto_access) == 3);
659 
660  // Body:
661 
662  host_type& result =
663  host_type::new_table(xns, xhost_path, xschema_path, 2, xvector_space_path, xauto_access);
664 
665  // Postconditions:
666 
667  ensure(xns.owns(result, xauto_access));
668  ensure(result.path(true) == xhost_path);
669  ensure(result.state_is_not_read_accessible());
670  ensure(result.schema(true).path(xauto_access) == xschema_path);
671 
672  ensure(result.factor_ct(true) == 3);
673  ensure(result.d(true) == 3);
674  ensure(result.scalar_space_path(true) == xns.member_poset<vector_space_type::host_type>(xvector_space_path, xauto_access).scalar_space_path());
675  ensure(result.p(true) == 2);
676  ensure(result.dd(true) == 3);
677  ensure(result.vector_space_path(true) == xvector_space_path);
678 
679  // Exit:
680 
681  // cout << "Leaving at2_e3::new_host." << endl;
682  return result;
683 }
684 
687 standard_host(namespace_type& xns, const std::string& xsuffix, bool xauto_access)
688 {
689  // cout << endl << "Entering at2_e3::new_host." << endl;
690 
691  // Preconditions:
692 
693  require(xns.state_is_auto_read_write_accessible(xauto_access));
694 
695  require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
696  require(standard_host_is_available<at2_e3>(xns, xsuffix, xauto_access));
697 
698  require(xns.path_is_auto_read_accessible(standard_schema_path(), xauto_access));
699 
700  require(xns.path_is_auto_read_available(standard_host_path<vector_space_type>(xsuffix), xauto_access));
701 
702  // Body:
703 
704  // Create the vector space if necessary.
705 
706  poset_path lvector_space_path = vector_space_type::standard_host(xns, xsuffix, xauto_access).path(true);
707 
708  poset_path lpath(standard_host_path<at2_e3>(xsuffix));
709 
710  host_type* result_ptr;
711  if(xns.contains_path(lpath, xauto_access))
712  {
713  result_ptr = &xns.member_poset<host_type>(lpath, xauto_access);
714  }
715  else
716  {
717  result_ptr = &new_host(xns, lpath, standard_schema_path(), lvector_space_path, xauto_access);
718  }
719 
720  host_type& result = *result_ptr;
721 
722  // Postconditions:
723 
724  ensure(xns.owns(result, xauto_access));
725  ensure(result.path(true) == standard_host_path<at2_e3>(xsuffix));
726  ensure(result.state_is_not_read_accessible());
727  ensure(result.schema(true).path(xauto_access) == standard_schema_path());
728 
729  ensure(result.factor_ct(true) == 3);
730  ensure(result.d(true) == 3);
731  ensure(result.scalar_space_path(true) == standard_host_path<vector_space_type::scalar_type>(xsuffix) );
732  ensure(result.p(true) == 2);
733  ensure(result.dd(true) == 3);
734  ensure(result.vector_space_path(true) == standard_host_path<vector_space_type>(xsuffix) );
735 
736  // Exit:
737 
738  // cout << "Leaving at2_e3::new_host." << endl;
739  return result;
740 }
741 
742 // PROTECTED MEMBER FUNCTIONS
743 
744 // PRIVATE MEMBER FUNCTIONS
745 
746 
747 //==============================================================================
748 // AT2_E3 FACET OF CLASS AT2_E3
749 //==============================================================================
750 
751 // PUBLIC MEMBER FUNCTIONS
752 
755 {
756 
757  // Preconditions:
758 
759  // Body:
760 
761  // Postconditions:
762 
763  ensure(invariant());
764 }
765 
768 {
769  // Preconditions:
770 
771  require(xhost != 0);
772  require(xhost->state_is_read_accessible());
773  require(xhost->contains_member(xhub_id));
774 
775  // Body:
776 
777  attach_to_state(xhost, xhub_id);
778 
779  // Postconditions:
780 
781  ensure(invariant());
782  // ensure(host() == xhost);
783  ensure(index() == xhub_id);
784  ensure(is_attached());
785 }
786 
788 at2_e3(const poset_state_handle* xhost, const scoped_index& xid)
789 {
790  // Preconditions:
791 
792  require(xhost != 0);
793  require(xhost->state_is_read_accessible());
794  require(xhost->contains_member(xid));
795 
796  // Body:
797 
798  attach_to_state(xhost, xid.hub_pod());
799 
800  // Postconditions:
801 
802  ensure(invariant());
803  // ensure(host() == xhost);
804  ensure(index() ==~ xid);
805  ensure(is_attached());
806 }
807 
809 at2_e3(const poset_state_handle* xhost, const std::string& xname)
810 {
811 
812  // Preconditions:
813 
814  require(xhost != 0);
815  require(xhost->state_is_read_accessible());
816  require(!xname.empty());
817  require(xhost->contains_member(xname));
818 
819  // Body:
820 
821  attach_to_state(xhost, xname);
822 
823  // Postconditions:
824 
825  ensure(invariant());
826  // ensure(host() == xhost);
827  ensure(name() == xname);
828  ensure(is_attached());
829 
830 }
831 
834 {
835 
836  // Preconditions:
837 
838  require(xother != 0);
839 
840  // Body:
841 
842  attach_to_state(xother);
843 
844  // Postconditions:
845 
846  ensure(invariant());
847  ensure(is_attached());
848  ensure(is_same_state(xother));
849 
850 }
851 
853 at2_e3(poset_state_handle* xhost, bool xauto_access)
854 {
855 
856  // Preconditions:
857 
858  require(precondition_of(new_jim_state(xhost, 0, false, xauto_access)));
859 
860  // Body:
861 
862  new_jim_state(xhost, 0, false, xauto_access);
863 
864  // Postconditions:
865 
866  ensure(postcondition_of(new_jim_state(xhost, 0, false, xauto_access)));
867 
868  // Exit:
869 
870  return;
871 }
872 
875  const row_dofs_type& xrdt,
876  bool xauto_access)
877 {
878 
879  // Preconditions:
880 
881  require(precondition_of(new_jim_state(&xhost, 0, false, xauto_access)));
882 
883  // Body:
884 
885  new_jim_state(&xhost, 0, false, xauto_access);
886 
887  if(xauto_access)
888  {
889  xhost.get_read_write_access();
890  }
891 
892  *this = xrdt;
893 
894  if(xauto_access)
895  {
896  xhost.release_access();
897  }
898 
899  // Postconditions:
900 
901  ensure(postcondition_of(new_jim_state(&xhost, 0, false, xauto_access)));
902 
903  // Exit:
904 
905  return;
906 }
907 
911 {
912  // Preconditions:
913 
914  require(state_is_read_write_accessible());
915 
916  // Body:
917 
918  sheaf::row_dofs(*this) = xrdt;
919 
920  // Postconditions:
921 
922  ensure_for_all(i, 0, d(), component(i) == xrdt.components[i]);
923 
924  // Exit:
925 
926  return *this;
927 
928 }
929 
934 {
935  // Preconditions:
936 
937  require(is_ancestor_of(&xother));
938  require(precondition_of(attach_to_state(&xother)));
939 
940  // Body:
941 
942  attach_to_state(&xother);
943 
944  // Postconditions:
945 
946  ensure(postcondition_of(attach_to_state(&xother)));
947 
948  // Exit:
949 
950  return *this;
951 }
952 
956 operator=(const at2_e3& xother)
957 {
958  // Preconditions:
959 
960  require(precondition_of(attach_to_state(&xother)));
961 
962  // Body:
963 
964  attach_to_state(&xother);
965 
966  // Postconditions:
967 
968  ensure(postcondition_of(attach_to_state(&xother)));
969 
970  // Exit:
971 
972  return *this;
973 }
974 
977 {
978  // Preconditions:
979 
980  // Body:
981 
982  // Postconditions:
983 }
984 
988 {
989  // Preconditions:
990 
991  // Body:
992 
993  static const volatile_type result;
994 
995  // Postconditions:
996 
997  // Exit:
998 
999  return result;
1000 }
1001 
1005 lite_type() const
1006 {
1007  // Preconditions:
1008 
1009  // Body:
1010 
1011  volatile_type* result = new volatile_type(sheaf::row_dofs(*this));
1012 
1013  // Postconditions:
1014 
1015  // Exit:
1016 
1017  return result;
1018 }
1019 
1020 //==============================================================================
1021 // ROW DOF TUPLE RELATED MEMBER FUNCTIONS
1022 //==============================================================================
1023 
1024 void
1027  dof_type xz_comp,
1028  dof_type yz_comp)
1029 {
1030  // Preconditions:
1031 
1032  require(state_is_read_write_accessible());
1033 
1034  // Body:
1035 
1036  put_component(0, xy_comp);
1037  put_component(1, xz_comp);
1038  put_component(2, yz_comp);
1039 
1040  // Postconditions:
1041 
1042  ensure(invariant());
1043  ensure(isunordered_or_equals(component(0), xy_comp));
1044  ensure(isunordered_or_equals(component(1), xz_comp));
1045  ensure(isunordered_or_equals(component(2), yz_comp));
1046 
1047  // Exit:
1048 
1049  return;
1050 }
1051 
1052 fiber_bundle::at2_e3::
1054 {
1055  // Preconditions:
1056 
1057  // Body:
1058 
1059  row_dofs_type& result = sheaf::row_dofs(*this);
1060 
1061  // Postconditions:
1062 
1063  // Exit:
1064 
1065  return result;
1066 }
1067 
1068 fiber_bundle::at2_e3::
1069 operator const at2_e3::row_dofs_type& () const
1070 {
1071  // Preconditions:
1072 
1073  // Body:
1074 
1075  const row_dofs_type& result = sheaf::row_dofs(*this);
1076 
1077  // Postconditions:
1078 
1079  // Exit:
1080 
1081  return result;
1082 }
1083 
1084 // PROTECTED MEMBER FUNCTIONS
1085 
1086 // PRIVATE MEMBER FUNCTIONS
1087 
1088 
1089 //==============================================================================
1090 // AT2 FACET OF CLASS AT2_E3
1091 //==============================================================================
1092 
1093 // PUBLIC MEMBER FUNCTIONS
1094 
1095 // PROTECTED MEMBER FUNCTIONS
1096 
1097 // PRIVATE MEMBER FUNCTIONS
1098 
1099 
1100 //==============================================================================
1101 // ATP FACET OF CLASS AT2_E3
1102 //==============================================================================
1103 
1104 // PUBLIC MEMBER FUNCTIONS
1105 
1106 //==============================================================================
1107 // TP FACET OF CLASS AT2_E3
1108 //==============================================================================
1109 
1110 // PUBLIC MEMBER FUNCTIONS
1111 
1112 // PROTECTED MEMBER FUNCTIONS
1113 
1114 // PRIVATE MEMBER FUNCTIONS
1115 
1116 
1117 //==============================================================================
1118 // VD FACET OF CLASS AT2_E3
1119 //==============================================================================
1120 
1121 // PUBLIC MEMBER FUNCTIONS
1122 
1123 // PROTECTED MEMBER FUNCTIONS
1124 
1125 // PRIVATE MEMBER FUNCTIONS
1126 
1127 
1128 //==============================================================================
1129 // TUPLE FACET OF CLASS AT2_E3
1130 //==============================================================================
1131 
1132 // PUBLIC MEMBER FUNCTIONS
1133 
1136 new_tp(int xp, bool xauto_access) const
1137 {
1138  // Preconditions:
1139 
1140  require(precondition_of(e3::new_tp(vector_space(xauto_access), xp)));
1141 
1142  // Body:
1143 
1144  tp* result = e3::new_tp(vector_space(xauto_access), xp);
1145 
1146  // Postconditions:
1147 
1148  ensure(postcondition_of(e3::new_tp(vector_space(xauto_access), xp)));
1149 
1150  // Exit:
1151 
1152  return result;
1153 }
1154 
1157 new_atp(int xp, bool xauto_access) const
1158 {
1159  // Preconditions:
1160 
1161  require(precondition_of(e3::new_atp(vector_space(xauto_access), xp)));
1162 
1163  // Body:
1164 
1165  atp* result = e3::new_atp(vector_space(xauto_access), xp);
1166 
1167  // Postconditions:
1168 
1169  ensure(postcondition_of(e3::new_atp(vector_space(xauto_access), xp)));
1170 
1171  // Exit:
1172 
1173  return result;
1174 }
1175 
1178 new_stp(int xp, bool xauto_access) const
1179 {
1180  // Preconditions:
1181 
1182  require(precondition_of(e3::new_stp(vector_space(xauto_access), xp)));
1183 
1184  // Body:
1185 
1186  stp* result = e3::new_stp(vector_space(xauto_access), xp);
1187 
1188  // Postconditions:
1189 
1190  ensure(postcondition_of(e3::new_stp(vector_space(xauto_access), xp)));
1191 
1192  // Exit:
1193 
1194  return result;
1195 }
1196 
1197 
1198 //==============================================================================
1199 // ABSTRACT POSET MEMBER FACET OF CLASS AT2_E3
1200 //==============================================================================
1201 
1202 // PUBLIC MEMBER FUNCTIONS
1203 
1204 const std::string&
1206 class_name() const
1207 {
1208  // Preconditions:
1209 
1210  // Body:
1211 
1212  const string& result = static_class_name();
1213 
1214  // Postconditions:
1215 
1216  ensure(!result.empty());
1217 
1218  // Exit:
1219 
1220  return result;
1221 }
1222 
1223 const std::string&
1226 {
1227  // Preconditions:
1228 
1229  // Body:
1230 
1231  static const string result("at2_e3");
1232 
1233  // Postconditions:
1234 
1235  ensure(!result.empty());
1236 
1237  // Exit:
1238 
1239  return result;
1240 }
1241 
1244 clone() const
1245 {
1246 
1247  // Preconditions:
1248 
1249  // Body:
1250 
1251  // Create new handle of the current class.
1252 
1253  at2_e3* result = new at2_e3();
1254 
1255  // Postconditions:
1256 
1257  ensure(result != 0);
1258  ensure(result->invariant());
1259 
1260  // Exit:
1261 
1262  return result;
1263 
1264 }
1265 
1266 // PROTECTED MEMBER FUNCTIONS
1267 
1268 // PRIVATE MEMBER FUNCTIONS
1269 
1270 
1271 //==============================================================================
1272 // ANY FACET OF CLASS AT2_E3
1273 //==============================================================================
1274 
1275 // PUBLIC MEMBER FUNCTIONS
1276 
1277 bool
1279 is_ancestor_of(const any* xother) const
1280 {
1281 
1282  // Preconditions:
1283 
1284  require(xother != 0);
1285 
1286  // Body:
1287 
1288  bool result = dynamic_cast<const at2_e3*>(xother) != 0;
1289 
1290  // Postconditions:
1291 
1292  // Exit:
1293 
1294  return result;
1295 
1296 }
1297 
1298 bool
1300 invariant() const
1301 {
1302  bool result = true;
1303 
1304  // Body:
1305 
1306  // Must satisfy base class invariant.
1307 
1308  if(invariant_check())
1309  {
1310  // Prevent recursive calls to invariant.
1311 
1312  disable_invariant_check();
1313 
1314  // Must satisfy base class invariant.
1315 
1316  invariance(at2::invariant());
1317 
1318  // Invariances for this class:
1319 
1320  invariance(is_attached() ? (p() == 2) : true);
1321  invariance(is_attached() ? (dd() == 3) : true);
1322 
1323  // Finished, turn invariant checking back on.
1324 
1325  enable_invariant_check();
1326  }
1327 
1328  // Exit:
1329 
1330  return result;
1331 }
1332 
1333 // PROTECTED MEMBER FUNCTIONS
1334 
1335 // PRIVATE MEMBER FUNCTIONS
1336 
1337 
1338 //==============================================================================
1339 // NON-MEMBER FUNCTIONS
1340 //==============================================================================
1341 
1342 #include "SheafSystem/at0.h"
1343 
1344 void
1346 hook(const e3& x0, const e3& x1, at0& xresult, bool xauto_access)
1347 {
1348  // Preconditions:
1349 
1350  require(x0.state_is_auto_read_accessible(xauto_access));
1351  require(x1.state_is_auto_read_accessible(xauto_access));
1352  require(xresult.state_is_auto_read_write_accessible(xauto_access));
1353 
1354  require(x0.is_p_form(xauto_access) == x1.is_p_form(xauto_access));
1355 
1356  // Body:
1357 
1358  if(xauto_access)
1359  {
1360  x0.get_read_access();
1361  x1.get_read_access();
1362  xresult.get_read_write_access(true);
1363  }
1364 
1365  // The hook operation is essentially a contract, so here we
1366  // could call the vd facet contract function here, but we'll
1367  // reimplement it for efficiency.
1368 
1369  vd_value_type a0 = x0.component(0);
1370  vd_value_type a1 = x0.component(1);
1371  vd_value_type a2 = x0.component(2);
1372 
1373  vd_value_type b0 = x1.component(0);
1374  vd_value_type b1 = x1.component(1);
1375  vd_value_type b2 = x1.component(2);
1376 
1377  vd_value_type lcomp = a0*b0 + a1*b1 + a2*b2;
1378 
1379  xresult.put_component(0, lcomp);
1380 
1381 
1382  // Set the variance of the result.
1383 
1384  // Nothing to do; at0 is both p_form and p_vector.
1385 
1386  if(xauto_access)
1387  {
1388  x0.release_access();
1389  x1.release_access();
1390  xresult.release_access();
1391  }
1392 
1393  // Postconditions:
1394 
1395  // Exit:
1396 
1397  return;
1398 
1399 }
1400 
1401 void
1403 hook(const e3_lite& x0, const e3_lite& x1, at0_lite& xresult)
1404 {
1405  // Preconditions:
1406 
1407  // Body:
1408 
1409  // The hook operation is essentially a contract, so here we
1410  // could call the vd facet contract function here, but we'll
1411  // reimplement it for efficiency.
1412 
1413  vd_value_type a0 = x0.component(0);
1414  vd_value_type a1 = x0.component(1);
1415  vd_value_type a2 = x0.component(2);
1416 
1417  vd_value_type b0 = x1.component(0);
1418  vd_value_type b1 = x1.component(1);
1419  vd_value_type b2 = x1.component(2);
1420 
1421  vd_value_type lcomp = a0*b0 + a1*b1 + a2*b2;
1422 
1423  xresult.put_component(0, lcomp);
1424 
1425  // Postconditions:
1426 
1428 
1429  //ensure();
1430 
1431  // Exit:
1432 
1433  return;
1434 
1435 }
1436 
1437 void
1439 hook(const at2_e3& x0, const e3& x1, e3& xresult, bool xauto_access)
1440 {
1441  // Preconditions:
1442 
1443  require(x0.state_is_auto_read_accessible(xauto_access));
1444  require(x1.state_is_auto_read_accessible(xauto_access));
1445  require(xresult.state_is_auto_read_write_accessible(xauto_access));
1446  require(x0.is_p_form(xauto_access) == x1.is_p_form(xauto_access));
1447 
1448  // Body:
1449 
1450  if(xauto_access)
1451  {
1452  x0.get_read_access();
1453  x1.get_read_access();
1454  xresult.get_read_write_access(true);
1455  }
1456 
1457  // The hook operation is essentially a contract operation
1458  // on the first index. In 3d this is pretty simple,
1459  // so we implement it explicitly for efficiency.
1460 
1461  vd_value_type a01 = x0.component(0);
1462  vd_value_type a02 = x0.component(1);
1463  vd_value_type a12 = x0.component(2);
1464 
1465  vd_value_type b0 = x1.component(0);
1466  vd_value_type b1 = x1.component(1);
1467  vd_value_type b2 = x1.component(2);
1468 
1469  int lrank = 2;
1470 
1471  vd_value_type lcomp0 = lrank*(-a01*b1 - a02*b2);
1472  vd_value_type lcomp1 = lrank*( a01*b0 - a12*b2);
1473  vd_value_type lcomp2 = lrank*( a02*b0 + a12*b1);
1474 
1475  xresult.put_component(0, lcomp0);
1476  xresult.put_component(1, lcomp1);
1477  xresult.put_component(2, lcomp2);
1478 
1479 
1480  // Set the variance of the result.
1481 
1482  x0.is_p_form(false) ? xresult.put_is_p_form(false)
1483  : xresult.put_is_p_vector(false);
1484 
1485 
1486  if(xauto_access)
1487  {
1488  x0.release_access();
1489  x1.release_access();
1490  xresult.release_access();
1491  }
1492 
1493  // Postconditions:
1494 
1495  ensure(xresult.is_p_form(xauto_access) == x0.is_p_form(xauto_access));
1496 
1497  // Exit:
1498 
1499  return;
1500 
1501 }
1502 
1503 void
1505 hook(const at2_e3_lite& x0, const e3_lite& x1, e3_lite& xresult)
1506 {
1507  // Preconditions:
1508 
1509  // Body:
1510 
1511  // The hook operation is essentially a contract operation
1512  // on the first index. In 3d this is pretty simple,
1513  // so we implement it explicitly for efficiency.
1514 
1515  vd_value_type a01 = x0.component(0);
1516  vd_value_type a02 = x0.component(1);
1517  vd_value_type a12 = x0.component(2);
1518 
1519  vd_value_type b0 = x1.component(0);
1520  vd_value_type b1 = x1.component(1);
1521  vd_value_type b2 = x1.component(2);
1522 
1523  int lrank = 2;
1524 
1525  vd_value_type lcomp0 = lrank*(-a01*b1 - a02*b2);
1526  vd_value_type lcomp1 = lrank*( a01*b0 - a12*b2);
1527  vd_value_type lcomp2 = lrank*( a02*b0 + a12*b1);
1528 
1529  xresult.put_component(0, lcomp0);
1530  xresult.put_component(1, lcomp1);
1531  xresult.put_component(2, lcomp2);
1532 
1533  // Postconditions:
1534 
1536 
1537  //ensure();
1538 
1539  // Exit:
1540 
1541  return;
1542 
1543 }
1544 
1545 void
1547 star(const at2_e3& x0, e3& xresult, bool xauto_access)
1548 {
1549  require(x0.state_is_auto_read_accessible(xauto_access));
1550  require(xresult.state_is_auto_read_write_accessible(xauto_access));
1551 
1552  // Body:
1553 
1554  if(xauto_access)
1555  {
1556  x0.get_read_access();
1557  xresult.get_read_write_access(true);
1558  }
1559 
1560  vd_value_type a12 = x0.component(0);
1561  vd_value_type a13 = x0.component(1);
1562  vd_value_type a23 = x0.component(2);
1563 
1564  vd_value_type lcomp0 = a23;
1565  vd_value_type lcomp1 = -a13;
1566  vd_value_type lcomp2 = a12;
1567 
1568  xresult.put_component(0, lcomp0);
1569  xresult.put_component(1, lcomp1);
1570  xresult.put_component(2, lcomp2);
1571 
1572  // Set the variance of the result.
1573 
1574  x0.is_p_form(false) ? xresult.put_is_p_form(false)
1575  : xresult.put_is_p_vector(false);
1576 
1577  if(xauto_access)
1578  {
1579  x0.release_access();
1580  xresult.release_access();
1581  }
1582 
1583  // Postconditions:
1584 
1585  ensure(xresult.is_p_form(xauto_access) == x0.is_p_form(xauto_access));
1586 
1587  //ensure();
1588 
1589  // Exit:
1590 
1591  return;
1592 }
1593 
1594 void
1596 star(const at2_e3_lite& x0, e3_lite& xresult)
1597 {
1598  // Preconditions:
1599 
1600  // Body:
1601 
1602  vd_value_type a12 = x0.component(0);
1603  vd_value_type a13 = x0.component(1);
1604  vd_value_type a23 = x0.component(2);
1605 
1606  vd_value_type lcomp0 = a23;
1607  vd_value_type lcomp1 = -a13;
1608  vd_value_type lcomp2 = a12;
1609 
1610  xresult.put_component(0, lcomp0);
1611  xresult.put_component(1, lcomp1);
1612  xresult.put_component(2, lcomp2);
1613 
1614  // Postconditions:
1615 
1617 
1618  //ensure();
1619 
1620  // Exit:
1621 
1622  return;
1623 }
1624 
1627 star(const at2_e3_lite& x0)
1628 {
1629  // Preconditions:
1630 
1631  // Body:
1632 
1633  e3_lite* result = new e3_lite();
1634 
1635  star(x0, *result);
1636 
1637  // Postconditions:
1638 
1640 
1641  //ensure();
1642 
1643  // Exit:
1644 
1645  return result;
1646 }
1647 
1648 void
1650 star(const e3& x0, at2_e3& xresult, bool xauto_access)
1651 {
1652  require(x0.state_is_auto_read_accessible(xauto_access));
1653  require(xresult.state_is_auto_read_write_accessible(xauto_access));
1654 
1655  // Body:
1656 
1657  if(xauto_access)
1658  {
1659  x0.get_read_access();
1660  xresult.get_read_write_access(true);
1661  }
1662 
1663  define_old_variable(bool old_xresult_is_p_form = xresult.is_p_form(false));
1664 
1665  vd_value_type a1 = x0.component(0);
1666  vd_value_type a2 = x0.component(1);
1667  vd_value_type a3 = x0.component(2);
1668 
1669  vd_value_type lcomp12 = a3;
1670  vd_value_type lcomp13 = -a2 ;
1671  vd_value_type lcomp23 = a1;
1672 
1673  xresult.put_component(0, lcomp12);
1674  xresult.put_component(1, lcomp13);
1675  xresult.put_component(2, lcomp23);
1676 
1677  if(xauto_access)
1678  {
1679  x0.release_access();
1680  xresult.release_access();
1681  }
1682 
1683  // Postconditions:
1684 
1685  ensure(xresult.is_p_form(xauto_access) == old_xresult_is_p_form);
1686 
1687  //ensure();
1688 
1689  // Exit:
1690 
1691  return;
1692 }
1693 
1694 void
1696 star(const e3_lite& x0, at2_e3_lite& xresult)
1697 {
1698  // Preconditions:
1699 
1700  // Body:
1701 
1702  vd_value_type a1 = x0.component(0);
1703  vd_value_type a2 = x0.component(1);
1704  vd_value_type a3 = x0.component(2);
1705 
1706  vd_value_type lcomp12 = a3;
1707  vd_value_type lcomp13 = -a2 ;
1708  vd_value_type lcomp23 = a1;
1709 
1710  xresult.put_component(0, lcomp12);
1711  xresult.put_component(1, lcomp13);
1712  xresult.put_component(2, lcomp23);
1713 
1714  // Postconditions:
1715 
1717 
1718  //ensure();
1719 
1720  // Exit:
1721 
1722  return;
1723 }
1724 
1727 star(const e3_lite& x0)
1728 {
1729  // Preconditions:
1730 
1731  // Body:
1732 
1733  at2_e3_lite* result = new at2_e3_lite();
1734 
1735  star(x0, *result);
1736 
1737  // Postconditions:
1738 
1740 
1741  //ensure();
1742 
1743  // Exit:
1744 
1745  return result;
1746 }
1747 
1748 void
1750 wedge(const e3& x0, const e3& x1, at2_e3& xresult, bool xauto_access)
1751 {
1752  // Preconditions:
1753 
1754  require(x0.state_is_auto_read_accessible(xauto_access));
1755  require(x1.state_is_auto_read_accessible(xauto_access));
1756  require(xresult.state_is_auto_read_write_accessible(xauto_access));
1757  require(x0.is_p_form(xauto_access) == x1.is_p_form(xauto_access));
1758 
1759  // Body:
1760 
1761  if(xauto_access)
1762  {
1763  x0.get_read_access();
1764  x1.get_read_access();
1765  xresult.get_read_write_access(true);
1766  }
1767 
1768  // The basis order we assume here is "e1^e2, e1^e3, e2^e3"
1769  // Don't confuse "e1, e2, e3" here with fibers with the same name.
1770 
1771  vd_value_type a1 = x0.component(0);
1772  vd_value_type a2 = x0.component(1);
1773  vd_value_type a3 = x0.component(2);
1774 
1775  vd_value_type b1 = x1.component(0);
1776  vd_value_type b2 = x1.component(1);
1777  vd_value_type b3 = x1.component(2);
1778 
1779  vd_value_type lcomp12 = a1*b2 - a2*b1;
1780  vd_value_type lcomp13 = a1*b3 - a3*b1;
1781  vd_value_type lcomp23 = a2*b3 - a3*b2;
1782 
1783  xresult.put_component(0, lcomp12);
1784  xresult.put_component(1, lcomp13);
1785  xresult.put_component(2, lcomp23);
1786 
1787  // Set the variance of the result.
1788 
1789  x0.is_p_form(false) ? xresult.put_is_p_form(false)
1790  : xresult.put_is_p_vector(false);
1791 
1792 
1793  if(xauto_access)
1794  {
1795  x0.release_access();
1796  x1.release_access();
1797  xresult.release_access();
1798  }
1799 
1800  // Postconditions:
1801 
1802  ensure(xresult.is_p_form(xauto_access) == x0.is_p_form(xauto_access));
1803 
1804  //ensure();
1805 
1806  // Exit:
1807 
1808  return;
1809 }
1810 
1811 void
1813 wedge(const e3_lite& x0, const e3_lite& x1, at2_e3_lite& xresult)
1814 {
1815  // Preconditions:
1816 
1817  // Body:
1818 
1819  // The basis order we assume here is "e1^e2, e1^e3, e2^e3".
1820  // Don't confuse "e1, e2, e3" here with the fiber class names.
1821 
1822  vd_value_type a1 = x0.component(0);
1823  vd_value_type a2 = x0.component(1);
1824  vd_value_type a3 = x0.component(2);
1825 
1826  vd_value_type b1 = x1.component(0);
1827  vd_value_type b2 = x1.component(1);
1828  vd_value_type b3 = x1.component(2);
1829 
1830  vd_value_type lcomp12 = a1*b2 - a2*b1;
1831  vd_value_type lcomp13 = a1*b3 - a3*b1;
1832  vd_value_type lcomp23 = a2*b3 - a3*b2;
1833 
1834  xresult.put_component(0, lcomp12);
1835  xresult.put_component(1, lcomp13);
1836  xresult.put_component(2, lcomp23);
1837 
1838  // Postconditions:
1839 
1841 
1842  //ensure();
1843 
1844  // Exit:
1845 
1846  return;
1847 }
1848 
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 poset_path path(bool xauto_access=true) const
The path of this poset.
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 ...
static host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path<at2_e3>(xsuffix). Returns the host if it already exists...
Definition: at2_e3.cc:687
virtual void * row_dofs()
The row dofs for this instance (mutable version).
Definition: at2_e3.cc:554
virtual at2_e3 * clone() const
Make a new handle, no state instance of current.
Definition: at2_e3.cc:1244
A symmetric tensor of degree p over an abstract vector space.
Definition: stp.h:190
virtual void put_component(int xrow, int xcolumn, value_type xcomp)
Sets value of a component in a specified row and column.
Definition: at2.cc:187
bool full() const
True if both poset name and member name are not empty.
Definition: poset_path.cc:311
virtual atp * new_atp(int xp, bool xauto_access) const
Virtual constructor for antisymmetric tensors of degree xp over vector space xvector_space.
Definition: at2_e3.cc:1157
virtual const tp_lite & tp_prototype(int xp) const
Prototype for general tensors of degree xp over this vector space.
Definition: at2_e3.cc:351
virtual void put_components(const value_type &xy_comp, const value_type &xz_comp, const value_type &yz_comp)
Set values of the components to the given arguments.
Definition: at2_e3.cc:262
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
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
poset_path path(bool xauto_access=true) const
A path to this component.
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 3. (persistent version)...
Definition: at2_e3.h:424
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...
~at2_e3()
Destructor.
Definition: at2_e3.cc:976
at2_e3 & operator=(const row_dofs_type &xrdt)
Assignment to an instance of the associated row dofs type.
Definition: at2_e3.cc:910
poset_path vector_space_path() const
The path of the underlying vector space.
Definition: tp_space.cc:365
virtual const atp_lite & atp_prototype(int xp) const
Prototype for antisymmetric tensors of degree xp over this vector space.
Definition: at2_e3.cc:372
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...
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: at2_e3.cc:601
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
row_dofs_type _row_dofs
Row_dofs_type.
Definition: at2_e3.h:248
STL namespace.
value_type component(int xindex) const
The xindex-th component.
Definition: vd.cc:209
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.
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).
An antisymmetric tensor of degree p over an abstract vector space (volatile version).
Definition: atp.h:44
A general tensor of "degree" p and given "variance" over an abstract vector space.
Definition: tp.h:253
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: at2_e3.cc:635
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
static const std::string & static_class_name()
The name of this class.
Definition: at2_e3.cc:1225
SHEAF_DLL_SPEC void wedge(const e2 &x0, const e2 &x1, at2_e2 &xresult, bool xauto_access)
The exterior (wedge) product of two antisymmetric tensors (pre-allocated version for persistent types...
Definition: at2_e2.cc:1779
T components[3]
The xy, xz, yz dofs.
Definition: at2_e3.h:125
SHEAF_DLL_SPEC void hook(const e2 &x0, const e2 &x1, at0 &xresult, bool xauto_access)
The interior (hook) product of two antisymmetric tensors (pre-allocated version for persistent types)...
Definition: at2_e2.cc:1328
at2_e3_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
Definition: at2_e3.h:161
bool invariant() const
Class invariant.
Definition: at2_e3.cc:526
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
virtual ~at2_e3_lite()
Destructor.
Definition: at2_e3.cc:99
An abstract antisymmetric tensor space of degree p.
Definition: atp_space.h:42
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.
virtual const stp_lite & stp_prototype(int xp) const
Prototype for symmetric tensors of degree xp over this vector space.
Definition: at2_e3.cc:393
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
A scalar viewed as an antisymmetric tensor of degree 0. As the degree is 0 there is nothing to be sym...
Definition: at0.h:424
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
bool invariant() const
Class invariant.
Definition: at2_e3.cc:1300
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
Antisymetric tensor of degree 0 (volatile version).
Definition: at0.h:127
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 void put_components(dof_type xy_comp, dof_type xz_comp, dof_type yz_comp)
Sets values of the components to the given arguments.
Definition: at2_e3.cc:1026
virtual value_type component(int xindex) const
The value of the xi-th component.
Definition: vd.cc:1115
at2_e3_lite & operator=(const at2_e3_lite &xother)
Assignment operator.
Definition: at2_e3.cc:77
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...
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
Definition: tp.h:59
bool is_ancestor_of(const any *xother) const
True if xother conforms to current.
Definition: at2_e3.cc:1279
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: at2_e3.cc:507
poset_path scalar_space_path() const
The path of the underlying space of scalars.
Definition: vd_space.cc:250
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
Definition: at2_e3.cc:987
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
virtual void put_component(value_type xcomp)
Set value of (the only) component to xcomp.
Definition: at0.cc:270
virtual volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
Definition: at2_e3.cc:1005
static int factor_ct(int xd)
Factor_ct() as a function of dimension xd.
Definition: vd_space.cc:167
at2_e3_lite()
Default constructor.
Definition: at2_e3.cc:46
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: at2.h:56
int dd() const
The dimension of the underlying ("domain") vector space.
Definition: tp_space.cc:317
virtual tp * new_tp(int xp, bool xauto_access) const
Virtual constructor for general tensors of degree xp over vector space xvector_space.
Definition: at2_e3.cc:1136
virtual int dd() const
Dimension of the underlying vector space.
Definition: at2_e3.cc:319
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 3. (volatile version)...
Definition: at2_e3.h:142
A general antisymmetric tensor of degree 2 over an abstract vector space (volatile version)...
Definition: at2.h:43
static const std::string & static_class_name()
The name of this class.
Definition: at2_e3.cc:455
virtual value_type component(int xrow, int xcolumn) const
The value of the component in a specified row and column.
Definition: at2.cc:148
An abstract client handle for a member of a poset.
virtual at2_e3_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
Definition: at2_e3.cc:474
std::string path() const
The full path as a string.
Definition: poset_path.cc:450
vd_dof_type dof_type
The type of the degrees of freedom. Note that although dof_type == value_type in this implementation...
Definition: vd.h:431
value_type component(int xrow, int xcolumn) const
The component with row index xrow and column index xcolumn.
Definition: at2.cc:787
virtual void put_component(int xindex, value_type xvalue)
Sets the value of the xindex-th component to xvalue.
Definition: vd.cc:1169
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
void put_component(int xrow, int xcolumn, value_type xvalue)
Sets the component with row index xrow and column index xcolumn to xvalue.
Definition: at2.cc:851
A symmetric tensor of degree p over an abstract vector space (volatile version).
Definition: stp.h:44
virtual stp * new_stp(int xp, bool xauto_access) const
Virtual constructor for symmetric tensors of degree xp over vector space xvector_space.
Definition: at2_e3.cc:1178
Namespace for the fiber_bundles component of the sheaf system.
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
Definition: at2_e3.cc:583
virtual const std::string & class_name() const
The name of this class.
Definition: at2_e3.cc:436
SHEAF_DLL_SPEC void star(const at2_e2 &x0, at0 &xresult, bool xauto_access)
The Hodge star operator for antisymmetric tensors (pre-allocated version persistent types)...
Definition: at2_e2.cc:1518
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...
virtual const std::string & class_name() const
The name of this class.
Definition: at2_e3.cc:1206
A client handle for a poset member which has been prepared for use as a schema.
double vd_value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: fiber_bundle.h:63
at2_e3()
Default constructor.
Definition: at2_e3.cc:754
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