SheafSystem  0.0.0.0
st3_e3.cc
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 
18 // Implementation for class st3_e3.
19 
20 #include "SheafSystem/st3_e3.impl.h"
21 
22 #include "SheafSystem/abstract_poset_member.impl.h"
23 #include "SheafSystem/assert_contract.h"
24 #include "SheafSystem/at0.h"
25 #include "SheafSystem/at1_space.h"
26 #include "SheafSystem/stp_space.h"
27 #include "SheafSystem/fiber_bundles_namespace.h"
28 #include "SheafSystem/schema_poset_member.h"
29 #include "SheafSystem/wsv_block.h"
30 
31 
32 using namespace std;
33 using namespace fiber_bundle; // Workaround for MS C++ bug.
34 
35 
36 //==============================================================================
37 // CLASS ST3_E3_LITE
38 //==============================================================================
39 
40 //==============================================================================
41 // ST3_E3 FACET OF CLASS ST3_E3_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 st3_e3_lite(const st3_e3_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 st3_e3_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 
95  // Exit:
96 
97  return *this;
98 }
99 
102 {
103  // Preconditions:
104 
105  // Body:
106 
107  // Postconditions:
108 
109  // Exit:
110 }
111 
113 st3_e3_lite(const row_dofs_type& xrow_dofs)
114 {
115  // Preconditions:
116 
117  // Body:
118 
119  *this = xrow_dofs;
120 
121  // Postconditions:
122 
123  ensure(invariant());
124 
125  // Exit:
126 }
127 
130 operator=(const row_dofs_type& xrow_dofs)
131 {
132  // Preconditions:
133 
134  // Body:
135 
136  _row_dofs = xrow_dofs;
137 
138  // Postconditions:
139 
140  ensure(invariant());
141 
142  // Exit:
143 
144  return *this;
145 
146 }
147 
148 fiber_bundle::st3_e3_lite::
150 {
151  // Preconditions:
152 
153  // Body:
154 
155  row_dofs_type& result = _row_dofs;
156 
157  // Postconditions:
158 
159  // Exit:
160 
161  return result;
162 }
163 
164 fiber_bundle::st3_e3_lite::
165 operator const st3_e3_lite::row_dofs_type& () const
166 {
167  // Preconditions:
168 
169  // Body:
170 
171  const row_dofs_type& result = _row_dofs;
172 
173  // Postconditions:
174 
175  // Exit:
176 
177  return result;
178 }
179 
180 
181 // fiber_bundle::st3_e3_lite::
182 // st3_e3_lite(const value_type& xcomp)
183 // {
184 // // Preconditions:
185 
186 // // Body:
187 
188 // put_components(xcomp);
189 
190 // // Postconditions:
191 
192 // // Exit:
193 // }
194 
195 // void
196 // fiber_bundle::st3_e3_lite::
197 // put_components(const value_type& xcomp)
198 // {
199 // // Preconditions:
200 
201 // // Body:
202 
203 // put_component(0, xcomp);
204 
205 // // Postconditions:
206 
207 // ensure(invariant());
208 // ensure(isunordered_or_equals(component(0), xcomp));
209 
210 // // Exit:
211 // }
212 
213 // PROTECTED MEMBER FUNCTIONS
214 
215 // PRIVATE MEMBER FUNCTIONS
216 
217 
218 //==============================================================================
219 // INTERIOR ALGEBRA (ST3) FACET OF CLASS ST3_E3_LITE
220 //==============================================================================
221 
222 // PUBLIC MEMBER FUNCTIONS
223 
224 // PROTECTED MEMBER FUNCTIONS
225 
226 // PRIVATE MEMBER FUNCTIONS
227 
228 
229 //==============================================================================
230 // INTERIOR ALGEBRA (STP) FACET OF CLASS ST3_E3_LITE
231 //==============================================================================
232 
233 // PUBLIC MEMBER FUNCTIONS
234 
235 // PROTECTED MEMBER FUNCTIONS
236 
237 // PRIVATE MEMBER FUNCTIONS
238 
239 
240 //==============================================================================
241 // TENSOR ALGEBRA (TP) FACET OF CLASS ST3_E3_LITE
242 //==============================================================================
243 
244 // PUBLIC MEMBER FUNCTIONS
245 
246 int
248 dd() const
249 {
250  // Preconditions:
251 
252  // Body:
253 
254  int result = 3;
255 
256  // Postconditions:
257 
258  ensure(invariant());
259  ensure(result == 3);
260 
261  // Exit:
262 
263  return result;
264 }
265 
266 // PROTECTED MEMBER FUNCTIONS
267 
268 // PRIVATE MEMBER FUNCTIONS
269 
270 
271 //==============================================================================
272 // VECTOR ALGEBRA (VD) FACET OF CLASS ST3_E3_LITE
273 //==============================================================================
274 
275 // PUBLIC MEMBER FUNCTIONS
276 
279 tp_prototype(int xp) const
280 {
281  // Preconditions:
282 
283  require(precondition_of(e3_lite::static_tp_prototype(xp)));
284 
285  // Body:
286 
287  const tp_lite& result = e3_lite::static_tp_prototype(xp);
288 
289  // Postconditions:
290 
291  ensure(postcondition_of(e3_lite::static_tp_prototype(xp)));
292 
293  // Exit:
294 
295  return result;
296 }
297 
300 atp_prototype(int xp) const
301 {
302  // Preconditions:
303 
304  require(precondition_of(e3_lite::static_atp_prototype(xp)));
305 
306  // Body:
307 
308  const atp_lite& result = e3_lite::static_atp_prototype(xp);
309 
310  // Postconditions:
311 
312  ensure(postcondition_of(e3_lite::static_atp_prototype(xp)));
313 
314  // Exit:
315 
316  return result;
317 }
318 
321 stp_prototype(int xp) const
322 {
323  // Preconditions:
324 
325  require(precondition_of(e3_lite::static_stp_prototype(xp)));
326 
327  // Body:
328 
329  const stp_lite& result = e3_lite::static_stp_prototype(xp);
330 
331  // Postconditions:
332 
333  ensure(postcondition_of(e3_lite::static_stp_prototype(xp)));
334 
335  // Exit:
336 
337  return result;
338 }
339 
340 // PROTECTED MEMBER FUNCTIONS
341 
342 // PRIVATE MEMBER FUNCTIONS
343 
344 
345 //==============================================================================
346 // CARTESIAN ALGEBRA (TUPLE) FACET OF CLASS ST3_E3_LITE
347 //==============================================================================
348 
349 // PUBLIC MEMBER FUNCTIONS
350 
351 // PROTECTED MEMBER FUNCTIONS
352 
353 // PRIVATE MEMBER FUNCTIONS
354 
355 
356 //==============================================================================
357 // ABSTRACT POSET MEMBER FACET OF CLASS ST3_E3_LITE
358 //==============================================================================
359 
360 // PUBLIC MEMBER FUNCTIONS
361 
362 const std::string&
364 class_name() const
365 {
366  // Preconditions:
367 
368  // Body:
369 
370  const string& result = static_class_name();
371 
372  // Postconditions:
373 
374  ensure(!result.empty());
375 
376  // Exit:
377 
378  return result;
379 }
380 
381 const std::string&
384 {
385  // Preconditions:
386 
387  // Body:
388 
389  static const string result("st3_e3_lite");
390 
391  // Postconditions:
392 
393  ensure(!result.empty());
394 
395  // Exit:
396 
397  return result;
398 }
399 
402 clone() const
403 {
404  st3_e3_lite* result = 0;
405 
406  // Preconditions:
407 
408  // Body:
409 
410  result = new st3_e3_lite();
411 
412  // Postconditions:
413 
414  ensure(result != 0);
415  ensure(is_same_type(*result));
416 
417  // Exit:
418 
419  return result;
420 }
421 
422 // PROTECTED MEMBER FUNCTIONS
423 
424 // PRIVATE MEMBER FUNCTIONS
425 
426 
427 //==============================================================================
428 // ANY FACET OF CLASS ST3_E3_LITE
429 //==============================================================================
430 
431 // PUBLIC MEMBER FUNCTIONS
432 
433 bool
435 is_ancestor_of(const any_lite& xother) const
436 {
437  // Preconditions:
438 
439  require(&xother != 0);
440 
441  // Body:
442 
443  // True if other conforms to this.
444 
445  bool result = dynamic_cast<const st3_e3_lite*>(&xother) != 0;
446 
447  // Postconditions:
448 
449  return result;
450 }
451 
452 bool
454 invariant() const
455 {
456  bool result = true;
457 
458  if(invariant_check())
459  {
460  // Prevent recursive calls to invariant.
461 
462  disable_invariant_check();
463 
464  // Must satisfy base class invariant.
465 
466  invariance(st3_lite::invariant());
467 
468  // Invariances for this class:
469 
470  // Finished, turn invariant checking back on.
471 
472  enable_invariant_check();
473  }
474 
475  // Exit
476 
477  return result;
478 }
479 
480 void*
483 {
484  return &_row_dofs;
485 }
486 
487 const void*
489 row_dofs() const
490 {
491  return &_row_dofs;
492 }
493 
494 // PROTECTED MEMBER FUNCTIONS
495 
496 // PRIVATE MEMBER FUNCTIONS
497 
498 
499 //==============================================================================
500 // CLASS ST3_E3
501 //==============================================================================
502 
503 // ===========================================================
504 // HOST FACTORY FACET OF CLASS ST3_E3
505 // ===========================================================
506 
507 // PUBLIC MEMBER FUNCTIONS
508 
509 const sheaf::poset_path&
512 {
513  // Preconditions:
514 
515 
516  // Body:
517 
518  static const poset_path result(standard_schema_poset_name(), "st3_e3_schema");
519 
520  // Postconditions:
521 
522  // Exit:
523 
524  return result;
525 }
526 
527 void
530 {
531  // Preconditions:
532 
533  require(xns.state_is_read_write_accessible());
534  require(xns.contains_poset(standard_schema_poset_name()));
535  require(!xns.contains_poset_member(standard_schema_path()));
536 
537 
538  // Body:
539 
540  string lmember_names = "xxx DOUBLE false ";
541  lmember_names += "xxy DOUBLE false ";
542  lmember_names += "xxz DOUBLE false ";
543  lmember_names += "xyy DOUBLE false ";
544  lmember_names += "xyz DOUBLE false ";
545  lmember_names += "xzz DOUBLE false ";
546  lmember_names += "yyy DOUBLE false ";
547  lmember_names += "yyz DOUBLE false ";
548  lmember_names += "yzz DOUBLE false ";
549  lmember_names += "zzz DOUBLE false ";
550 
551  schema_poset_member lschema(xns,
552  standard_schema_path().member_name(),
553  st3::standard_schema_path(),
554  lmember_names,
555  false);
556 
557  lschema.detach_from_state();
558 
559  // Postconditions:
560 
561  ensure(xns.contains_poset_member(standard_schema_path()));
562 
563  // Exit:
564 
565  return;
566 }
567 
571  const poset_path& xhost_path,
572  const poset_path& xschema_path,
573  const poset_path& xvector_space_path,
574  bool xauto_access)
575 {
576  // cout << endl << "Entering st3_e3::new_host." << endl;
577 
578  // Preconditions:
579 
580  require(xns.state_is_auto_read_write_accessible(xauto_access));
581 
582  require(!xhost_path.empty());
583  require(!xns.contains_path(xhost_path, xauto_access));
584 
585  require(xschema_path.full());
586  require(xns.path_is_auto_read_accessible(xschema_path, xauto_access));
587  require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
588  require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 10);
589 
590  require(xns.path_is_auto_read_accessible(xvector_space_path, xauto_access));
591  require(xns.contains_poset<vector_space_type::host_type>(xvector_space_path, xauto_access));
592  require(xns.member_poset(xvector_space_path, xauto_access).schema(xauto_access).conforms_to(vector_space_type::standard_schema_path()));
593  require(xns.member_poset<vector_space_type::host_type>(xvector_space_path, xauto_access).d(xauto_access) == 3);
594 
595  // Body:
596 
597  host_type& result =
598  host_type::new_table(xns, xhost_path, xschema_path, 3, xvector_space_path, xauto_access);
599 
600  // Postconditions:
601 
602  ensure(xns.owns(result, xauto_access));
603  ensure(result.path(true) == xhost_path);
604  ensure(result.state_is_not_read_accessible());
605  ensure(result.schema(true).path(xauto_access) == xschema_path);
606 
607  ensure(result.factor_ct(true) == 10);
608  ensure(result.d(true) == 10);
609  ensure(result.scalar_space_path(true) == xns.member_poset<vector_space_type::host_type>(xvector_space_path, xauto_access).scalar_space_path());
610  ensure(result.p(true) == 3);
611  ensure(result.dd(true) == 3);
612  ensure(result.vector_space_path(true) == xvector_space_path);
613 
614  // Exit:
615 
616  // cout << "Leaving st3_e3::new_host." << endl;
617  return result;
618 }
619 
622 standard_host(namespace_type& xns, const std::string& xsuffix, bool xauto_access)
623 {
624  // cout << endl << "Entering st3_e3::new_host." << endl;
625 
626  // Preconditions:
627 
628  require(xns.state_is_auto_read_write_accessible(xauto_access));
629 
630  require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
631  require(standard_host_is_available<st3_e3>(xns, xsuffix, xauto_access));
632 
633  require(xns.path_is_auto_read_accessible(standard_schema_path(), xauto_access));
634 
635  require(xns.path_is_auto_read_available(standard_host_path<vector_space_type>(xsuffix), xauto_access));
636 
637  // Body:
638 
639  // Create the vector space if necessary.
640 
641  poset_path lvector_space_path = vector_space_type::standard_host(xns, xsuffix, xauto_access).path(true);
642 
643  poset_path lpath(standard_host_path<st3_e3>(xsuffix));
644 
645  host_type* result_ptr;
646  if(xns.contains_path(lpath, xauto_access))
647  {
648  result_ptr = &xns.member_poset<host_type>(lpath, xauto_access);
649  }
650  else
651  {
652  result_ptr = &new_host(xns, lpath, standard_schema_path(), lvector_space_path, xauto_access);
653  }
654 
655  host_type& result = *result_ptr;
656 
657  // Postconditions:
658 
659  ensure(xns.owns(result, xauto_access));
660  ensure(result.path(true) == standard_host_path<st3_e3>(xsuffix));
661  ensure(result.state_is_not_read_accessible());
662  ensure(result.schema(true).path(xauto_access) == standard_schema_path());
663 
664  ensure(result.factor_ct(true) == 10);
665  ensure(result.d(true) == 10);
666  ensure(result.scalar_space_path(true) == standard_host_path<vector_space_type::scalar_type>(xsuffix) );
667  ensure(result.p(true) == 3);
668  ensure(result.dd(true) == 3);
669  ensure(result.vector_space_path(true) == standard_host_path<vector_space_type>(xsuffix) );
670 
671  // Exit:
672 
673  // cout << "Leaving st3_e3::new_host." << endl;
674  return result;
675 }
676 
677 // PROTECTED MEMBER FUNCTIONS
678 
679 // PRIVATE MEMBER FUNCTIONS
680 
681 
682 //==============================================================================
683 // ST3_E3 FACET OF CLASS ST3_E3
684 //==============================================================================
685 
688 {
689 
690  // Preconditions:
691 
692  // Body:
693 
694  // Postconditions:
695 
696  ensure(invariant());
697 }
698 
701 {
702  // Preconditions:
703 
704  require(xhost != 0);
705  require(xhost->state_is_read_accessible());
706  require(xhost->contains_member(xhub_id));
707 
708  // Body:
709 
710  attach_to_state(xhost, xhub_id);
711 
712  // Postconditions:
713 
714  ensure(invariant());
715  // ensure(host() == xhost);
716  ensure(index() == xhub_id);
717  ensure(is_attached());
718 }
719 
721 st3_e3(const poset_state_handle* xhost, const scoped_index& xid)
722 {
723  // Preconditions:
724 
725  require(xhost != 0);
726  require(xhost->state_is_read_accessible());
727  require(xhost->contains_member(xid));
728 
729  // Body:
730 
731  attach_to_state(xhost, xid.hub_pod());
732 
733  // Postconditions:
734 
735  ensure(invariant());
736  // ensure(host() == xhost);
737  ensure(index() ==~ xid);
738  ensure(is_attached());
739 }
740 
742 st3_e3(const poset_state_handle* xhost, const std::string& xname)
743 {
744 
745  // Preconditions:
746 
747  require(xhost != 0);
748  require(xhost->state_is_read_accessible());
749  require(!xname.empty());
750  require(xhost->contains_member(xname));
751 
752  // Body:
753 
754  attach_to_state(xhost, xname);
755 
756  // Postconditions:
757 
758  ensure(invariant());
759  // ensure(host() == xhost);
760  ensure(name() == xname);
761  ensure(is_attached());
762 
763 }
764 
767 {
768 
769  // Preconditions:
770 
771  require(xother != 0);
772 
773  // Body:
774 
775  attach_to_state(xother);
776 
777  // Postconditions:
778 
779  ensure(invariant());
780  ensure(is_attached());
781  ensure(is_same_state(xother));
782 
783 }
784 
786 st3_e3(poset_state_handle* xhost, bool xauto_access)
787 {
788 
789  // Preconditions:
790 
791  require(precondition_of(new_jim_state(xhost, 0, false, xauto_access)));
792 
793  // Body:
794 
795  new_jim_state(xhost, 0, false, xauto_access);
796 
797  // Postconditions:
798 
799  ensure(postcondition_of(new_jim_state(xhost, 0, false, xauto_access)));
800 
801  // Exit:
802 
803  return;
804 }
805 
808  const row_dofs_type& xrdt,
809  bool xauto_access)
810 {
811 
812  // Preconditions:
813 
814  require(precondition_of(new_jim_state(&xhost, 0, false, xauto_access)));
815 
816  // Body:
817 
818  new_jim_state(&xhost, 0, false, xauto_access);
819 
820  if(xauto_access)
821  {
822  xhost.get_read_write_access();
823  }
824 
825  *this = xrdt;
826 
827  if(xauto_access)
828  {
829  xhost.release_access();
830  }
831 
832  // Postconditions:
833 
834  ensure(postcondition_of(new_jim_state(&xhost, 0, false, xauto_access)));
835 
836  // Exit:
837 
838  return;
839 }
840 
841 
845 {
846  // Preconditions:
847 
848  require(state_is_read_write_accessible());
849 
850  // Body:
851 
852  sheaf::row_dofs(*this) = xrdt;
853 
854  // Postconditions:
855 
856  ensure_for_all(i, 0, d(), component(i) == xrdt.components[i]);
857 
858  // Exit:
859 
860  return *this;
861 
862 }
863 
868 {
869  // Preconditions:
870 
871  require(is_ancestor_of(&xother));
872  require(precondition_of(attach_to_state(&xother)));
873 
874  // Body:
875 
876  attach_to_state(&xother);
877 
878  // Postconditions:
879 
880  ensure(postcondition_of(attach_to_state(&xother)));
881 
882  // Exit:
883 
884  return *this;
885 }
886 
890 operator=(const st3_e3& xother)
891 {
892  // Preconditions:
893 
894  require(precondition_of(attach_to_state(&xother)));
895 
896  // Body:
897 
898  attach_to_state(&xother);
899 
900  // Postconditions:
901 
902  ensure(postcondition_of(attach_to_state(&xother)));
903 
904  // Exit:
905 
906  return *this;
907 }
908 
911 {
912 
913  // Preconditions:
914 
915  // Body:
916 
917  // Postconditions:
918 
919 }
920 
921 
925 {
926  // Preconditions:
927 
928  // Body:
929 
930  static const volatile_type result;
931 
932  // Postconditions:
933 
934  // Exit:
935 
936  return result;
937 }
938 
942 lite_type() const
943 {
944  // Preconditions:
945 
946  // Body:
947 
948  volatile_type* result = new volatile_type(sheaf::row_dofs(*this));
949 
950  // Postconditions:
951 
952  // Exit:
953 
954  return result;
955 }
956 
957 void
960 {
961  // Preconditions:
962 
963  require(state_is_read_write_accessible());
964 
965  // Body:
966 
967  put_component(0, xcomp);
968 
969  // Postconditions:
970 
971  ensure(invariant());
972  ensure(isunordered_or_equals(component(0), xcomp));
973 
974  // Exit:
975 
976  return;
977 }
978 
979 fiber_bundle::st3_e3::
981 {
982  // Preconditions:
983 
984  // Body:
985 
986  row_dofs_type& result = sheaf::row_dofs(*this);
987 
988  // Postconditions:
989 
990  // Exit:
991 
992  return result;
993 }
994 
995 fiber_bundle::st3_e3::
996 operator const st3_e3::row_dofs_type& () const
997 {
998  // Preconditions:
999 
1000  // Body:
1001 
1002  const row_dofs_type& result = sheaf::row_dofs(*this);
1003 
1004  // Postconditions:
1005 
1006  // Exit:
1007 
1008  return result;
1009 }
1010 
1011 // PROTECTED MEMBER FUNCTIONS
1012 
1013 // PRIVATE MEMBER FUNCTIONS
1014 
1015 
1016 //==============================================================================
1017 // ST3 FACET OF CLASS ST3_E3
1018 //==============================================================================
1019 
1020 // PUBLIC MEMBER FUNCTIONS
1021 
1022 // PROTECTED MEMBER FUNCTIONS
1023 
1024 // PRIVATE MEMBER FUNCTIONS
1025 
1026 
1027 //==============================================================================
1028 // STP FACET OF CLASS ST3_E3
1029 //==============================================================================
1030 
1031 // PUBLIC MEMBER FUNCTIONS
1032 
1033 // PROTECTED MEMBER FUNCTIONS
1034 
1035 // PRIVATE MEMBER FUNCTIONS
1036 
1037 
1038 //==============================================================================
1039 // TP FACET OF CLASS ST3_E3
1040 //==============================================================================
1041 
1042 // PUBLIC MEMBER FUNCTIONS
1043 
1044 // PROTECTED MEMBER FUNCTIONS
1045 
1046 // PRIVATE MEMBER FUNCTIONS
1047 
1048 
1049 //==============================================================================
1050 // VD FACET OF CLASS ST3_E3
1051 //==============================================================================
1052 
1053 // PUBLIC MEMBER FUNCTIONS
1054 
1055 // PROTECTED MEMBER FUNCTIONS
1056 
1057 // PRIVATE MEMBER FUNCTIONS
1058 
1059 
1060 //==============================================================================
1061 // TUPLE FACET OF CLASS ST3_E3
1062 //==============================================================================
1063 
1064 // PUBLIC MEMBER FUNCTIONS
1065 
1068 new_tp(int xp, bool xauto_access) const
1069 {
1070  // Preconditions:
1071 
1072  require(precondition_of(e3::new_tp(vector_space(xauto_access), xp)));
1073 
1074  // Body:
1075 
1076  tp* result = e3::new_tp(vector_space(xauto_access), xp);
1077 
1078  // Postconditions:
1079 
1080  ensure(postcondition_of(e3::new_tp(vector_space(xauto_access), xp)));
1081 
1082  // Exit:
1083 
1084  return result;
1085 }
1086 
1089 new_atp(int xp, bool xauto_access) const
1090 {
1091  // Preconditions:
1092 
1093  require(precondition_of(e3::new_atp(vector_space(xauto_access), xp)));
1094 
1095  // Body:
1096 
1097  atp* result = e3::new_atp(vector_space(xauto_access), xp);
1098 
1099  // Postconditions:
1100 
1101  ensure(postcondition_of(e3::new_atp(vector_space(xauto_access), xp)));
1102 
1103  // Exit:
1104 
1105  return result;
1106 }
1107 
1110 new_stp(int xp, bool xauto_access) const
1111 {
1112  // Preconditions:
1113 
1114  require(precondition_of(e3::new_stp(vector_space(xauto_access), xp)));
1115 
1116  // Body:
1117 
1118  stp* result = e3::new_stp(vector_space(xauto_access), xp);
1119 
1120  // Postconditions:
1121 
1122  ensure(postcondition_of(e3::new_stp(vector_space(xauto_access), xp)));
1123 
1124  // Exit:
1125 
1126  return result;
1127 }
1128 
1129 
1130 // PROTECTED MEMBER FUNCTIONS
1131 
1132 // PRIVATE MEMBER FUNCTIONS
1133 
1134 
1135 //==============================================================================
1136 // ABSTRACT POSET MEMBER FACET OF CLASS ST3_E3
1137 //==============================================================================
1138 
1139 // PUBLIC MEMBER FUNCTIONS
1140 
1141 const std::string&
1143 class_name() const
1144 {
1145  // Preconditions:
1146 
1147  // Body:
1148 
1149  const string& result = static_class_name();
1150 
1151  // Postconditions:
1152 
1153  ensure(!result.empty());
1154 
1155  // Exit:
1156 
1157  return result;
1158 }
1159 
1160 const std::string&
1163 {
1164  // Preconditions:
1165 
1166  // Body:
1167 
1168  static const string result("st3_e3");
1169 
1170  // Postconditions:
1171 
1172  ensure(!result.empty());
1173 
1174  // Exit:
1175 
1176  return result;
1177 }
1178 
1181 clone() const
1182 {
1183 
1184  // Preconditions:
1185 
1186  // Body:
1187 
1188  // Create new handle of the current class.
1189 
1190  st3_e3* result = new st3_e3();
1191 
1192  // Postconditions:
1193 
1194  ensure(result != 0);
1195  ensure(result->invariant());
1196 
1197  // Exit:
1198 
1199  return result;
1200 
1201 }
1202 
1203 // PROTECTED MEMBER FUNCTIONS
1204 
1205 // PRIVATE MEMBER FUNCTIONS
1206 
1207 
1208 //==============================================================================
1209 // ANY FACET OF CLASS ST3_E3
1210 //==============================================================================
1211 
1212 // PUBLIC MEMBER FUNCTIONS
1213 
1214 bool
1216 is_ancestor_of(const any* xother) const
1217 {
1218 
1219  // Preconditions:
1220 
1221  require(xother != 0);
1222 
1223  // Body:
1224 
1225  bool result = dynamic_cast<const st3_e3*>(xother) != 0;
1226 
1227  // Postconditions:
1228 
1229  // Exit:
1230 
1231  return result;
1232 
1233 }
1234 
1235 
1236 bool
1238 invariant() const
1239 {
1240  bool result = true;
1241 
1242  // Body:
1243 
1244  if(invariant_check())
1245  {
1246  // Prevent recursive calls to invariant.
1247 
1248  disable_invariant_check();
1249 
1250  // Must satisfy base class invariant.
1251 
1252  invariance(st3::invariant());
1253 
1254  // Invariances for this class:
1255 
1256  invariance((state_is_read_accessible() ? dd() == 3 : true));
1257  invariance((state_is_read_accessible() ? d() == 10 : true));
1258 
1259  // Finished, turn invariant checking back on.
1260 
1261  enable_invariant_check();
1262  }
1263 
1264  // Exit:
1265 
1266  return result;
1267 }
1268 
1269 // PROTECTED MEMBER FUNCTIONS
1270 
1271 // PRIVATE MEMBER FUNCTIONS
1272 
1273 
1274 //==============================================================================
1275 // NON-MEMBER FUNCTIONS
1276 //==============================================================================
1277 
1278 
T components[10]
The components.
Definition: st3_e3.h:100
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 ...
st3_e3_lite()
Default constructor.
Definition: st3_e3.cc:47
virtual stp * new_stp(int xp, bool xauto_access) const
Virtual constructor for symmetric tensors of degree xp over vector space xvector_space.
Definition: st3_e3.cc:1110
virtual const std::string & class_name() const
The name of this class.
Definition: st3_e3.cc:1143
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 tensor of degree p.
Definition: atp.h:190
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
virtual void put_components(dof_type xcomp)
Sets the value of the component to xcomp.
Definition: st3_e3.cc:959
virtual const atp_lite & atp_prototype(int xp) const
Prototype for antisymmetric tensors of degree xp over this vector space.
Definition: st3_e3.cc:300
poset_path path(bool xauto_access=true) const
A path to this component.
bool conforms_to(const schema_poset_member &xother) const
True if the dofs defined by this agree in type and in order with the dofs defined by xother...
The default name space; a poset which contains other posets as members.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
bool is_ancestor_of(const any *xother) const
True if xother conforms to current.
Definition: st3_e3.cc:1216
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...
st3_e3_lite & operator=(const st3_e3_lite &xother)
Assignment operator.
Definition: st3_e3.cc:79
poset_path vector_space_path() const
The path of the underlying vector space.
Definition: tp_space.cc:365
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...
A client handle for a general, abstract partially order set.
A symmetric rank 3 tensor over a 3D Euclidean vector space (persistent version).
Definition: st3_e3.h:370
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
STL namespace.
bool invariant() const
Class invariant.
Definition: st3_e3.cc:1238
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.
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
virtual void * row_dofs()
The row dofs for this instance (mutable version).
Definition: st3_e3.cc:482
An antisymmetric tensor of degree p over an abstract vector space (volatile version).
Definition: atp.h:44
static int d(const namespace_poset &xns, int xp, const poset_path &xvector_space_path, bool xauto_access)
The tensor dimension implied by tensor degree xp and the dimension of the domain vector space specifi...
Definition: stp_space.cc:86
A general tensor of "degree" p and given "variance" over an abstract vector space.
Definition: tp.h:253
static const std::string & static_class_name()
The name of this class.
Definition: st3_e3.cc:383
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
virtual tp * new_tp(int xp, bool xauto_access) const
Virtual constructor for general tensors of degree xp over vector space xvector_space.
Definition: st3_e3.cc:1068
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
virtual const std::string & class_name() const
The name of this class.
Definition: st3_e3.cc:364
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...
virtual st3_e3 * clone() const
Make a new handle, no state instance of current.
Definition: st3_e3.cc:1181
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 const stp_lite & stp_prototype(int xp) const
Prototype for symmetric tensors of degree xp over this vector space.
Definition: st3_e3.cc:321
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
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: st3_e3.cc:529
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
virtual 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 volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
Definition: st3_e3.cc:924
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
Definition: st3_e3.cc:435
row_dofs_type _row_dofs
Row_dofs_type.
Definition: st3_e3.h:194
A symmetric rank 3 tensor over an abstract vector space. (volatile version).
Definition: st3.h:43
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: st3_e3.cc:570
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
~st3_e3()
Destructor.
Definition: st3_e3.cc:910
bool invariant() const
Class invariant.
Definition: st3_e3.cc:454
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 volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
Definition: st3_e3.cc:942
st3_e3()
Default constructor.
Definition: st3_e3.cc:687
virtual st3_e3_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
Definition: st3_e3.cc:402
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
Definition: at1_space.h:42
st3_e3 & operator=(const row_dofs_type &xrdt)
Assignment to an instance of the associated row dofs type.
Definition: st3_e3.cc:844
static int factor_ct(int xd)
Factor_ct() as a function of dimension xd.
Definition: vd_space.cc:167
virtual const tp_lite & tp_prototype(int xp) const
Prototype for general tensors of degree xp over this vector space.
Definition: st3_e3.cc:279
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
int dd() const
The dimension of the underlying ("domain") vector space.
Definition: tp_space.cc:317
A symmetric rank 3 tensor over a Euclidean vector space of dimension 3. (volatile version)...
Definition: st3_e3.h:118
virtual ~st3_e3_lite()
Destructor.
Definition: st3_e3.cc:101
static const std::string & static_class_name()
The name of this class.
Definition: st3_e3.cc:1162
An abstract client handle for a member of a poset.
std::string path() const
The full path as a string.
Definition: poset_path.cc:450
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 host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path<st3_e3>(xsuffix). Returns the host if it already exists...
Definition: st3_e3.cc:622
A symmetric tensor of degree p over an abstract vector space (volatile version).
Definition: stp.h:44
An abstract symmetric tensor space of degree p.
Definition: stp_space.h:42
Namespace for the fiber_bundles component of the sheaf system.
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.
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
Definition: st3_e3.cc:511
virtual int dd() const
Dimension of the underlying vector space.
Definition: st3_e3.cc:248
virtual atp * new_atp(int xp, bool xauto_access) const
Virtual constructor for antisymmetric tensors of degree xp over vector space xvector_space.
Definition: st3_e3.cc:1089
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