SheafSystem  0.0.0.0
st2_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/st2_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/stp_space.h"
28 #include "SheafSystem/fiber_bundles_namespace.h"
29 #include "SheafSystem/schema_poset_member.h"
30 #include "SheafSystem/stp_space.h"
31 #include "SheafSystem/wsv_block.h"
32 
33 using namespace std;
34 using namespace fiber_bundle; // Workaround for MS C++ bug.
35 
36 
37 //==============================================================================
38 // CLASS ST2_E2_LITE
39 //==============================================================================
40 
41 //==============================================================================
42 // ST2_E2 FACET OF CLASS ST2_E2_LITE
43 //==============================================================================
44 
45 // PUBLIC MEMBER FUNCTIONS
46 
49 {
50 
51  // Preconditions:
52 
53  // Body:
54 
55  // Postconditions:
56 
57  ensure(invariant());
58 
59  // Exit:
60 }
61 
63 st2_e2_lite(const st2_e2_lite& xother)
64 {
65  // Preconditions:
66 
67  // Body:
68 
69  *this = xother;
70 
71  // Postconditions:
72 
73  ensure(invariant());
74 
75  // Exit:
76 }
77 
80 operator=(const st2_e2_lite& xother)
81 {
82 
83  // Preconditions:
84 
85  // Body:
86 
87  if(this == &xother)
88  return *this;
89 
90  _row_dofs = xother._row_dofs;
91 
92  // Postconditions:
93 
94  ensure(invariant());
95 
96  // Exit:
97 
98  return *this;
99 }
100 
103 {
104  // Preconditions:
105 
106  // Body:
107 
108 
109  // Postconditions:
110 
111  // Exit:
112 }
113 
115 st2_e2_lite(const row_dofs_type& xrow_dofs)
116 {
117  // Preconditions:
118 
119  // Body:
120 
121  *this = xrow_dofs;
122 
123  // Postconditions:
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 
149 st2_e2_lite(const matrix_type& xmatrix)
150 {
151  // Preconditions:
152 
153  // Body:
154 
155  *this = xmatrix;
156 
157  // Postconditions:
158 
159  // Exit:
160 }
161 
164 operator=(const matrix_type& xmatrix)
165 {
166  // Preconditions:
167 
168  // Body:
169 
170  //_row_dofs = xmatrix;
171  _row_dofs = reinterpret_cast<const row_dofs_type&>(xmatrix);
172 
173  // Postconditions:
174 
175  ensure(invariant());
176 
177  // Exit:
178 
179  return *this;
180 
181 }
182 
183 fiber_bundle::st2_e2_lite::
185 {
186  // Preconditions:
187 
188  // Body:
189 
190  matrix_type& result = _row_dofs;
191 
192  // Postconditions:
193 
194  // Exit:
195 
196  return result;
197 }
198 
199 fiber_bundle::st2_e2_lite::
200 operator const st2_e2_lite::matrix_type& () const
201 {
202  // Preconditions:
203 
204  // Body:
205 
206  const matrix_type& result = _row_dofs;
207 
208  // Postconditions:
209 
210  // Exit:
211 
212  return result;
213 }
214 
215 fiber_bundle::st2_e2_lite::
217 {
218  // Preconditions:
219 
220  // Body:
221 
222  row_dofs_type& result = _row_dofs;
223 
224  // Postconditions:
225 
226  // Exit:
227 
228  return result;
229 }
230 
231 fiber_bundle::st2_e2_lite::
232 operator const st2_e2_lite::row_dofs_type& () const
233 {
234  // Preconditions:
235 
236  // Body:
237 
238  const row_dofs_type& result = _row_dofs;
239 
240  // Postconditions:
241 
242  // Exit:
243 
244  return result;
245 }
246 
249  const value_type& xy,
250  const value_type& yy)
251 {
252  // Preconditions:
253 
254  // Body:
255 
256  put_components(xx, xy, yy);
257 
258  // Postconditions:
259 
260  // Exit:
261 }
262 
263 void
265 put_components(const value_type& xx_comp,
266  const value_type& xy_comp,
267  const value_type& yy_comp)
268 {
269  // Preconditions:
270 
271  // Body:
272 
273  put_component(0, xx_comp);
274  put_component(1, xy_comp);
275  put_component(2, yy_comp);
276 
277  // Postconditions:
278 
279  ensure(invariant());
280  ensure(isunordered_or_equals(component(0), xx_comp));
281  ensure(isunordered_or_equals(component(1), xy_comp));
282  ensure(isunordered_or_equals(component(2), yy_comp));
283 
284  // Exit:
285 }
286 
287 // PROTECTED MEMBER FUNCTIONS
288 
289 // PRIVATE MEMBER FUNCTIONS
290 
291 
292 //==============================================================================
293 // INTERIOR ALGEBRA (ST2) FACET OF CLASS ST2_E2_LITE
294 //==============================================================================
295 
296 // PUBLIC MEMBER FUNCTIONS
297 
298 // PROTECTED MEMBER FUNCTIONS
299 
300 // PRIVATE MEMBER FUNCTIONS
301 
302 
303 //==============================================================================
304 // INTERIOR ALGEBRA (STP) FACET OF CLASS ST2_E2_LITE
305 //==============================================================================
306 
307 // PUBLIC MEMBER FUNCTIONS
308 
309 // PROTECTED MEMBER FUNCTIONS
310 
311 // PRIVATE MEMBER FUNCTIONS
312 
313 
314 //==============================================================================
315 // TENSOR ALGEBRA (TP) FACET OF CLASS ST2_E2_LITE
316 //==============================================================================
317 
318 // PUBLIC MEMBER FUNCTIONS
319 
320 int
322 dd() const
323 {
324  // Preconditions:
325 
326  // Body:
327 
328  int result = 2;
329 
330  // Postconditions:
331 
332  ensure(invariant());
333  ensure(result == 2);
334 
335  // Exit:
336 
337  return result;
338 }
339 
340 // PROTECTED MEMBER FUNCTIONS
341 
342 // PRIVATE MEMBER FUNCTIONS
343 
344 
345 //==============================================================================
346 // VECTOR ALGEBRA (VD) FACET OF CLASS ST2_E2_LITE
347 //==============================================================================
348 
349 // PUBLIC MEMBER FUNCTIONS
350 
353 tp_prototype(int xp) const
354 {
355  // Preconditions:
356 
357  require(precondition_of(e2_lite::static_tp_prototype(xp)));
358 
359  // Body:
360 
361  const tp_lite& result = e2_lite::static_tp_prototype(xp);
362 
363  // Postconditions:
364 
365  ensure(postcondition_of(e2_lite::static_tp_prototype(xp)));
366 
367  // Exit:
368 
369  return result;
370 }
371 
374 atp_prototype(int xp) const
375 {
376  // Preconditions:
377 
378  require(precondition_of(e2_lite::static_atp_prototype(xp)));
379 
380  // Body:
381 
382  const atp_lite& result = e2_lite::static_atp_prototype(xp);
383 
384  // Postconditions:
385 
386  ensure(postcondition_of(e2_lite::static_atp_prototype(xp)));
387 
388  // Exit:
389 
390  return result;
391 }
392 
395 stp_prototype(int xp) const
396 {
397  // Preconditions:
398 
399  require(precondition_of(e2_lite::static_stp_prototype(xp)));
400 
401  // Body:
402 
403  const stp_lite& result = e2_lite::static_stp_prototype(xp);
404 
405  // Postconditions:
406 
407  ensure(postcondition_of(e2_lite::static_stp_prototype(xp)));
408 
409  // Exit:
410 
411  return result;
412 }
413 
414 
415 // PROTECTED MEMBER FUNCTIONS
416 
417 // PRIVATE MEMBER FUNCTIONS
418 
419 
420 //==============================================================================
421 // CARTESIAN ALGEBRA (TUPLE) FACET OF CLASS ST2_E2_LITE
422 //==============================================================================
423 
424 // PUBLIC MEMBER FUNCTIONS
425 
426 // PROTECTED MEMBER FUNCTIONS
427 
428 // PRIVATE MEMBER FUNCTIONS
429 
430 
431 //==============================================================================
432 // ABSTRACT POSET MEMBER FACET OF CLASS ST2_E2_LITE
433 //==============================================================================
434 
435 // PUBLIC MEMBER FUNCTIONS
436 
437 const std::string&
439 class_name() const
440 {
441  // Preconditions:
442 
443  // Body:
444 
445  const string& result = static_class_name();
446 
447  // Postconditions:
448 
449  ensure(!result.empty());
450 
451  // Exit:
452 
453  return result;
454 }
455 
456 const std::string&
459 {
460  // Preconditions:
461 
462  // Body:
463 
464  static const string result("st2_e2_lite");
465 
466  // Postconditions:
467 
468  ensure(!result.empty());
469 
470  // Exit:
471 
472  return result;
473 }
474 
477 clone() const
478 {
479  st2_e2_lite* result = 0;
480 
481  // Preconditions:
482 
483  // Body:
484 
485  result = new st2_e2_lite();
486 
487  // Postconditions:
488 
489  ensure(result != 0);
490  ensure(is_same_type(*result));
491 
492  // Exit:
493 
494  return result;
495 }
496 
497 // PROTECTED MEMBER FUNCTIONS
498 
499 // PRIVATE MEMBER FUNCTIONS
500 
501 
502 //==============================================================================
503 // ANY FACET OF CLASS ST2_E2_LITE
504 //==============================================================================
505 
506 // PUBLIC MEMBER FUNCTIONS
507 
508 bool
510 is_ancestor_of(const any_lite& xother) const
511 {
512  // Preconditions:
513 
514  require(&xother != 0);
515 
516  // Body:
517 
518  // True if other conforms to this.
519 
520  bool result = dynamic_cast<const st2_e2_lite*>(&xother) != 0;
521 
522  // Postconditions:
523 
524  return result;
525 }
526 
527 bool
529 invariant() const
530 {
531  bool result = true;
532 
533  if(invariant_check())
534  {
535  // Prevent recursive calls to invariant.
536 
537  disable_invariant_check();
538 
539  // Must satisfy base class invariant.
540 
541  invariance(st2_lite::invariant());
542 
543  // Invariances for this class:
544 
545  // Finished, turn invariant checking back on.
546 
547  enable_invariant_check();
548  }
549 
550  // Exit
551 
552  return result;
553 }
554 
555 void*
558 {
559  return &_row_dofs;
560 }
561 
562 const void*
564 row_dofs() const
565 {
566  return &_row_dofs;
567 }
568 
569 // PROTECTED MEMBER FUNCTIONS
570 
571 // PRIVATE MEMBER FUNCTIONS
572 
573 
574 //==============================================================================
575 // CLASS ST2_E2
576 //==============================================================================
577 
578 // ===========================================================
579 // HOST FACTORY FACET OF CLASS ST2_E2
580 // ===========================================================
581 
582 // PUBLIC MEMBER FUNCTIONS
583 
584 const sheaf::poset_path&
587 {
588  // Preconditions:
589 
590 
591  // Body:
592 
593  static const poset_path result(standard_schema_poset_name(), "st2_e2_schema");
594 
595  // Postconditions:
596 
597  // Exit:
598 
599  return result;
600 }
601 
602 void
605 {
606  // Preconditions:
607 
608  require(xns.state_is_read_write_accessible());
609  require(xns.contains_poset(standard_schema_poset_name()));
610  require(!xns.contains_poset_member(standard_schema_path()));
611 
612  // Body:
613 
614  string lmember_names = "xx DOUBLE false ";
615  lmember_names += "xy DOUBLE false ";
616  lmember_names += "yy DOUBLE false";
617 
618  schema_poset_member lschema(xns,
619  standard_schema_path().member_name(),
620  st2::standard_schema_path(),
621  lmember_names,
622  false);
623 
624  lschema.detach_from_state();
625 
626  // Postconditions:
627 
628  ensure(xns.contains_poset_member(standard_schema_path()));
629 
630  // Exit:
631 
632  return;
633 }
634 
638  const poset_path& xhost_path,
639  const poset_path& xschema_path,
640  const poset_path& xvector_space_path,
641  bool xauto_access)
642 {
643  // cout << endl << "Entering st2_e2::new_host." << endl;
644 
645  // Preconditions:
646 
647  require(xns.state_is_auto_read_write_accessible(xauto_access));
648 
649  require(!xhost_path.empty());
650  require(!xns.contains_path(xhost_path, xauto_access));
651 
652  require(xschema_path.full());
653  require(xns.path_is_auto_read_accessible(xschema_path, xauto_access));
654  require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
655  require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 3);
656 
657  require(xns.path_is_auto_read_accessible(xvector_space_path, xauto_access));
658  require(xns.contains_poset<vector_space_type::host_type>(xvector_space_path, xauto_access));
659  require(xns.member_poset(xvector_space_path, xauto_access).schema(xauto_access).conforms_to(vector_space_type::standard_schema_path()));
660  require(xns.member_poset<vector_space_type::host_type>(xvector_space_path, xauto_access).d(xauto_access) == 2);
661 
662  // Body:
663 
664  host_type& result =
665  host_type::new_table(xns, xhost_path, xschema_path, 2, xvector_space_path, xauto_access);
666 
667  // Postconditions:
668 
669  ensure(xns.owns(result, xauto_access));
670  ensure(result.path(true) == xhost_path);
671  ensure(result.state_is_not_read_accessible());
672  ensure(result.schema(true).path(xauto_access) == xschema_path);
673 
674  ensure(result.factor_ct(true) == 3);
675  ensure(result.d(true) == 3);
676  ensure(result.scalar_space_path(true) == xns.member_poset<vector_space_type::host_type>(xvector_space_path, xauto_access).scalar_space_path());
677  ensure(result.p(true) == 2);
678  ensure(result.dd(true) == 2);
679  ensure(result.vector_space_path(true) == xvector_space_path);
680 
681  // Exit:
682 
683  // cout << "Leaving st2_e2::new_host." << endl;
684  return result;
685 }
686 
689 standard_host(namespace_type& xns, const std::string& xsuffix, bool xauto_access)
690 {
691  // cout << endl << "Entering st2_e2::new_host." << endl;
692 
693  // Preconditions:
694 
695  require(xns.state_is_auto_read_write_accessible(xauto_access));
696 
697  require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
698  require(standard_host_is_available<st2_e2>(xns, xsuffix, xauto_access));
699 
700  require(xns.path_is_auto_read_accessible(standard_schema_path(), xauto_access));
701 
702  require(xns.path_is_auto_read_available(standard_host_path<vector_space_type>(xsuffix), xauto_access));
703 
704  // Body:
705 
706  // Create the vector space if necessary.
707 
708  poset_path lvector_space_path = vector_space_type::standard_host(xns, xsuffix, xauto_access).path(true);
709 
710  poset_path lpath(standard_host_path<st2_e2>(xsuffix));
711 
712  host_type* result_ptr;
713  if(xns.contains_path(lpath, xauto_access))
714  {
715  result_ptr = &xns.member_poset<host_type>(lpath, xauto_access);
716  }
717  else
718  {
719  result_ptr = &new_host(xns, lpath, standard_schema_path(), lvector_space_path, xauto_access);
720  }
721 
722  host_type& result = *result_ptr;
723 
724  // Postconditions:
725 
726  ensure(xns.owns(result, xauto_access));
727  ensure(result.path(true) == standard_host_path<st2_e2>(xsuffix));
728  ensure(result.state_is_not_read_accessible());
729  ensure(result.schema(true).path(xauto_access) == standard_schema_path());
730 
731  ensure(result.factor_ct(true) == 3);
732  ensure(result.d(true) == 3);
733  ensure(result.scalar_space_path(true) == standard_host_path<vector_space_type::scalar_type>(xsuffix) );
734  ensure(result.p(true) == 2);
735  ensure(result.dd(true) == 2);
736  ensure(result.vector_space_path(true) == standard_host_path<vector_space_type>(xsuffix) );
737 
738  // Exit:
739 
740  // cout << "Leaving st2_e2::new_host." << endl;
741  return result;
742 }
743 
744 // PROTECTED MEMBER FUNCTIONS
745 
746 // PRIVATE MEMBER FUNCTIONS
747 
748 
749 //==============================================================================
750 // ST2_E2 FACET OF CLASS ST2_E2
751 //==============================================================================
752 
753 // PUBLIC MEMBER FUNCTIONS
754 
757 new_tp(int xp, bool xauto_access) const
758 {
759  // Preconditions:
760 
761  require(precondition_of(e2::new_tp(vector_space(xauto_access), xp)));
762 
763  // Body:
764 
765  tp* result = e2::new_tp(vector_space(xauto_access), xp);
766 
767  // Postconditions:
768 
769  ensure(postcondition_of(e2::new_tp(vector_space(xauto_access), xp)));
770 
771  // Exit:
772 
773  return result;
774 }
775 
778 new_atp(int xp, bool xauto_access) const
779 {
780  // Preconditions:
781 
782  require(precondition_of(e2::new_atp(vector_space(xauto_access), xp)));
783 
784  // Body:
785 
786  atp* result = e2::new_atp(vector_space(xauto_access), xp);
787 
788  // Postconditions:
789 
790  ensure(postcondition_of(e2::new_atp(vector_space(xauto_access), xp)));
791 
792  // Exit:
793 
794  return result;
795 }
796 
799 new_stp(int xp, bool xauto_access) const
800 {
801  // Preconditions:
802 
803  require(precondition_of(e2::new_stp(vector_space(xauto_access), xp)));
804 
805  // Body:
806 
807  stp* result = e2::new_stp(vector_space(xauto_access), xp);
808 
809  // Postconditions:
810 
811  ensure(postcondition_of(e2::new_stp(vector_space(xauto_access), xp)));
812 
813  // Exit:
814 
815  return result;
816 }
817 
820 {
821 
822  // Preconditions:
823 
824  // Body:
825 
826  // Postconditions:
827 
828  ensure(invariant());
829 }
830 
833 {
834  // Preconditions:
835 
836  require(xhost != 0);
837  require(xhost->state_is_read_accessible());
838  require(xhost->contains_member(xhub_id));
839 
840  // Body:
841 
842  attach_to_state(xhost, xhub_id);
843 
844  // Postconditions:
845 
846  ensure(invariant());
847  // ensure(host() == xhost);
848  ensure(index() == xhub_id);
849  ensure(is_attached());
850 }
851 
853 st2_e2(const poset_state_handle* xhost, const scoped_index& xid)
854 {
855  // Preconditions:
856 
857  require(xhost != 0);
858  require(xhost->state_is_read_accessible());
859  require(xhost->contains_member(xid));
860 
861  // Body:
862 
863  attach_to_state(xhost, xid.hub_pod());
864 
865  // Postconditions:
866 
867  ensure(invariant());
868  // ensure(host() == xhost);
869  ensure(index() ==~ xid);
870  ensure(is_attached());
871 }
872 
874 st2_e2(const poset_state_handle* xhost, const std::string& xname)
875 {
876 
877  // Preconditions:
878 
879  require(xhost != 0);
880  require(xhost->state_is_read_accessible());
881  require(!xname.empty());
882  require(xhost->contains_member(xname));
883 
884  // Body:
885 
886  attach_to_state(xhost, xname);
887 
888  // Postconditions:
889 
890  ensure(invariant());
891  // ensure(host() == xhost);
892  ensure(name() == xname);
893  ensure(is_attached());
894 
895 }
896 
899 {
900 
901  // Preconditions:
902 
903  require(xother != 0);
904 
905  // Body:
906 
907  attach_to_state(xother);
908 
909  // Postconditions:
910 
911  ensure(invariant());
912  ensure(is_attached());
913  ensure(is_same_state(xother));
914 
915 }
916 
918 st2_e2(poset_state_handle* xhost, bool xauto_access)
919 {
920 
921  // Preconditions:
922 
923  require(precondition_of(new_jim_state(xhost, 0, false, xauto_access)));
924 
925  // Body:
926 
927  new_jim_state(xhost, 0, false, xauto_access);
928 
929  // Postconditions:
930 
931  ensure(postcondition_of(new_jim_state(xhost, 0, false, xauto_access)));
932 
933  // Exit:
934 
935  return;
936 }
937 
940  const row_dofs_type& xrdt,
941  bool xauto_access)
942 {
943 
944  // Preconditions:
945 
946  require(precondition_of(new_jim_state(&xhost, 0, false, xauto_access)));
947 
948  // Body:
949 
950  new_jim_state(&xhost, 0, false, xauto_access);
951 
952  if(xauto_access)
953  {
954  xhost.get_read_write_access();
955  }
956 
957  *this = xrdt;
958 
959  if(xauto_access)
960  {
961  xhost.release_access();
962  }
963 
964  // Postconditions:
965 
966  ensure(postcondition_of(new_jim_state(&xhost, 0, false, xauto_access)));
967 
968  // Exit:
969 
970  return;
971 }
972 
976 {
977  // Preconditions:
978 
979  require(state_is_read_write_accessible());
980 
981  // Body:
982 
983  sheaf::row_dofs(*this) = xrdt;
984 
985  // Postconditions:
986 
987  ensure_for_all(i, 0, d(), component(i) == xrdt.components[i]);
988 
989  // Exit:
990 
991  return *this;
992 
993 }
994 
999 {
1000  // Preconditions:
1001 
1002  require(is_ancestor_of(&xother));
1003  require(precondition_of(attach_to_state(&xother)));
1004 
1005  // Body:
1006 
1007  attach_to_state(&xother);
1008 
1009  // Postconditions:
1010 
1011  ensure(postcondition_of(attach_to_state(&xother)));
1012 
1013  // Exit:
1014 
1015  return *this;
1016 }
1017 
1021 operator=(const st2_e2& xother)
1022 {
1023  // Preconditions:
1024 
1025  require(precondition_of(attach_to_state(&xother)));
1026 
1027  // Body:
1028 
1029  attach_to_state(&xother);
1030 
1031  // Postconditions:
1032 
1033  ensure(postcondition_of(attach_to_state(&xother)));
1034 
1035  // Exit:
1036 
1037  return *this;
1038 }
1039 
1042 {
1043 
1044  // Preconditions:
1045 
1046  // Body:
1047 
1048 
1049  // Postconditions:
1050 
1051  // Exit:
1052 
1053 }
1054 
1058 {
1059  // Preconditions:
1060 
1061  // Body:
1062 
1063  static const volatile_type result;
1064 
1065  // Postconditions:
1066 
1067  // Exit:
1068 
1069  return result;
1070 }
1071 
1075 lite_type() const
1076 {
1077  // Preconditions:
1078 
1079  // Body:
1080 
1081  volatile_type* result = new volatile_type(sheaf::row_dofs(*this));
1082 
1083  // Postconditions:
1084 
1085  // Exit:
1086 
1087  return result;
1088 }
1089 
1090 
1091 // PROTECTED MEMBER FUNCTIONS
1092 
1093 // PRIVATE MEMBER FUNCTIONS
1094 
1095 
1096 //==============================================================================
1097 // ST2 FACET OF CLASS ST2_E2
1098 //==============================================================================
1099 
1100 // PUBLIC MEMBER FUNCTIONS
1101 
1102 // PROTECTED MEMBER FUNCTIONS
1103 
1104 // PRIVATE MEMBER FUNCTIONS
1105 
1106 
1107 //==============================================================================
1108 // INTERIOR ALGEBRA (STP) FACET OF CLASS ST2_E2
1109 //==============================================================================
1110 
1111 // PUBLIC MEMBER FUNCTIONS
1112 
1113 // PROTECTED MEMBER FUNCTIONS
1114 
1115 // PRIVATE MEMBER FUNCTIONS
1116 
1117 
1118 //==============================================================================
1119 // TENSOR ALGEBRA (TP) FACET OF CLASS ST2_E2
1120 //==============================================================================
1121 
1122 // PUBLIC MEMBER FUNCTIONS
1123 
1124 // PROTECTED MEMBER FUNCTIONS
1125 
1126 // PRIVATE MEMBER FUNCTIONS
1127 
1128 
1129 //==============================================================================
1130 // VECTOR ALGEBRA (VD) FACET OF CLASS ST2_E2
1131 //==============================================================================
1132 
1133 // PUBLIC MEMBER FUNCTIONS
1134 
1135 void
1137 put_components(dof_type xx_comp, dof_type xy_comp, dof_type yy_comp)
1138 {
1139  // Preconditions:
1140 
1141  require(state_is_read_write_accessible());
1142 
1143  // Body:
1144 
1145  put_component(0, xx_comp);
1146  put_component(1, xy_comp);
1147  put_component(2, yy_comp);
1148 
1149 
1150  // Postconditions:
1151 
1152  ensure(invariant());
1153  ensure(isunordered_or_equals(component(0), xx_comp));
1154  ensure(isunordered_or_equals(component(1), xy_comp));
1155  ensure(isunordered_or_equals(component(2), yy_comp));
1156 
1157  // Exit:
1158 
1159  return;
1160 }
1161 
1162 fiber_bundle::st2_e2::
1164 {
1165  // Preconditions:
1166 
1167  require(state_is_read_write_accessible());
1168 
1169  // Body:
1170 
1171  row_dofs_type& result = sheaf::row_dofs(*this);
1172 
1173  // Postconditions:
1174 
1175  // Exit:
1176 
1177  return result;
1178 }
1179 
1180 fiber_bundle::st2_e2::
1181 operator const st2_e2::row_dofs_type& () const
1182 {
1183  // Preconditions:
1184 
1185  require(state_is_read_accessible());
1186 
1187  // Body:
1188 
1189  const row_dofs_type& result = sheaf::row_dofs(*this);
1190 
1191  // Postconditions:
1192 
1193  // Exit:
1194 
1195  return result;
1196 }
1197 
1198 //==============================================================================
1199 // CARTESIAN ALGEBRA (TUPLE) FACET OF CLASS ST2_E2
1200 //==============================================================================
1201 
1202 // PUBLIC MEMBER FUNCTIONS
1203 
1204 // PROTECTED MEMBER FUNCTIONS
1205 
1206 // PRIVATE MEMBER FUNCTIONS
1207 
1208 
1209 //==============================================================================
1210 // ABSTRACT POSET MEMBER FACET OF CLASS ST2_E2
1211 //==============================================================================
1212 
1213 // PUBLIC MEMBER FUNCTIONS
1214 
1215 const std::string&
1217 class_name() const
1218 {
1219  // Preconditions:
1220 
1221  // Body:
1222 
1223  const string& result = static_class_name();
1224 
1225  // Postconditions:
1226 
1227  ensure(!result.empty());
1228 
1229  // Exit:
1230 
1231  return result;
1232 }
1233 
1234 const std::string&
1237 {
1238  // Preconditions:
1239 
1240  // Body:
1241 
1242  static const string result("st2_e2");
1243 
1244  // Postconditions:
1245 
1246  ensure(!result.empty());
1247 
1248  // Exit:
1249 
1250  return result;
1251 }
1252 
1255 clone() const
1256 {
1257 
1258  // Preconditions:
1259 
1260  // Body:
1261 
1262  // Create new handle of the current class.
1263 
1264  st2_e2* result = new st2_e2();
1265 
1266  // Postconditions:
1267 
1268  ensure(result != 0);
1269  ensure(result->invariant());
1270 
1271  // Exit:
1272 
1273  return result;
1274 
1275 }
1276 
1277 // PROTECTED MEMBER FUNCTIONS
1278 
1279 // PRIVATE MEMBER FUNCTIONS
1280 
1281 
1282 //==============================================================================
1283 // ANY FACET OF CLASS ST2_E2
1284 //==============================================================================
1285 
1286 // PUBLIC MEMBER FUNCTIONS
1287 
1288 bool
1290 is_ancestor_of(const any* xother) const
1291 {
1292 
1293  // Preconditions:
1294 
1295  require(xother != 0);
1296 
1297  // Body:
1298 
1299  // If xother may be dynamically cast to the type of this then this is an
1300  // ancestor of xother.
1301 
1302  bool result = dynamic_cast<const st2_e2*>(xother) != 0;
1303 
1304  // Postconditions:
1305 
1306  ensure(invariant());
1307 
1308  // Exit:
1309 
1310  return result;
1311 
1312 }
1313 
1314 bool
1316 invariant() const
1317 {
1318  bool result = true;
1319 
1320  // Preconditions:
1321 
1322  // Body:
1323 
1324  if (invariant_check())
1325  {
1326  // Prevent recursive calls to invariant.
1327 
1328  disable_invariant_check();
1329 
1330  // Must satisfy base class invariant.
1331 
1332  invariance(st2::invariant());
1333 
1334  // Invariants for this class:
1335 
1336  invariance(state_is_read_accessible() ? (dd() == 2) : true);
1337  invariance(state_is_read_accessible() ? (d() == 3) : true);
1338 
1339  // Finished, turn invariant checking back on.
1340 
1341  enable_invariant_check();
1342  }
1343 
1344  // Postconditions:
1345 
1346  ensure(is_derived_query);
1347 
1348  // Exit:
1349 
1350  return result;
1351 }
1352 
1353 // PROTECTED MEMBER FUNCTIONS
1354 
1355 // PRIVATE MEMBER FUNCTIONS
1356 
1357 
1358 //==============================================================================
1359 // NON-MEMBER FUNCTIONS
1360 //==============================================================================
1361 
1363 void
1365 determinant(const st2_e2& x0, vd_value_type& xresult, bool xauto_access)
1366 {
1367  // Preconditions:
1368 
1369  require(x0.state_is_auto_read_accessible(xauto_access));
1370 
1371  // Body:
1372 
1373  if(xauto_access)
1374  {
1375  x0.get_read_access();
1376  }
1377 
1378  vd_value_type a00 = x0.component(0);
1379  vd_value_type a01 = x0.component(1);
1380  vd_value_type a11 = x0.component(2);
1381 
1382  xresult = a00*a11 - a01*a01;
1383 
1384  if(xauto_access)
1385  {
1386  x0.release_access();
1387  }
1388 
1389  // Postconditions:
1390 
1391  ensure(unexecutable("xresult == determinant of x0"));
1392 
1393  // Exit:
1394 
1395  return;
1396 }
1397 
1401 determinant(const st2_e2& x0, bool xauto_access)
1402 {
1403  // Preconditions:
1404 
1405  require(precondition_of(determinant(x0, result, xauto_access)));
1406 
1407  // Body:
1408 
1409  vd_value_type result;
1410 
1411  determinant(x0, result, xauto_access);
1412 
1413  // Postconditions:
1414 
1415  ensure(postcondition_of(determinant(x0, result, xauto_access)));
1416 
1417  // Exit:
1418 
1419  return result;
1420 }
1421 
1423 void
1426 {
1427  // Preconditions:
1428 
1429  // Body:
1430 
1431  vd_value_type a00 = x0.component(0);
1432  vd_value_type a01 = x0.component(1);
1433  vd_value_type a11 = x0.component(2);
1434 
1435  xresult = a00*a11 - a01*a01;
1436 
1437  // Postconditions:
1438 
1439  ensure(unexecutable("xresult == determinant of x0"));
1440 
1441  // Exit:
1442 
1443  return;
1444 }
1445 
1450 {
1451  // Preconditions:
1452 
1453  require(precondition_of(determinant(x0, result)));
1454 
1455  // Body:
1456 
1457  vd_value_type result;
1458 
1459  determinant(x0, result);
1460 
1461  // Postconditions:
1462 
1463  ensure(postcondition_of(determinant(x0, result)));
1464 
1465  // Exit:
1466 
1467  return result;
1468 }
1469 
1470 // ===========================================================
1471 // TEMPLATE SPECIALIZATIONS
1472 // ===========================================================
1473 
1474 template <>
1475 void
1477 to_principal_axes(const st2_e2_lite& xlite, gl2_lite& xtransform, st2_e2_lite& xresult)
1478 {
1479  // Preconditions:
1480 
1481  // Body:
1482 
1483  // The principal axis transformation is known in closed form for the 2d case,
1484  // and is described in various introductory continuum mechanics texts.
1485  // See, for example, Fung, Y. C., "Foundations of Solid Mechanics", pg. 71.
1486 
1487  // Use the matrix diagonalization function to compute xresult.
1488 
1489  const st2_e2_lite::matrix_type& mlite = xlite;
1490  mlite.diagonalization(xresult);
1491 
1492  // Compute the transformation.
1493 
1494  typedef st2_e2_lite::value_type value_type;
1495 
1496  value_type sxx = xlite[0];
1497  value_type sxy = xlite[1];
1498  value_type syy = xlite[2];
1499 
1500  value_type theta = 0.5*atan2(2.0*sxy, sxx-syy);
1501 
1502  value_type cos_theta = cos(theta);
1503  value_type sin_theta = sin(theta);
1504 
1505  // Basis transformation:
1506 
1507  xtransform[0] = cos_theta; // bxx
1508  xtransform[1] = sin_theta; // bxy
1509  xtransform[2] = -sin_theta; // byx
1510  xtransform[3] = cos_theta; // byy
1511 
1512  // Component transformation (the inverse of the basis transformation):
1513 
1514  xtransform[4] = cos_theta; // cxx
1515  xtransform[5] = -sin_theta; // cxy
1516  xtransform[6] = sin_theta; // cyx
1517  xtransform[7] = cos_theta; // cyy
1518 
1519  // Postconditions:
1520 
1521  // Exit:
1522 }
1523 
1524 template <>
1525 void
1527 to_principal_axes(const st2_e2_lite& xlite, const st2_e2_lite& xpd_lite, gl2_lite& xtransform, st2_e2_lite& xresult)
1528 {
1529  // Preconditions:
1530 
1531  const st2_e2_lite::matrix_type& mlite = xpd_lite;
1532  bool xpd_lite_is_positive_definite = mlite.is_positive_definite();
1533 
1534  require(xpd_lite_is_positive_definite == true);
1535 
1536  // Body:
1537 
1539 
1540  // This feature solves the problem
1541  // [[xdofs] - lambda * [xpd_dofs]] * v = lambda * v
1542  // where [xdofs] and [xpd_dofs] are 2x2 symmetric matrices and
1543  // [xpd_dofs] is positive definite.
1544 
1545  // The principal axis algorithm is clumsy to express in terms of
1546  // row dof tuple member names. It's much easier to express in terms
1547  // of more traditional array expressions.
1548 
1549  const st2_e2_lite::row_dofs_type& lrdt = xlite;
1550  const st2_e2_lite::row_dofs_type& lpd_rdt = xpd_lite;
1551 
1552  gl2_lite::row_dofs_type& ltransform_rdt = xtransform;
1553  st2_e2_lite::row_dofs_type& lresult_rdt = xresult;
1554 
1555  typedef st2_e2_lite::row_dofs_type::dof_type dof_type;
1556 
1557  const dof_type* lxdofs =
1558  reinterpret_cast<const dof_type*>(lrdt.components);
1559 
1560  const dof_type* lxpd_dofs =
1561  reinterpret_cast<const dof_type*>(lpd_rdt.components);
1562 
1563  dof_type* ltransform_dofs =
1564  reinterpret_cast<dof_type*>(ltransform_rdt.components);
1565 
1566  dof_type* lresult_dofs =
1567  reinterpret_cast<dof_type*>(lresult_rdt.components);
1568 
1569  // Form the quadratic expression ax^2+bx+c from
1570  // det(xdofs-lambda*xpd_dofs) = 0.
1571 
1572  dof_type a = lxpd_dofs[0]*lxpd_dofs[2] - lxpd_dofs[1]*lxpd_dofs[1];
1573 
1574  dof_type b = 2*lxdofs[1]*lxpd_dofs[1]-lxdofs[0]*lxpd_dofs[2]
1575  -lxdofs[2]*lxpd_dofs[0];
1576 
1577  dof_type c = lxdofs[0]*lxdofs[2] - lxdofs[1]*lxdofs[1];
1578 
1579  // In exact arithmetic, the discriminant is guaranteed to be > 0,
1580  // since the eigenvalues are guaranteed to be real.
1581  // Use the absolute value to ensure this in finite precision.
1582 
1583  dof_type sqrt_discr = sqrt(abs(b*b-4*a*c));
1584 
1585  // The eigenvalues.
1586 
1587  lresult_dofs[0] = (-b+sqrt_discr)/2/a;
1588  lresult_dofs[1] = 0;
1589  lresult_dofs[2] = (-b-sqrt_discr)/2/a;
1590 
1591  // `ss' is the matrix [xdofs]-lambda*[xpd_dofs].
1592 
1593  dof_type ss[3];
1594 
1595  // For each eigenvalue, compute the eigenvector.
1596 
1597  // The following discussion is based on exact
1598  // arithmetic.
1599 
1600  // `ss' represents a singular symmetric matrix.
1601  // We are seeking a solution to
1602  // [ss]{v} = {0}.
1603  //
1604  // We want to distinguish several cases for constructing
1605  // eigenvectors, and in preparation we observe:
1606  // det(ss) == 0 == ss(0,0)*ss(1,1)-ss(0,1)^2
1607  // Therefore
1608  // ss(0,0)*ss(1,1) == ss(0,1)^2
1609  // Notice that when the off diagonal elements
1610  // of ss are 0, then at least one of the diagonals
1611  // is 0. When the off diagonal elements of ss
1612  // are nonzero, then neither of the diagonal
1613  // elements can be zero.
1614  //
1615  // All of the possible forms of ss are enumerated
1616  // in the following cases:
1617  //
1618  // Case 1:
1619  //
1620  // The offdiagonals are zero and so are the
1621  // diagonals. Any vector is an eigenvector.
1622  // We choose (1,0) for the 1st
1623  // eigenvector and (0,1) for the 2nd.
1624  //
1625  // Case 2:
1626  //
1627  // The offdiagonals are zero and the diagonal is
1628  // (not zero, zero). Then (0,1) is an
1629  // eigenvector.
1630  //
1631  // Case 3:
1632  //
1633  // The offdiagonals are zero and the diagonal is
1634  // (zero, not zero). Then (1, 0) is an
1635  // eigenvector.
1636  //
1637  // Case 4:
1638  //
1639  // The offdiagonals are not zero and the diagonals
1640  // are not zero. In this case, one can prove that
1641  // the 2nd row of ss is a scalar multiple of the
1642 
1643  // 1st row. Then (-ss(0,1), ss(0,0)) is normal
1644  // to both the 1st and 2nd rows of ss and is
1645  // an eigenvector.
1646 
1647  for(int i=0; i<2; ++i)
1648  {
1649  // Compute [xdofs]-lambda[i]*[xpd_dofs].
1650 
1651  dof_type lambda = (i == 0) ? lresult_dofs[0] : lresult_dofs[2];
1652 
1653  ss[0] = lxdofs[0]-lambda*lxpd_dofs[0];
1654  ss[1] = lxdofs[1]-lambda*lxpd_dofs[1];
1655  ss[2] = lxdofs[2]-lambda*lxpd_dofs[2];
1656 
1657  if(ss[1] == 0)
1658  {
1659  if(ss[2] == 0)
1660  {
1661  if(ss[0] == 0)
1662  {
1663  // Case 1:
1664 
1665  if(i == 0)
1666  {
1667  // 1st eigenvector
1668 
1669  ltransform_dofs[0] = 1;
1670  ltransform_dofs[2] = 0;
1671  }
1672  else
1673  {
1674  // 2nd eigenvector
1675 
1676  ltransform_dofs[1] = 0;
1677  ltransform_dofs[3] = 1;
1678  }
1679  }
1680  else
1681  {
1682  // Case 2:
1683 
1684  ltransform_dofs[i] = 0;
1685  ltransform_dofs[2+i] = 1;
1686  }
1687  }
1688  else
1689  {
1690  // Case 3:
1691 
1692  ltransform_dofs[i] = 1;
1693  ltransform_dofs[2+i] = 0;
1694  }
1695  }
1696  else
1697  {
1698  // Case 4:
1699 
1700  ltransform_dofs[i] = -ss[1];
1701  ltransform_dofs[2+i] = ss[0];
1702  }
1703 
1704  // Normalize the eigenvector. The normalization we use is
1705  // (v) * [xpd_dofs] * {v} = 1
1706  // One can show that this normalization produces the following
1707  // results:
1708  // [xtransform_dofs] transpose * [xpd_dofs] * [xtransform_dofs]
1709  // = diagonal(1, 1)
1710  // [xtransform_dofs] transpose * [xdofs ] * [xtransform_dofs]
1711  // = diagonal(lambda[0], lambda[1])
1712 
1713  // d = {v} transpose * [g] * {v} > 0 since [xpd_dofs] is positive definite.
1714 
1715  dof_type d =
1716  ltransform_dofs[i]*
1717  (ltransform_dofs[i]*lxpd_dofs[0]+ltransform_dofs[2+i]*lxpd_dofs[1])
1718  +ltransform_dofs[2+i]*
1719  (ltransform_dofs[i]*lxpd_dofs[1]+ltransform_dofs[2+i]*lxpd_dofs[2]);
1720 
1721  d = sqrt(d);
1722 
1723  ltransform_dofs[i] /= d;
1724  ltransform_dofs[2+i] /= d;
1725  }
1726 
1727  // Assign the inverse transform.
1728 
1729  dof_type det = ltransform_dofs[0]*ltransform_dofs[3]
1730  - ltransform_dofs[1]*ltransform_dofs[2];
1731 
1732  ltransform_dofs[4] = ltransform_dofs[3]/det;
1733  ltransform_dofs[5] = -ltransform_dofs[1]/det;
1734  ltransform_dofs[6] = -ltransform_dofs[2]/det;
1735  ltransform_dofs[7] = ltransform_dofs[0]/det;
1736 
1737  // Postconditions:
1738 
1739  // Exit:
1740 
1741 }
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...
SHEAF_DLL_SPEC void sqrt(const sec_at0 &x0, sec_at0 &xresult, bool xauto_access)
Compute sqrt of x0 (sqrt(x0)) (pre-allocated version).
Definition: sec_at0.cc:1556
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 volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
Definition: st2_e2.cc:1075
virtual void put_components(dof_type xx_comp, dof_type xy_comp, dof_type yy_comp)
Sets values of the components to the given arguments.
Definition: st2_e2.cc:1137
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
row_dofs_type::matrix_type matrix_type
The type of the associated matrix.
Definition: st2_e2.h:169
row_dofs_type _row_dofs
Row_dofs_type.
Definition: st2_e2.h:256
An antisymmetric tensor of degree p.
Definition: atp.h:190
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: st2.h:56
static int d(const namespace_poset &xns, int xp, const poset_path &xvector_space_path, bool xauto_access)
The tensor dimension implied by tensor degree xp and the dimension of the domain vector space specifi...
Definition: atp_space.cc:86
virtual int dd() const
Dimension of the underlying vector space.
Definition: st2_e2.cc:322
double dof_type
The type of the dofs.
Definition: st2_e2.h:60
poset_path path(bool xauto_access=true) const
A path to this component.
bool conforms_to(const schema_poset_member &xother) const
True if the dofs defined by this agree in type and in order with the dofs defined by xother...
The default name space; a poset which contains other posets as members.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
bool path_is_auto_read_accessible(const poset_path &xpath, bool xauto_access) const
True if the state referred to xpath exists and is auto read accessible.
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
virtual stp * new_stp(int xp, bool xauto_access) const
Virtual constructor for symmetric tensors of degree xp over vector space xvector_space.
Definition: st2_e2.cc:799
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...
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 st2_e2 * clone() const
Make a new handle, no state instance of current.
Definition: st2_e2.cc:1255
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
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: st2_e2.cc:604
STL namespace.
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: st2_e2.cc:637
virtual value_type component(int xrow, int xcolumn) const
The value of the component in a specified row and column.
Definition: st2.cc:145
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
Definition: st2_e2.cc:1057
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.
~st2_e2()
Destructor.
Definition: st2_e2.cc:1041
static const std::string & static_class_name()
The name of this class.
Definition: st2_e2.cc:458
SHEAF_DLL_SPEC void determinant(const st2 &x0, vd_value_type &xresult, bool xauto_access)
The determinant of a symmetric tensor (pre-allocated version for persistent types).
Definition: st2.cc:1228
T * to_principal_axes(const T &xlite, GLN &xtransform)
Computes the principal axes basis for xlite. Returns the diagonalization in the auto-allocated result...
Definition: st2.impl.h:40
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
Definition: st2_e2.cc:510
An antisymmetric tensor of degree p over an abstract vector space (volatile version).
Definition: atp.h:44
static int d(const namespace_poset &xns, int xp, const poset_path &xvector_space_path, bool xauto_access)
The tensor dimension implied by tensor degree xp and the dimension of the domain vector space specifi...
Definition: stp_space.cc:86
A general tensor of "degree" p and given "variance" over an abstract vector space.
Definition: tp.h:253
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
Abstract base class with useful features for all volatile objects.
Definition: any_lite.h:48
Abstract base class with useful features for all objects.
Definition: any.h:39
virtual atp * new_atp(int xp, bool xauto_access) const
Virtual constructor for antisymmetric tensors of degree xp over vector space xvector_space.
Definition: st2_e2.cc:778
A general symmetric tensor of degree 2 over an abstract vector space (volatile version).
Definition: st2.h:43
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
st2_e2_lite()
Default constructor.
Definition: st2_e2.cc:48
The mathematical group GL(2, R). The group of all invertible, linear transformations on the R2...
Definition: gl2.h:173
virtual st2_e2_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
Definition: st2_e2.cc:477
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...
st2_e2()
Default constructor.
Definition: st2_e2.cc:819
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
Definition: st2_e2.cc:586
bool owns(const poset_state_handle &xposet, bool xauto_access) const
True if and only if this contains the poset xposet. synonym for contains_poset(xposet.poset_path(true), xauto_access)
virtual void detach_from_state()
Detach this handle from its state, if any.
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
T components[3]
Assignment to array of type dof_type.
Definition: st2_e2.h:132
SHEAF_DLL_SPEC void atan2(const sec_at0 &x0, const sec_at0 &x1, sec_at0 &xresult, bool xauto_access)
Compute atan2 of x0/x1 (atan2(x0, x1)) (pre-allocated version).
Definition: sec_at0.cc:1228
virtual const std::string & class_name() const
The name of this class.
Definition: st2_e2.cc:1217
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
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 tp * new_tp(int xp, bool xauto_access) const
Virtual constructor for general tensors of degree xp over vector space xvector_space.
Definition: st2_e2.cc:757
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 invariant() const
Class invariant.
Definition: st2_e2.cc:529
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 * row_dofs()
The row dofs for this instance (mutable version).
Definition: st2_e2.cc:557
SHEAF_DLL_SPEC void cos(const sec_at0 &x0, sec_at0 &xresult, bool xauto_access)
Compute cos of x0 (cos(x0)) (pre-allocated version).
Definition: sec_at0.cc:1270
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
Definition: at1_space.h:42
virtual const atp_lite & atp_prototype(int xp) const
Prototype for antisymmetric tensors of degree xp over this vector space.
Definition: st2_e2.cc:374
static int factor_ct(int xd)
Factor_ct() as a function of dimension xd.
Definition: vd_space.cc:167
st2_e2 & operator=(const row_dofs_type &xrdt)
Assignment to an instance of the associated row dofs type.
Definition: st2_e2.cc:975
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
virtual void put_components(const value_type &xx_comp, const value_type &xy_comp, const value_type &yy_comp)
Set values of the components to the given arguments.
Definition: st2_e2.cc:265
A symmetric tensor of degree 2 over a Euclidean vector space of dimension 2 (persistent version)...
Definition: st2_e2.h:431
int dd() const
The dimension of the underlying ("domain") vector space.
Definition: tp_space.cc:317
static const std::string & static_class_name()
The name of this class.
Definition: st2_e2.cc:1236
A symmetric tensor of degree 2 over a Euclidean vector space of dimension 2 (volatile version)...
Definition: st2_e2.h:150
T components[8]
The dofs in the following order:
Definition: gl2.h:154
virtual ~st2_e2_lite()
Destructor.
Definition: st2_e2.cc:102
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
virtual const stp_lite & stp_prototype(int xp) const
Prototype for symmetric tensors of degree xp over this vector space.
Definition: st2_e2.cc:395
A symmetric tensor of degree p over an abstract vector space (volatile version).
Definition: stp.h:44
An abstract symmetric tensor space of degree p.
Definition: stp_space.h:42
Namespace for the fiber_bundles component of the sheaf system.
value_type component(int xrow, int xcolumn) const
The component with row index xrow and column index xcolumn.
Definition: st2.cc:751
SHEAF_DLL_SPEC void sin(const sec_at0 &x0, sec_at0 &xresult, bool xauto_access)
Compute sin of x0 (sin(x0)) (pre-allocated version).
Definition: sec_at0.cc:1516
virtual const std::string & class_name() const
The name of this class.
Definition: st2_e2.cc:439
static host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path<st2_e2>(xsuffix). Returns the host if it already exists...
Definition: st2_e2.cc:689
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
st2_e2_lite & operator=(const st2_e2_lite &xother)
Assignment operator.
Definition: st2_e2.cc:80
virtual const tp_lite & tp_prototype(int xp) const
Prototype for general tensors of degree xp over this vector space.
Definition: st2_e2.cc:353
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
Definition: scoped_index.h:710
bool is_ancestor_of(const any *xother) const
True if other conforms to current.
Definition: st2_e2.cc:1290
bool invariant() const
Class invariant.
Definition: st2_e2.cc:1316
SHEAF_DLL_SPEC bool isunordered_or_equals(float x1, float x2)
True if isunordered(x1, x2) or x1 == x2.
Definition: sheaf.cc:102