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