SheafSystem  0.0.0.0
st4_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 st4_e3.
19 
20 #include "SheafSystem/st4_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 ST4_E3_LITE
38 //==============================================================================
39 
40 //==============================================================================
41 // ST4_E3 FACET
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 st4_e3_lite(const st4_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 st4_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 st4_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::st4_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::st4_e3_lite::
165 operator const st4_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::st4_e3_lite::
182 // st4_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::st4_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 // ST4 FACET
220 //==============================================================================
221 
222 // PUBLIC MEMBER FUNCTIONS
223 
224 // PROTECTED MEMBER FUNCTIONS
225 
226 // PRIVATE MEMBER FUNCTIONS
227 
228 
229 //==============================================================================
230 // STP FACET
231 //==============================================================================
232 
233 // PUBLIC MEMBER FUNCTIONS
234 
235 // PROTECTED MEMBER FUNCTIONS
236 
237 // PRIVATE MEMBER FUNCTIONS
238 
239 
240 //==============================================================================
241 // TP FACET
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 // VD FACET
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 // TUPLE FACET
347 //==============================================================================
348 
349 // PUBLIC MEMBER FUNCTIONS
350 
351 // PROTECTED MEMBER FUNCTIONS
352 
353 // PRIVATE MEMBER FUNCTIONS
354 
355 
356 //==============================================================================
357 // ABSTRACT POSET MEMBER FACET
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("st4_e3_lite");
390 
391  // Postconditions:
392 
393  ensure(!result.empty());
394 
395  // Exit:
396 
397  return result;
398 }
399 
402 clone() const
403 {
404  st4_e3_lite* result = 0;
405 
406  // Preconditions:
407 
408  // Body:
409 
410  result = new st4_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
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 st4_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(st4_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 ST4_E3
501 //==============================================================================
502 
503 // ===========================================================
504 // HOST FACTORY FACET OF CLASS ST4_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(), "st4_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 = "xxxx DOUBLE false ";
541  lmember_names += "xxxy DOUBLE false ";
542  lmember_names += "xxxz DOUBLE false ";
543  lmember_names += "xxyy DOUBLE false ";
544  lmember_names += "xxyz DOUBLE false ";
545  lmember_names += "xxzz DOUBLE false ";
546  lmember_names += "xyyy DOUBLE false ";
547  lmember_names += "xyyz DOUBLE false ";
548  lmember_names += "xyzz DOUBLE false ";
549  lmember_names += "xzzz DOUBLE false ";
550  lmember_names += "yyyy DOUBLE false ";
551  lmember_names += "yyyz DOUBLE false ";
552  lmember_names += "yyzz DOUBLE false ";
553  lmember_names += "yzzz DOUBLE false ";
554  lmember_names += "zzzz DOUBLE false ";
555 
556  schema_poset_member lschema(xns,
557  standard_schema_path().member_name(),
558  st4::standard_schema_path(),
559  lmember_names,
560  false);
561 
562  lschema.detach_from_state();
563 
564  // Postconditions:
565 
566  ensure(xns.contains_poset_member(standard_schema_path()));
567 
568  // Exit:
569 
570  return;
571 }
572 
576  const poset_path& xhost_path,
577  const poset_path& xschema_path,
578  const poset_path& xvector_space_path,
579  bool xauto_access)
580 {
581  // cout << endl << "Entering st4_e3::new_host." << endl;
582 
583  // Preconditions:
584 
585  require(xns.state_is_auto_read_write_accessible(xauto_access));
586 
587  require(!xhost_path.empty());
588  require(!xns.contains_path(xhost_path, xauto_access));
589 
590  require(xschema_path.full());
591  require(xns.path_is_auto_read_accessible(xschema_path, xauto_access));
592  require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
593  require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 15);
594 
595  require(xns.path_is_auto_read_accessible(xvector_space_path, xauto_access));
596  require(xns.contains_poset<vector_space_type::host_type>(xvector_space_path, xauto_access));
597  require(xns.member_poset(xvector_space_path, xauto_access).schema(xauto_access).conforms_to(vector_space_type::standard_schema_path()));
598  require(xns.member_poset<vector_space_type::host_type>(xvector_space_path, xauto_access).d(xauto_access) == 3);
599 
600  // Body:
601 
602  host_type& result =
603  host_type::new_table(xns, xhost_path, xschema_path, 4, xvector_space_path, xauto_access);
604 
605  // Postconditions:
606 
607  ensure(xns.owns(result, xauto_access));
608  ensure(result.path(true) == xhost_path);
609  ensure(result.state_is_not_read_accessible());
610  ensure(result.schema(true).path(xauto_access) == xschema_path);
611 
612  ensure(result.factor_ct(true) == 15);
613  ensure(result.d(true) == 15);
614  ensure(result.scalar_space_path(true) == xns.member_poset<vector_space_type::host_type>(xvector_space_path, xauto_access).scalar_space_path());
615  ensure(result.p(true) == 4);
616  ensure(result.dd(true) == 3);
617  ensure(result.vector_space_path(true) == xvector_space_path);
618 
619  // Exit:
620 
621  // cout << "Leaving st4_e3::new_host." << endl;
622  return result;
623 }
624 
627 standard_host(namespace_type& xns, const std::string& xsuffix, bool xauto_access)
628 {
629  // cout << endl << "Entering st4_e3::new_host." << endl;
630 
631  // Preconditions:
632 
633  require(xns.state_is_auto_read_write_accessible(xauto_access));
634 
635  require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
636  require(standard_host_is_available<st4_e3>(xns, xsuffix, xauto_access));
637 
638  require(xns.path_is_auto_read_accessible(standard_schema_path(), xauto_access));
639 
640  require(xns.path_is_auto_read_available(standard_host_path<vector_space_type>(xsuffix), xauto_access));
641 
642  // Body:
643 
644  // Create the vector space if necessary.
645 
646  poset_path lvector_space_path = vector_space_type::standard_host(xns, xsuffix, xauto_access).path(true);
647 
648  poset_path lpath(standard_host_path<st4_e3>(xsuffix));
649 
650  host_type* result_ptr;
651  if(xns.contains_path(lpath, xauto_access))
652  {
653  result_ptr = &xns.member_poset<host_type>(lpath, xauto_access);
654  }
655  else
656  {
657  result_ptr = &new_host(xns, lpath, standard_schema_path(), lvector_space_path, xauto_access);
658  }
659 
660  host_type& result = *result_ptr;
661 
662  // Postconditions:
663 
664  ensure(xns.owns(result, xauto_access));
665  ensure(result.path(true) == standard_host_path<st4_e3>(xsuffix));
666  ensure(result.state_is_not_read_accessible());
667  ensure(result.schema(true).path(xauto_access) == standard_schema_path());
668 
669  ensure(result.factor_ct(true) == 15);
670  ensure(result.d(true) == 15);
671  ensure(result.scalar_space_path(true) == standard_host_path<vector_space_type::scalar_type>(xsuffix) );
672  ensure(result.p(true) == 4);
673  ensure(result.dd(true) == 3);
674  ensure(result.vector_space_path(true) == standard_host_path<vector_space_type>(xsuffix) );
675 
676  // Exit:
677 
678  // cout << "Leaving st4_e3::new_host." << endl;
679  return result;
680 }
681 
682 // PROTECTED MEMBER FUNCTIONS
683 
684 // PRIVATE MEMBER FUNCTIONS
685 
686 
687 //==============================================================================
688 // ST4_E3 FACET
689 //==============================================================================
690 
691 // PUBLIC MEMBER FUNCTIONS
692 
695 {
696 
697  // Preconditions:
698 
699  // Body:
700 
701  // Postconditions:
702 
703  ensure(invariant());
704 }
705 
708 {
709  // Preconditions:
710 
711  require(xhost != 0);
712  require(xhost->state_is_read_accessible());
713  require(xhost->contains_member(xhub_id));
714 
715  // Body:
716 
717  attach_to_state(xhost, xhub_id);
718 
719  // Postconditions:
720 
721  ensure(invariant());
722  // ensure(host() == xhost);
723  ensure(index() == xhub_id);
724  ensure(is_attached());
725 }
726 
728 st4_e3(const poset_state_handle* xhost, const scoped_index& xid)
729 {
730  // Preconditions:
731 
732  require(xhost != 0);
733  require(xhost->state_is_read_accessible());
734  require(xhost->contains_member(xid));
735 
736  // Body:
737 
738  attach_to_state(xhost, xid.hub_pod());
739 
740  // Postconditions:
741 
742  ensure(invariant());
743  // ensure(host() == xhost);
744  ensure(index() ==~ xid);
745  ensure(is_attached());
746 }
747 
749 st4_e3(const poset_state_handle* xhost, const std::string& xname)
750 {
751 
752  // Preconditions:
753 
754  require(xhost != 0);
755  require(xhost->state_is_read_accessible());
756  require(!xname.empty());
757  require(xhost->contains_member(xname));
758 
759  // Body:
760 
761  attach_to_state(xhost, xname);
762 
763  // Postconditions:
764 
765  ensure(invariant());
766  // ensure(host() == xhost);
767  ensure(name() == xname);
768  ensure(is_attached());
769 
770 }
771 
774 {
775 
776  // Preconditions:
777 
778  require(xother != 0);
779 
780  // Body:
781 
782  attach_to_state(xother);
783 
784  // Postconditions:
785 
786  ensure(invariant());
787  ensure(is_attached());
788  ensure(is_same_state(xother));
789 
790 }
791 
793 st4_e3(poset_state_handle* xhost, bool xauto_access)
794 {
795 
796  // Preconditions:
797 
798  require(precondition_of(new_jim_state(xhost, 0, false, xauto_access)));
799 
800  // Body:
801 
802  new_jim_state(xhost, 0, false, xauto_access);
803 
804  // Postconditions:
805 
806  ensure(postcondition_of(new_jim_state(xhost, 0, false, xauto_access)));
807 
808  // Exit:
809 
810  return;
811 }
812 
815  const row_dofs_type& xrdt,
816  bool xauto_access)
817 {
818 
819  // Preconditions:
820 
821  require(precondition_of(new_jim_state(&xhost, 0, false, xauto_access)));
822 
823  // Body:
824 
825  new_jim_state(&xhost, 0, false, xauto_access);
826 
827  if(xauto_access)
828  {
829  xhost.get_read_write_access();
830  }
831 
832  *this = xrdt;
833 
834  if(xauto_access)
835  {
836  xhost.release_access();
837  }
838 
839  // Postconditions:
840 
841  ensure(postcondition_of(new_jim_state(&xhost, 0, false, xauto_access)));
842 
843  // Exit:
844 
845  return;
846 }
847 
848 
852 {
853  // Preconditions:
854 
855  require(state_is_read_write_accessible());
856 
857  // Body:
858 
859  sheaf::row_dofs(*this) = xrdt;
860 
861  // Postconditions:
862 
863  ensure_for_all(i, 0, d(), component(i) == xrdt.components[i]);
864 
865  // Exit:
866 
867  return *this;
868 
869 }
870 
875 {
876  // Preconditions:
877 
878  require(is_ancestor_of(&xother));
879  require(precondition_of(attach_to_state(&xother)));
880 
881  // Body:
882 
883  attach_to_state(&xother);
884 
885  // Postconditions:
886 
887  ensure(postcondition_of(attach_to_state(&xother)));
888 
889  // Exit:
890 
891  return *this;
892 }
893 
897 operator=(const st4_e3& xother)
898 {
899  // Preconditions:
900 
901  require(precondition_of(attach_to_state(&xother)));
902 
903  // Body:
904 
905  attach_to_state(&xother);
906 
907  // Postconditions:
908 
909  ensure(postcondition_of(attach_to_state(&xother)));
910 
911  // Exit:
912 
913  return *this;
914 }
915 
918 {
919 
920  // Preconditions:
921 
922  // Body:
923 
924  // Postconditions:
925 
926 }
927 
931 {
932  // Preconditions:
933 
934  // Body:
935 
936  static const volatile_type result;
937 
938  // Postconditions:
939 
940  // Exit:
941 
942  return result;
943 }
944 
948 lite_type() const
949 {
950  // Preconditions:
951 
952  // Body:
953 
954  volatile_type* result = new volatile_type(sheaf::row_dofs(*this));
955 
956  // Postconditions:
957 
958  // Exit:
959 
960  return result;
961 }
962 
963 void
966 {
967  // Preconditions:
968 
969  require(state_is_read_write_accessible());
970 
971  // Body:
972 
973  put_component(0, xcomp);
974 
975  // Postconditions:
976 
977  ensure(invariant());
978  ensure(isunordered_or_equals(component(0), xcomp));
979 
980  // Exit:
981 
982  return;
983 }
984 
985 fiber_bundle::st4_e3::
987 {
988  // Preconditions:
989 
990  // Body:
991 
992  row_dofs_type& result = sheaf::row_dofs(*this);
993 
994  // Postconditions:
995 
996  // Exit:
997 
998  return result;
999 }
1000 
1001 fiber_bundle::st4_e3::
1002 operator const st4_e3::row_dofs_type& () const
1003 {
1004  // Preconditions:
1005 
1006  // Body:
1007 
1008  const row_dofs_type& result = sheaf::row_dofs(*this);
1009 
1010  // Postconditions:
1011 
1012  // Exit:
1013 
1014  return result;
1015 }
1016 
1017 // PROTECTED MEMBER FUNCTIONS
1018 
1019 // PRIVATE MEMBER FUNCTIONS
1020 
1021 
1022 //==============================================================================
1023 // ST4 FACET
1024 //==============================================================================
1025 
1026 // PUBLIC MEMBER FUNCTIONS
1027 
1028 // PROTECTED MEMBER FUNCTIONS
1029 
1030 // PRIVATE MEMBER FUNCTIONS
1031 
1032 
1033 //==============================================================================
1034 // STP FACET
1035 //==============================================================================
1036 
1037 // PUBLIC MEMBER FUNCTIONS
1038 
1039 // PROTECTED MEMBER FUNCTIONS
1040 
1041 // PRIVATE MEMBER FUNCTIONS
1042 
1043 
1044 //==============================================================================
1045 // TP FACET
1046 //==============================================================================
1047 
1048 // PUBLIC MEMBER FUNCTIONS
1049 
1050 // PROTECTED MEMBER FUNCTIONS
1051 
1052 // PRIVATE MEMBER FUNCTIONS
1053 
1054 
1055 //==============================================================================
1056 // TUPLE FACET
1057 //==============================================================================
1058 
1059 // PUBLIC MEMBER FUNCTIONS
1060 
1063 new_tp(int xp, bool xauto_access) const
1064 {
1065  // Preconditions:
1066 
1067  require(precondition_of(e3::new_tp(vector_space(xauto_access), xp)));
1068 
1069  // Body:
1070 
1071  tp* result = e3::new_tp(vector_space(xauto_access), xp);
1072 
1073  // Postconditions:
1074 
1075  ensure(postcondition_of(e3::new_tp(vector_space(xauto_access), xp)));
1076 
1077  // Exit:
1078 
1079  return result;
1080 }
1081 
1084 new_atp(int xp, bool xauto_access) const
1085 {
1086  // Preconditions:
1087 
1088  require(precondition_of(e3::new_atp(vector_space(xauto_access), xp)));
1089 
1090  // Body:
1091 
1092  atp* result = e3::new_atp(vector_space(xauto_access), xp);
1093 
1094  // Postconditions:
1095 
1096  ensure(postcondition_of(e3::new_atp(vector_space(xauto_access), xp)));
1097 
1098  // Exit:
1099 
1100  return result;
1101 }
1102 
1105 new_stp(int xp, bool xauto_access) const
1106 {
1107  // Preconditions:
1108 
1109  require(precondition_of(e3::new_stp(vector_space(xauto_access), xp)));
1110 
1111  // Body:
1112 
1113  stp* result = e3::new_stp(vector_space(xauto_access), xp);
1114 
1115  // Postconditions:
1116 
1117  ensure(postcondition_of(e3::new_stp(vector_space(xauto_access), xp)));
1118 
1119  // Exit:
1120 
1121  return result;
1122 }
1123 
1124 
1125 // PROTECTED MEMBER FUNCTIONS
1126 
1127 // PRIVATE MEMBER FUNCTIONS
1128 
1129 
1130 //==============================================================================
1131 // ABSTRACT POSET MEMBER FACET
1132 //==============================================================================
1133 
1134 const std::string&
1136 class_name() const
1137 {
1138  // Preconditions:
1139 
1140  // Body:
1141 
1142  const string& result = static_class_name();
1143 
1144  // Postconditions:
1145 
1146  ensure(!result.empty());
1147 
1148  // Exit:
1149 
1150  return result;
1151 }
1152 
1153 const std::string&
1156 {
1157  // Preconditions:
1158 
1159  // Body:
1160 
1161  static const string result("st4_e3");
1162 
1163  // Postconditions:
1164 
1165  ensure(!result.empty());
1166 
1167  // Exit:
1168 
1169  return result;
1170 }
1171 
1174 clone() const
1175 {
1176 
1177  // Preconditions:
1178 
1179  // Body:
1180 
1181  // Create new handle of the current class.
1182 
1183  st4_e3* result = new st4_e3();
1184 
1185  // Postconditions:
1186 
1187  ensure(result != 0);
1188  ensure(result->invariant());
1189 
1190  // Exit:
1191 
1192  return result;
1193 
1194 }
1195 
1196 // PROTECTED MEMBER FUNCTIONS
1197 
1198 // PRIVATE MEMBER FUNCTIONS
1199 
1200 
1201 //==============================================================================
1202 // ANY FACET
1203 //==============================================================================
1204 
1205 // PUBLIC MEMBER FUNCTIONS
1206 
1207 bool
1209 is_ancestor_of(const any* xother) const
1210 {
1211 
1212  // Preconditions:
1213 
1214  require(xother != 0);
1215 
1216  // Body:
1217 
1218  bool result = dynamic_cast<const st4_e3*>(xother) != 0;
1219 
1220  // Postconditions:
1221 
1222  // Exit:
1223 
1224  return result;
1225 
1226 }
1227 
1228 
1229 bool
1231 invariant() const
1232 {
1233  bool result = true;
1234 
1235  // Body:
1236 
1237  if(invariant_check())
1238  {
1239  // Prevent recursive calls to invariant.
1240 
1241  disable_invariant_check();
1242 
1243  // Must satisfy base class invariant.
1244 
1245  invariance(st4::invariant());
1246 
1247  // Invariances for this class:
1248 
1249  invariance((state_is_read_accessible() ? dd() == 3 : true));
1250 
1251  // Finished, turn invariant checking back on.
1252 
1253  enable_invariant_check();
1254  }
1255 
1256  // Exit:
1257 
1258  return result;
1259 }
1260 
1261 // PROTECTED MEMBER FUNCTIONS
1262 
1263 // PRIVATE MEMBER FUNCTIONS
1264 
1265 
1266 //==============================================================================
1267 // NON-MEMBER FUNCTIONS
1268 //==============================================================================
1269 
static const std::string & static_class_name()
The name of this class.
Definition: st4_e3.cc:383
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...
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: st4_e3.cc:529
virtual tp * new_tp(int xp, bool xauto_access) const
Virtual constructor for general tensors of degree xp over vector space xvector_space.
Definition: st4_e3.cc:1063
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 ...
virtual atp * new_atp(int xp, bool xauto_access) const
Virtual constructor for antisymmetric tensors of degree xp over vector space xvector_space.
Definition: st4_e3.cc:1084
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
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
Definition: st4_e3.cc:435
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
st4_e3_lite()
Default constructor.
Definition: st4_e3.cc:47
poset_path path(bool xauto_access=true) const
A path to this component.
static const std::string & static_class_name()
The name of this class.
Definition: st4_e3.cc:1155
bool conforms_to(const schema_poset_member &xother) const
True if the dofs defined by this agree in type and in order with the dofs defined by xother...
The default name space; a poset which contains other posets as members.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
bool path_is_auto_read_accessible(const poset_path &xpath, bool xauto_access) const
True if the state referred to xpath exists and is auto read accessible.
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
poset_path vector_space_path() const
The path of the underlying vector space.
Definition: tp_space.cc:365
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.
virtual const stp_lite & stp_prototype(int xp) const
Prototype for symmetric tensors of degree xp over this vector space.
Definition: st4_e3.cc:321
virtual void put_components(dof_type xcomp)
Sets the value of the component to xcomp.
Definition: st4_e3.cc:965
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: st4_e3.h:210
STL namespace.
virtual st4_e3_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
Definition: st4_e3.cc:402
st4_e3 & operator=(const row_dofs_type &xrdt)
Assignment to an instance of the associated row dofs type.
Definition: st4_e3.cc:851
virtual const atp_lite & atp_prototype(int xp) const
Prototype for antisymmetric tensors of degree xp over this vector space.
Definition: st4_e3.cc:300
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.
bool invariant() const
Class invariant.
Definition: st4_e3.cc:1231
A symmetric rank 4 tensor over a Euclidean vector space of dimension 3. (volatile version)...
Definition: st4_e3.h:134
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
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
bool invariant() const
Class invariant.
Definition: st4_e3.cc:454
st4_e3_lite & operator=(const st4_e3_lite &xother)
Assignment operator.
Definition: st4_e3.cc:79
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 host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path<st4_e3>(xsuffix). Returns the host if it already exists...
Definition: st4_e3.cc:627
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: st4_e3.cc:1136
~st4_e3()
Destructor.
Definition: st4_e3.cc:917
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 * row_dofs()
The row dofs for this instance (mutable version).
Definition: st4_e3.cc:482
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 const poset_path & standard_schema_path()
The path to the standard schema for this class.
Definition: st4_e3.cc:511
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
T components[15]
The components in the order:
Definition: st4_e3.h:116
virtual int dd() const
Dimension of the underlying vector space.
Definition: st4_e3.cc:248
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
virtual const std::string & class_name() const
The name of this class.
Definition: st4_e3.cc:364
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 const tp_lite & tp_prototype(int xp) const
Prototype for general tensors of degree xp over this vector space.
Definition: st4_e3.cc:279
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
Definition: at1_space.h:42
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: st4_e3.cc:575
static int factor_ct(int xd)
Factor_ct() as a function of dimension xd.
Definition: vd_space.cc:167
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 3D Euclidean vector space (persistent version).
Definition: st4_e3.h:386
st4_e3()
Default constructor.
Definition: st4_e3.cc:694
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
Definition: st4_e3.cc:930
virtual volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
Definition: st4_e3.cc:948
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
bool is_ancestor_of(const any *xother) const
True if xother conforms to current.
Definition: st4_e3.cc:1209
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.
A symmetric rank 4 tensor over an abstract vector space. (volatile version).
Definition: st4.h:43
virtual stp * new_stp(int xp, bool xauto_access) const
Virtual constructor for symmetric tensors of degree xp over vector space xvector_space.
Definition: st4_e3.cc:1105
virtual st4_e3 * clone() const
Make a new handle, no state instance of current.
Definition: st4_e3.cc:1174
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
Definition: scoped_index.h:710
virtual ~st4_e3_lite()
Destructor.
Definition: st4_e3.cc:101
SHEAF_DLL_SPEC bool isunordered_or_equals(float x1, float x2)
True if isunordered(x1, x2) or x1 == x2.
Definition: sheaf.cc:102