SheafSystem  0.0.0.0
section_space_schema_member_2.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/section_space_schema_member.impl.h"
22 
23 #include "SheafSystem/assert_contract.h"
24 #include "SheafSystem/array_index_space_state.h"
25 #include "SheafSystem/cover_set_iterator.h"
26 #include "SheafSystem/discretization_iterator.h"
27 #include "SheafSystem/index_space_iterator.h"
28 #include "SheafSystem/scattered_insertion_index_space_handle.h"
29 #include "SheafSystem/namespace_poset.h"
30 #include "SheafSystem/sec_rep_descriptor.h"
31 #include "SheafSystem/section_space_schema_poset.h"
32 #include "SheafSystem/sheaves_namespace.h"
33 #include "SheafSystem/std_set.h"
34 
35 using namespace std;
36 using namespace fiber_bundle; // Workaround for MS C++ bug.
37 
38 // ===========================================================
39 // SECTION_SPACE_SCHEMA_MEMBER FACET
40 // ===========================================================
41 
42 // PUBLIC MEMBER FUNCTIONS
43 
44 const std::string&
46 class_name() const
47 {
48  // Preconditions:
49 
50  // Body:
51 
52  const string& result = static_class_name();
53 
54  // Postconditions:
55 
56  ensure(!result.empty());
57 
58  // Exit:
59 
60  return result;
61 }
62 
63 const std::string&
66 {
67  // Preconditions:
68 
69  // Body:
70 
71  static const string result("section_space_schema_member");
72 
73  // Postconditions:
74 
75  ensure(!result.empty());
76 
77  // Exit:
78 
79  return result;
80 }
81 
84 operator=(const abstract_poset_member& xother)
85 {
86  // Preconditions:
87 
88  // Body:
89 
90  attach_to_state(&xother);
91 
92  // Postconditions:
93 
94  ensure(is_same_state(&xother));
95 
96  // Exit
97 
98  return *this;
99 }
100 
104 {
105 
106  // Preconditions:
107 
108  require(is_ancestor_of(&xother));
109 
110  //Body:
111 
112  not_implemented();
113 
114  //Postconditions:
115 
116  ensure(invariant());
117 
118  //Exit:
119 
120  return *this;
121 }
122 
125 {
126 
127  // Preconditions:
128 
129  // Body:
130 
131  _base_space.detach_from_state();
132  _fiber_schema.detach_from_state();
133 
134  if(_discretization_id_space != 0)
135  {
136  _discretization_id_space->release_id_space(*_discretization_id_space);
137  }
138 
139  // Postconditions:
140 
141  // Exit
142 
143  return;
144 }
145 
148 rep()
149 {
150  // Preconditions:
151 
152  require(is_attached());
153 
154  // Body:
155 
156  sec_rep_descriptor& result = host()->rep();
157 
158  // Postconditions:
159 
160  // Exit
161 
162  return result;
163 }
164 
167 rep() const
168 {
169  // Preconditions:
170 
171  require(is_attached());
172 
173  // Body:
174 
175  sec_rep_descriptor& result = host()->rep();
176 
177  // Postconditions:
178 
179  // Exit
180 
181  return result;
182 }
183 
184 bool
186 same_rep(const section_space_schema_member& xother) const
187 {
188  bool result;
189 
190  // Preconditions:
191 
192  require(is_attached());
193  require(xother.is_attached());
194 
195  // Body:
196 
197  result = rep().is_same_state(&xother.rep());
198 
199  // Postconditions:
200 
201 
202  // Exit:
203 
204  return result;
205 }
206 
209 base_space_id() const
210 {
211  return _base_space_id;
212 }
213 
214 void
216 base_space_id(scoped_index& result) const
217 {
218  // Preconditions:
219 
220  require(is_factorable());
221 
222  // Body:
223 
224  result.put(_base_space.hub_id_space(), _base_space_id);
225 
226  // Postconditions:
227 
228  ensure(result.same_scope(base_space().hub_id_space()));
229 
230  // Exit:
231 
232  return;
233 }
234 
237 base_space()
238 {
239  // Preconditions:
240 
241  require(is_factorable());
242 
243  // Body:
244 
245  return _base_space;
246 }
247 
250 base_space() const
251 {
252  // Preconditions:
253 
254  require(is_factorable());
255 
256  // Body:
257 
258  return _base_space;
259 }
260 
261 bool
263 same_base_space(const section_space_schema_member& xother) const
264 {
265  bool result;
266 
267  // Preconditions:
268 
269  require(is_attached());
270  require(xother.is_attached());
271  require(is_factorable());
272  require(xother.is_factorable());
273 
274  // Body:
275 
276  result = base_space().is_same_state(&xother.base_space());
277 
278  // Postconditions:
279 
280 
281  // Exit:
282 
283  return result;
284 }
285 
288 fiber_schema_id() const
289 {
290  return _fiber_schema_id;
291 }
292 
293 void
295 fiber_schema_id(scoped_index& result) const
296 {
297  // Preconditions:
298 
299  require(is_factorable());
300 
301  // Body:
302 
303  result.put(_fiber_schema.hub_id_space(), _fiber_schema_id);
304 
305  // Postconditions:
306 
307  ensure(result.same_scope(fiber_schema().hub_id_space()));
308 
309  // Exit:
310 
311  return;
312 }
313 
316 fiber_schema()
317 {
318  // Preconditions:
319 
320  require(is_factorable());
321 
322  // Body:
323 
324  return _fiber_schema;
325 }
326 
329 fiber_schema() const
330 {
331  // Preconditions:
332 
333  require(is_factorable());
334 
335  // Body:
336 
337  return _fiber_schema;
338 }
339 
340 bool
343 {
344  bool result;
345 
346  // Preconditions:
347 
348  require(is_attached());
349  require(xother.is_attached());
350  require(is_factorable());
351  require(xother.is_factorable());
352 
353  // Body:
354 
355  result = fiber_schema().is_same_state(&xother.fiber_schema());
356 
357  // Postconditions:
358 
359 
360  // Exit:
361 
362  return result;
363 }
364 
365 
368 fiber_space()
369 {
370  // Preconditions:
371 
372  require(is_attached());
373 
374  // Body:
375 
376  poset& result = host()->fiber_space();
377 
378  // Postconditions:
379 
380  // Exit
381 
382  return result;
383 }
384 
385 const sheaf::poset&
387 fiber_space() const
388 {
389  // Preconditions:
390 
391  require(is_attached());
392 
393  // Body:
394 
395  poset& result = host()->fiber_space();
396 
397  // Postconditions:
398 
399  // Exit
400 
401  return result;
402 }
403 
404 int
406 db() const
407 {
408  int result;
409 
410  // Preconditions:
411 
412  require(state_is_read_accessible());
413 
414  // Body:
415 
416  if(!row_cache_consistent())
417  {
418  update_row_cache();
419  }
420 
421  result = _db;
422 
423  // Postconditions:
424 
425  ensure(result >= 0);
426 
427  // Exit
428 
429  return result;
430 }
431 
432 int
434 evaluation_ct() const
435 {
436  int result;
437 
438  // Preconditions:
439 
440  // Body:
441 
442  if(!row_cache_consistent())
443  {
444  update_row_cache();
445  }
446 
447  result = _evaluation_ct;
448 
449  // Postconditions:
450 
451  ensure(result >= 0);
452 
453  // Exit
454 
455  return result;
456 }
457 
458 int
460 discretization_ct() const
461 {
462  int result;
463 
464  // Preconditions:
465 
466  require(state_is_read_accessible());
467 
468  // Body:
469 
470  if(!row_cache_consistent())
471  {
472  update_row_cache();
473  }
474 
475  result = _discretization_ct;
476 
477  // Postconditions:
478 
479  ensure(result >= 0);
480 
481  // Exit
482 
483  return result;
484 }
485 
486 int
488 df() const
489 {
490  int result;
491 
492  // Preconditions:
493 
494  require(state_is_read_accessible());
495  require(is_factorable());
496 
497  // Body:
498 
499  result = fiber_schema().row_dof_ct();
500 
501  // Postconditions:
502 
503  ensure(result >= 0);
504 
505  // Exit
506 
507  return result;
508 }
509 
510 int
512 df(bool xauto_access)
513 {
514  int result;
515 
516  // Preconditions:
517 
518  require(state_is_auto_read_accessible(xauto_access));
519  require(is_factorable());
520 
521  // Body:
522 
523  if(xauto_access)
524  {
525  get_read_access();
526  }
527 
528  result = df();
529 
530  if(xauto_access)
531  {
532  release_access();
533  }
534 
535  // Postconditions:
536 
537  ensure(result >= 0);
538 
539  // Exit
540 
541  return result;
542 }
543 
544 bool
547 {
548  // Preconditions:
549 
550  // Body:
551 
552  bool result = is_valid(_base_space_id) && is_valid(_fiber_schema_id);
553 
554  // Postconditions:
555 
556  ensure(is_basic_query);
557 
558  // Exit:
559 
560  return result;
561 }
562 
566 {
567  // Preconditions:
568 
569  // Body:
570 
571  subposet& result = host()->discretization();
572 
573  // Postconditions:
574 
575  // Exit
576 
577  return result;
578 }
579 
580 const sheaf::subposet&
582 discretization() const
583 {
584  // Preconditions:
585 
586  // Body:
587 
588  subposet& result = host()->discretization();
589 
590  // Postconditions:
591 
592  // Exit
593 
594  return result;
595 }
596 
597 bool
600 {
601  bool result;
602 
603  // Preconditions:
604 
605  require(is_attached());
606  require(xother.is_attached());
607 
608  // Body:
609 
610  result = discretization().is_same_state(&xother.discretization());
611 
612  // Postconditions:
613 
614 
615  // Exit:
616 
617  return result;
618 }
619 
622 evaluation()
623 {
624  // Preconditions:
625 
626  // Body:
627 
628  subposet& result = host()->evaluation();
629 
630  // Postconditions:
631 
632  // Exit
633 
634  return result;
635 }
636 
637 const sheaf::subposet&
639 evaluation() const
640 {
641  // Preconditions:
642 
643  // Body:
644 
645  subposet& result = host()->evaluation();
646 
647  // Postconditions:
648 
649  // Exit
650 
651  return result;
652 }
653 
654 bool
656 same_evaluation(const section_space_schema_member& xother) const
657 {
658  bool result;
659 
660  // Preconditions:
661 
662  require(is_attached());
663  require(xother.is_attached());
664 
665  // Body:
666 
667  result = evaluation().is_same_state(&xother.evaluation());
668 
669  // Postconditions:
670 
671 
672  // Exit:
673 
674  return result;
675 }
676 
677 string
679 evaluator_family_name() const
680 {
681 
682  // Preconditions:
683 
684  require(is_attached());
685 
686  // Body:
687 
688  string result = rep().evaluator_family_name();
689 
690  // Postconditions:
691 
692  // Exit
693 
694  return result;
695 }
696 
697 string
700 {
701  // Preconditions:
702 
703  require(xsp.state_is_read_accessible());
704  require(!xsp.name().empty());
705 
706  // Body:
707 
708  string result;
709 
710  if(xindex == TOP_INDEX)
711  {
712  result = xsp.name();
713  }
714  else
715  {
716  result = poset_path::make_reserved_name("", xindex,
717  xsp.name() + "_id_space");
718  }
719 
720  // Postconditions:
721 
722  ensure(!result.empty());
723 
724  // Exit:
725 
726  return result;
727 }
728 
729 string
731 intersection_id_space_name(const subposet& xsp, const scoped_index& xindex)
732 {
733  // Preconditions:
734 
735  require(xsp.state_is_read_accessible());
736  require(!xsp.name().empty());
737  require(xindex.in_scope());
738 
739  // Body:
740 
741  string result = intersection_id_space_name(xsp, xindex);
742 
743  // Postconditions:
744 
745  ensure(!result.empty());
746 
747  // Exit:
748 
749  return result;
750 }
751 
752 bool
754 conforms_to(const schema_poset_member& xother, bool xis_table_dofs) const
755 {
756  bool result;
757 
758  // Preconditions:
759 
760  require(state_is_read_accessible());
761  require(is_ancestor_of(&xother));
762 
763  // Body:
764 
765  // The dofs defined by this must agree in type and in order
766  // with those defined by xother. For section_space_schema,
767  // this obviously requires that the host, rep, and version
768  // of this be the same as those of xother. In addition,
769  // the fiber schema of this must exactly match the fiber
770  // schema of xother and the initial part of the traversal of this
771  // discretization must match the traversal of the xother
772  // discretization. The only practical way to ensure this
773  // is to require the base space of this and xother to be
774  // exactly the same. Hence, section_space_schema only
775  // conform if they are identical.
776 
777  result = is_same_state(&xother);
778 
779  // Postconditions:
780 
781  // Exit
782 
783  return result;
784 }
785 
786 // PROTECTED MEMBER FUNCTIONS
787 
790 {
791 
792  // Preconditions:
793 
794  // Body:
795 
796  // The following invalidate calls are not really neccessary but serve
797  // to make things clearer.
798 
799  _base_space_id = invalid_pod_index();
800  _fiber_schema_id = invalid_pod_index();
801 
802  _discretization_id_space = 0;
803 
804  // Postconditions:
805 
806  ensure(invariant());
807  ensure(!is_attached());
808  ensure(!is_factorable());
809 
810  // Exit:
811 }
812 
813 void
816 {
817  // Preconditions:
818 
819  require(state_is_read_accessible());
820 
821  // Body:
822 
823  // Initialize inherited data members
824 
825  schema_poset_member::attach_handle_data_members();
826 
827  // Comput the component member ids.
828 
829  if(_index == TOP_INDEX || _index == BOTTOM_INDEX)
830  {
831  // Component ids are the same as _index.
832 
833  _base_space_id = _index;
834  _fiber_schema_id = _index;
835  }
836  else if(host()->is_homogeneous(_index))
837  {
838  // Component ids are factors of _index.
839 
840  host()->tuple(_index, _base_space_id, _fiber_schema_id);
841  }
842  else
843  {
844  // Components are not factors.
845 
846  _base_space_id = invalid_pod_index();
847  _fiber_schema_id = invalid_pod_index();
848  }
849 
850  // Attach the component handles
851 
852  if(is_valid(_base_space_id))
853  {
854  _base_space.attach_to_state(&(host()->base_space()), _base_space_id);
855  }
856 
857  if(is_valid(_fiber_schema_id))
858  {
859  _fiber_schema.attach_to_state(&(host()->fiber_schema()), _fiber_schema_id);
860  }
861 
863  // $$SCRIBBLE: Remove version hack.
864 
865 // /// @hack section_space_schema version hack:
866 // /// version of this is same as version of base space.
867 
868 // _base_space.put_version(_version, false);
869 
870  // Postconditions:
871 
872  ensure(!is_valid(base_space_id()) || base_space().is_attached());
873  ensure(!is_valid(fiber_schema_id()) || fiber_schema().is_attached());
874 
875  // Exit
876 
877  return;
878 }
879 
880 // PRIVATE MEMBER FUNCTIONS
881 
882 
883 // ===========================================================
884 // SCHEMA_POSET_MEMBER FACET
885 // ===========================================================
886 
887 // PUBLIC MEMBER FUNCTIONS
888 
889 bool
892  pod_index_type xfiber_id,
893  bool xin_table_dofs) const
894 {
895  bool result;
896 
897  // Preconditions:
898 
899  require(state_is_read_accessible());
900  require(host()->is_schematized(false));
901  require(host()->contains_member(xbase_id, xfiber_id, false));
902 
903  // Body:
904 
905  pod_index_type lid;
906  host()->ordinal(xbase_id, xfiber_id, lid);
907 
908  result = contains_dof(lid, xin_table_dofs);
909 
910  // Postconditions:
911 
912  // Exit
913 
914  return result;
915 }
916 
917 bool
919 contains_dof(const scoped_index& xbase_id,
920  const scoped_index& xfiber_id,
921  bool xin_table_dofs) const
922 {
923  bool result;
924 
925  // Preconditions:
926 
927  require(state_is_read_accessible());
928  require(host()->is_schematized(false));
929 
930  // Body:
931 
932  return contains_dof(xbase_id.hub_pod(), xfiber_id.hub_pod());
933 }
934 
935 // PROTECTED MEMBER FUNCTIONS
936 
938 // void
939 // fiber_bundle::section_space_schema_member::
940 // update_table_cache() const
941 // {
942 // // Preconditions:
943 
944 // require(state_is_read_accessible());
945 
946 // // Body:
947 
948 // if(!host()->member_id_spaces(false).contains(table_dof_subposet_name()))
949 // {
950 // // Create the table dof id space.
951 
952 // arg_list largs = array_index_space_state::make_arg_list(0);
953 
954 // pod_index_type lspace_id =
955 // host()->new_member_id_space(table_dof_subposet_name(),
956 // "array_index_space_state",
957 // largs, false, false);
958 
959 // _table_dof_id_space =
960 // &host()->member_id_spaces(false).get_id_space(lspace_id);
961 
962 // // Populate the table dof id map.
963 
964 // // The table dofs of the section space schema are the same as
965 // // the table dofs of the fiber space schema and map into
966 // // the section space schema id space as (base bottom, fiber schema mbr).
967 
968 // scattered_insertion_index_space_handle* ltable_dof_id_space =
969 // reinterpret_cast<scattered_insertion_index_space_handle*>(_table_dof_id_space);
970 // ltable_dof_id_space->reserve(fiber_schema().table_dof_id_space().ct());
971 
972 // index_space_iterator& litr =
973 // fiber_schema().table_dof_id_space().get_iterator();
974 // while(!litr.is_done())
975 // {
976 // // Iterating over the ids of the fiber schema table dof id space
977 // // in host (poset) order.
978 
979 // ltable_dof_id_space->insert(litr.pod(), litr.hub_pod());
980 
981 // litr.next();
982 // }
983 // fiber_schema().table_dof_id_space().release_iterator(litr);
984 // }
985 // else
986 // {
987 // _table_dof_id_space =
988 // &host()->member_id_spaces(false).get_id_space(table_dof_subposet_name());
989 // }
990 
991 // schema_poset_member::update_table_cache();
992 
993 // // Postconditions:
994 
995 // // Exit
996 
997 // return;
998 // }
999 
1000 void
1003 {
1004  // Preconditions:
1005 
1006  require(state_is_read_accessible());
1007 
1008  // Body:
1009 
1010  if(is_factorable())
1011  {
1012  // Member is factorable, table dof id space is that same as
1013  // the fiber schema.
1014 
1015  scattered_insertion_index_space_handle* ltable_dof_id_space =
1016  reinterpret_cast<scattered_insertion_index_space_handle*>(_table_dof_id_space);
1017  ltable_dof_id_space->reserve(fiber_schema().table_dof_id_space().ct());
1018 
1019  // Table dof ids are the same as fiber schema.
1020 
1021  pod_index_type lid;
1022 
1023  index_space_iterator& litr =
1024  fiber_schema().table_dof_id_space().get_iterator();
1025  while(!litr.is_done())
1026  {
1027  host()->ordinal(BOTTOM_INDEX, litr.hub_pod(), lid);
1028 
1029  ltable_dof_id_space->push_back(lid);
1030 
1031  litr.next();
1032  }
1033  fiber_schema().table_dof_id_space().release_iterator(litr);
1034  }
1035  else
1036  {
1037  // Just another schema member.
1038 
1039  schema_poset_member::update_table_dof_id_space();
1040  }
1041 
1042  // Postconditions:
1043 
1044  // Exit
1045 
1046  return;
1047 }
1048 
1049 void
1052 {
1053  // Preconditions:
1054 
1055  require(state_is_read_accessible());
1056 
1057  // Body:
1058 
1059  if(is_factorable())
1060  {
1061  // This member is factorable. Copy the table dof descriptors from
1062  // the fiber schema.
1063 
1064  // (Re)allocate the dof descriptors.
1065 
1066  if(_table_dof_descriptors != 0)
1067  {
1068  _table_dof_descriptors->remove_reference();
1069  }
1070  _table_dof_descriptors = new dof_descriptor_array(_table_dof_ct);
1071  _table_dof_descriptors->add_reference();
1072 
1073  // Copy fiber schema dof descriptors.
1074 
1075  index_space_iterator& itr = _table_dof_id_space->get_iterator();
1076  while(!itr.is_done())
1077  {
1078  dof_descriptor_array::dof_descriptor& ldesc = (*_table_dof_descriptors)[itr.pod()];
1079 
1080  ldesc.size = fiber_schema().size(itr.pod(), true);
1081  ldesc.alignment = fiber_schema().alignment(itr.pod(), true);
1082  ldesc.type = fiber_schema().type(itr.pod(), true);
1083  ldesc.offset = fiber_schema().offset(itr.pod(), true);
1084 
1085  itr.next();
1086  }
1087 
1088  _table_dof_tuple_ub = fiber_schema().table_dof_tuple_ub();
1089 
1090  // The last offset is the size of the entire tuple
1091 
1092  dof_descriptor_array::dof_descriptor& ldesc = (*_table_dof_descriptors)[_table_dof_ct];
1093  ldesc.size = 0;
1094  ldesc.alignment = 0;
1095  ldesc.type = NOT_A_PRIMITIVE_TYPE;
1096  ldesc.offset = _table_dof_tuple_ub;
1097  }
1098  else
1099  {
1100  // Just another schema member.
1101 
1102  schema_poset_member::update_table_dof_descriptors();
1103  }
1104 
1105  // Postconditions:
1106 
1107  // Exit:
1108 
1109  return;
1110 }
1111 
1112 // PRIVATE MEMBER FUNCTIONS
1113 
1114 
1115 // ===========================================================
1116 // NEW DOF ACCESS FACET
1117 // ===========================================================
1118 
1119 // PUBLIC MEMBER FUNCTIONS
1120 
1124 {
1125  // Preconditions:
1126 
1127  require(state_is_read_accessible());
1128 
1129  // Body:
1130 
1131  if(!row_cache_consistent())
1132  {
1133  update_row_cache();
1134  }
1135 
1136  const index_space_handle& result = *_discretization_id_space;
1137 
1138  // Postconditions:
1139 
1140 
1141  // Exit:
1142 
1143  return result;
1144 }
1145 
1148 discretization_id_space(bool xauto_access) const
1149 {
1150  // Preconditions:
1151 
1152  require(state_is_auto_read_accessible(xauto_access));
1153 
1154  // Body:
1155 
1156  if(xauto_access)
1157  {
1158  get_read_access();
1159  }
1160 
1161  if(!row_cache_consistent())
1162  {
1163  update_row_cache();
1164  }
1165 
1166  const index_space_handle& result = *_discretization_id_space;
1167 
1168  if(xauto_access)
1169  {
1170  release_access();
1171  }
1172 
1173  // Postconditions:
1174 
1175 
1176  // Exit:
1177 
1178  return result;
1179 }
1180 
1184 {
1185  // Preconditions:
1186 
1187  require(state_is_read_accessible());
1188 
1189  // Body:
1190 
1191  if(!row_cache_consistent())
1192  {
1193  update_row_cache();
1194  }
1195 
1196  index_space_handle& result = *_discretization_id_space;
1197 
1198  // Postconditions:
1199 
1200 
1201  // Exit:
1202 
1203  return result;
1204 }
1205 
1208 discretization_id_space(bool xauto_access)
1209 {
1210  // Preconditions:
1211 
1212  require(state_is_auto_read_accessible(xauto_access));
1213 
1214  // Body:
1215 
1216  if(xauto_access)
1217  {
1218  get_read_access();
1219  }
1220 
1221  if(!row_cache_consistent())
1222  {
1223  update_row_cache();
1224  }
1225 
1226  index_space_handle& result = *_discretization_id_space;
1227 
1228  if(xauto_access)
1229  {
1230  release_access();
1231  }
1232 
1233  // Postconditions:
1234 
1235 
1236  // Exit:
1237 
1238  return result;
1239 }
1240 
1243 fiber_schema_id_space(bool xis_table_dofs) const
1244 {
1245  // Preconditions:
1246 
1247  require(state_is_read_accessible());
1248  require(is_factorable());
1249 
1250  // Body:
1251 
1252  const index_space_handle& result = fiber_schema().dof_id_space(xis_table_dofs);
1253 
1254  // Postconditions:
1255 
1256 
1257  // Exit:
1258 
1259  return result;
1260 }
1261 
1264 fiber_schema_id_space(bool xis_table_dofs, bool xauto_access) const
1265 {
1266  // Preconditions:
1267 
1268  require(state_is_auto_read_accessible(xauto_access));
1269  require(is_factorable());
1270 
1271  // Body:
1272 
1273  const index_space_handle& result =
1274  fiber_schema().dof_id_space(xis_table_dofs, xauto_access);
1275 
1276  // Postconditions:
1277 
1278 
1279  // Exit:
1280 
1281  return result;
1282 }
1283 
1284 
1287 size(pod_index_type xdof_id, bool xis_table_dof) const
1288 {
1289  // Preconditions:
1290 
1291  require(state_is_read_accessible());
1292  require(is_factorable());
1293  require(xis_table_dof ? fiber_schema_id_space(xis_table_dof).contains(xdof_id) : true);
1294 
1295  // Body:
1296 
1297  size_type result = 0;
1298 
1299  is_abstract();
1300 
1301  // Postconditions:
1302 
1303  // Exit:
1304 
1305  return result;
1306 }
1307 
1310 size(pod_index_type xdisc_id, pod_index_type xfiber_dof_id, bool xis_table_dof) const
1311 {
1312  // Preconditions:
1313 
1314  require(state_is_read_accessible());
1315  require(is_factorable());
1316  require(fiber_schema_id_space(xis_table_dof).contains(xfiber_dof_id));
1317 
1318  // Body:
1319 
1320  size_type result = 0;
1321 
1322  is_abstract();
1323 
1324  // Postconditions:
1325 
1326 
1327  // Exit:
1328 
1329  return result;
1330 }
1331 
1334 size(const scoped_index& xdisc_id,
1335  const scoped_index& xfiber_dof_id,
1336  bool xis_table_dof,
1337  bool xauto_access) const
1338 {
1339  // Preconditions:
1340 
1341  require(state_is_read_accessible());
1342  require(is_factorable());
1343  require(fiber_schema_id_space(xis_table_dof, xauto_access).contains(xfiber_dof_id));
1344 
1345  // Body:
1346 
1347  size_type result = 0;
1348 
1349  is_abstract();
1350 
1351  // Postconditions:
1352 
1353 
1354  // Exit:
1355 
1356  return result;
1357 }
1358 
1361 alignment(pod_index_type xdof_id, bool xis_table_dof) const
1362 {
1363  // Preconditions:
1364 
1365  require(state_is_read_accessible());
1366  require(is_factorable());
1367  require(xis_table_dof ? fiber_schema_id_space(xis_table_dof).contains(xdof_id) : true);
1368 
1369  // Body:
1370 
1371  size_type result = 0;
1372 
1373  is_abstract();
1374 
1375  // Postconditions:
1376 
1377 
1378  // Exit:
1379 
1380  return result;
1381 }
1382 
1385 alignment(pod_index_type xdisc_id, pod_index_type xfiber_dof_id, bool xis_table_dof) const
1386 {
1387  // Preconditions:
1388 
1389  require(state_is_read_accessible());
1390  require(is_factorable());
1391  require(fiber_schema_id_space(xis_table_dof).contains(xfiber_dof_id));
1392 
1393  // Body:
1394 
1395  size_type result = 0;
1396 
1397  is_abstract();
1398 
1399  // Postconditions:
1400 
1401 
1402  // Exit:
1403 
1404  return result;
1405 }
1406 
1409 alignment(const scoped_index& xdisc_id,
1410  const scoped_index& xfiber_dof_id,
1411  bool xis_table_dof,
1412  bool xauto_access) const
1413 {
1414  // Preconditions:
1415 
1416  require(state_is_read_accessible());
1417  require(is_factorable());
1418  require(fiber_schema_id_space(xis_table_dof, xauto_access).contains(xfiber_dof_id));
1419 
1420  // Body:
1421 
1422  size_type result = 0;
1423 
1424  is_abstract();
1425 
1426  // Postconditions:
1427 
1428 
1429  // Exit:
1430 
1431  return result;
1432 }
1433 
1436 type(pod_index_type xdof_id, bool xis_table_dof) const
1437 {
1438  // Preconditions:
1439 
1440  require(state_is_read_accessible());
1441  require(is_factorable());
1442  require(xis_table_dof ? fiber_schema_id_space(xis_table_dof).contains(xdof_id) : true);
1443 
1444  // Body:
1445 
1446  primitive_type result;
1447 
1448  is_abstract();
1449 
1450  // Postconditions:
1451 
1452  // Exit:
1453 
1454  return result;
1455 }
1456 
1459 type(pod_index_type xdisc_id, pod_index_type xfiber_dof_id, bool xis_table_dof) const
1460 {
1461  // Preconditions:
1462 
1463  require(state_is_read_accessible());
1464  require(is_factorable());
1465  require(fiber_schema_id_space(xis_table_dof).contains(xfiber_dof_id));
1466 
1467  // Body:
1468 
1469  primitive_type result;
1470 
1471  is_abstract();
1472 
1473  // Postconditions:
1474 
1475  // Exit:
1476 
1477  return result;
1478 }
1479 
1482 type(const scoped_index& xdisc_id,
1483  const scoped_index& xfiber_dof_id,
1484  bool xis_table_dof,
1485  bool xauto_access) const
1486 {
1487  // Preconditions:
1488 
1489  require(state_is_read_accessible());
1490  require(is_factorable());
1491  require(fiber_schema_id_space(xis_table_dof, xauto_access).contains(xfiber_dof_id));
1492 
1493  // Body:
1494 
1495  primitive_type result;
1496 
1497  is_abstract();
1498 
1499  // Postconditions:
1500 
1501  // Exit:
1502 
1503  return result;
1504 }
1505 
1508 offset(pod_index_type xdof_id, bool xis_table_dof) const
1509 {
1510  // Preconditions:
1511 
1512  require(state_is_read_accessible());
1513  require(is_factorable());
1514  require(xis_table_dof ? fiber_schema_id_space(xis_table_dof).contains(xdof_id) : true);
1515 
1516  // Body:
1517 
1518  size_type result = 0;
1519 
1520  is_abstract();
1521 
1522  // Postconditions:
1523 
1524 
1525  // Exit:
1526 
1527  return result;
1528 }
1529 
1532 offset(pod_index_type xdisc_id, pod_index_type xfiber_dof_id, bool xis_table_dof) const
1533 {
1534  // Preconditions:
1535 
1536  require(state_is_read_accessible());
1537  require(is_factorable());
1538  require(fiber_schema_id_space(xis_table_dof).contains(xfiber_dof_id));
1539 
1540  // Body:
1541 
1542  size_type result = 0;
1543 
1544  is_abstract();
1545 
1546  // Postconditions:
1547 
1548 
1549  // Exit:
1550 
1551  return result;
1552 }
1553 
1556 offset(const scoped_index& xdisc_id,
1557  const scoped_index& xfiber_dof_id,
1558  bool xis_table_dof,
1559  bool xauto_access) const
1560 {
1561  // Preconditions:
1562 
1563  require(state_is_read_accessible());
1564  require(is_factorable());
1565  require(fiber_schema_id_space(xis_table_dof, xauto_access).contains(xfiber_dof_id));
1566 
1567  // Body:
1568 
1569  size_type result = 0;
1570 
1571  is_abstract();
1572 
1573  // Postconditions:
1574 
1575 
1576  // Exit:
1577 
1578  return result;
1579 }
1580 
1583 fiber_size() const
1584 {
1585  // Preconditions:
1586 
1587  require(state_is_read_accessible());
1588  require(is_factorable());
1589 
1590  // Body:
1591 
1592  size_type result = fiber_schema().dof_tuple_ub(false);
1593 
1594  // Postconditions:
1595 
1596 
1597  // Exit:
1598 
1599  return result;
1600 }
1601 
1604 fiber_size(bool xauto_access) const
1605 {
1606  // Preconditions:
1607 
1608  require(state_is_auto_read_accessible(xauto_access));
1609  require(is_factorable());
1610 
1611  // Body:
1612 
1613  if(xauto_access)
1614  {
1615  get_read_access();
1616  }
1617 
1618  size_type result = fiber_size();
1619 
1620  if(xauto_access)
1621  {
1622  release_access();
1623  }
1624 
1625  // Postconditions:
1626 
1627 
1628  // Exit:
1629 
1630  return result;
1631 }
1632 
1635 component_size(pod_index_type xfiber_dof_id) const
1636 {
1637  // Preconditions:
1638 
1639  require(state_is_read_accessible());
1640  require(fiber_schema_id_space(false).contains(xfiber_dof_id));
1641  require(is_factorable());
1642 
1643  // Body:
1644 
1645  if(!row_cache_consistent())
1646  {
1647  update_row_cache();
1648  }
1649 
1650  size_type result =
1651  fiber_schema().size(xfiber_dof_id, false)*_discretization_ct;
1652 
1653  // Postconditions:
1654 
1655 
1656  // Exit:
1657 
1658  return result;
1659 }
1660 
1663 component_size(const scoped_index& xfiber_dof_id, bool xauto_access) const
1664 {
1665  // Preconditions:
1666 
1667  require(state_is_auto_read_accessible(xauto_access));
1668  require(fiber_schema_id_space(false, xauto_access).contains(xfiber_dof_id));
1669  require(is_factorable());
1670 
1671  // Body:
1672 
1673  if(xauto_access)
1674  {
1675  get_read_access();
1676  }
1677 
1678  pod_index_type lfiber_dof_id =
1679  fiber_schema_id_space(false).pod(xfiber_dof_id);
1680  size_type result = component_size(lfiber_dof_id);
1681 
1682  if(xauto_access)
1683  {
1684  release_access();
1685  }
1686 
1687  // Postconditions:
1688 
1689 
1690  // Exit:
1691 
1692  return result;
1693 }
1694 
1695 // PROTECTED MEMBER FUNCTIONS
1696 
1697 // PRIVATE MEMBER FUNCTIONS
1698 
1699 
1700 // ===========================================================
1701 // I/O SUPPORT FACET
1702 // ===========================================================
1703 
1704 // PUBLIC MEMBER FUNCTIONS
1705 
1708 get_ext_id(const std::string& xid_space_name) const
1709 {
1710  // Preconditions:
1711 
1712  require(state_is_read_accessible());
1713  require(is_factorable());
1714 
1717 
1718  // Can't support the following precondition:
1719 
1720  // require(precondition_of(host()->get_ext_id(index(), xid_space_name)));
1721 
1722  // Instead:
1723 
1724  require(precondition_of(host()->base_space().get_ext_id(base_space_id(), xid_space_name)));
1725 
1726 
1727  // Body:
1728 
1729  pod_index_type result =
1730  host()->base_space().get_ext_id(base_space_id(), xid_space_name, false);
1731 
1732  // Postconditions:
1733 
1734  ensure(result >= 0);
1735 
1736  // Exit:
1737 
1738  return result;
1739 }
1740 
1741 // PROTECTED MEMBER FUNCTIONS
1742 
1743 // PRIVATE MEMBER FUNCTIONS
1744 
1745 
1746 // ===========================================================
1747 // SCHEMA FACET
1748 // ===========================================================
1749 
1750 // PUBLIC MEMBER FUNCTIONS
1751 
1753 // void
1754 // fiber_bundle::section_space_schema_member::
1755 // schematize()
1756 // {
1757 // // Preconditions:
1758 
1759 // require(state_is_read_write_accessible());
1760 // require(host()->is_schematized(false));
1761 
1762 // // Body:
1763 
1764 // /// @error host is immutable; remove this member.
1765 
1766 // // Nothing to do.
1767 
1768 // // Postconditions:
1769 
1770 // ensure(is_schematized(false));
1771 
1772 // // Exit
1773 
1774 // return;
1775 // }
1776 
1780 {
1781  // Preconditions:
1782 
1783  require(state_is_read_accessible());
1784 
1785  // Body:
1786 
1787  // Memebers of this class don't have dof tuples,
1788  // so the unrestricted schema is always the schema of the host.
1789 
1790  schema_poset_member& result = host()->schema();
1791 
1792  // Postconditions:
1793 
1794  ensure(result.is_same_state(&(host()->schema())));
1795 
1796  // Exit
1797 
1798  return result;
1799 }
1800 
1803 unrestricted_schema() const
1804 {
1805  // Preconditions:
1806 
1807  require(state_is_read_accessible());
1808 
1809  // Body:
1810 
1811  // Memebers of this class don't have dof tuples,
1812  // so the unrestricted schema is always the schema of the host.
1813 
1814  const schema_poset_member& result = host()->schema();
1815 
1816  // Postconditions:
1817 
1818  ensure(result.is_same_state(&(host()->schema())));
1819 
1820  // Exit
1821 
1822  return result;
1823 }
1824 
1825 // PROTECTED MEMBER FUNCTIONS
1826 
1827 // PRIVATE MEMBER FUNCTIONS
1828 
1829 
1830 // ===========================================================
1831 // COMPONENT INDEX FACET
1832 // ===========================================================
1833 
1834 // PUBLIC MEMBER FUNCTIONS
1835 
1837 // $$SCRIBBLE: Remove version hack.
1838 
1839 // void
1840 // fiber_bundle::section_space_schema_member::
1841 // put_version(int xversion, bool xunalias)
1842 // {
1843 // // Preconditions:
1844 
1845 // require(state_is_read_accessible());
1846 // require(has_version(xversion));
1847 // require(!xunalias ? xversion != CURRENT_MEMBER_VERSION : true);
1848 
1849 // // Body:
1850 
1851 // schema_poset_member::put_version(xversion, xunalias);
1852 
1853 // if(is_factorable())
1854 // {
1855 // /// @hack section_space_schema version hack:
1856 // /// version of this is same as version of base space.
1857 
1858 // _base_space.put_version(xversion, xunalias);
1859 // }
1860 
1861 // // Postconditions:
1862 
1863 // ensure(xunalias ?
1864 // version(false) == unaliased_version(xversion) :
1865 // version(false) == xversion);
1866 
1867 // // Exit
1868 
1869 // return;
1870 // }
1871 
1872 // PROTECTED MEMBER FUNCTIONS
1873 
1874 // PRIVATE MEMBER FUNCTIONS
1875 
1876 
1877 // ===========================================================
1878 // STATE FACET
1879 // ===========================================================
1880 
1881 // PUBLIC MEMBER FUNCTIONS
1882 
1883 void
1885 attach_to_state(pod_index_type xbase_space_id,
1886  pod_index_type xfiber_schema_id)
1887 {
1888  // Preconditions:
1889 
1890  require(state_is_read_accessible());
1891  require(host()->contains_range_member(xbase_space_id, xfiber_schema_id, false));
1892 
1893  // Body:
1894 
1895  pod_index_type lpod;
1896  host()->ordinal(xbase_space_id, xfiber_schema_id, lpod);
1897 
1898  _index = hub_id(lpod);
1899  _version = CURRENT_HOST_VERSION;
1900 
1901  attach_handle_data_members();
1902 
1903  // Postconditions:
1904 
1905  ensure(base_space_id() == xbase_space_id);
1906  ensure(base_space().is_attached());
1907  ensure(fiber_schema_id() == xfiber_schema_id);
1908  ensure(fiber_schema().is_attached());
1909 
1910  // Exit:
1911 
1912  return;
1913 }
1914 
1915 void
1917 attach_to_state(const scoped_index& xbase_space_id,
1918  const scoped_index& xfiber_schema_id)
1919 {
1920  // Preconditions:
1921 
1922  require(state_is_read_accessible());
1923  require(host()->contains_range_member(xbase_space_id, xfiber_schema_id, false));
1924 
1925  // Body:
1926 
1927  attach_to_state(xbase_space_id.hub_pod(),
1928  xfiber_schema_id.hub_pod());
1929 
1930  // Postconditions:
1931 
1932  ensure(base_space_id() == xbase_space_id.hub_pod());
1933  ensure(base_space().is_attached());
1934  ensure(fiber_schema_id() == xfiber_schema_id.hub_pod());
1935  ensure(fiber_schema().is_attached());
1936 
1937  // Exit:
1938 
1939  return;
1940 }
1941 
1942 void
1945  pod_index_type xbase_space_id,
1946  pod_index_type xfiber_schema_id)
1947 {
1948  // Preconditions:
1949 
1950  require(xhost != 0);
1951  require(host_is_ancestor_of(xhost));
1952  require(xhost->state_is_read_accessible());
1953  require(xhost->contains_range_member(xbase_space_id, xfiber_schema_id, false));
1954 
1955  // Body:
1956 
1957  pod_index_type lpod;
1958  xhost->ordinal(xbase_space_id, xfiber_schema_id, lpod);
1959 
1960  _host = const_cast<section_space_schema_poset*>(xhost);
1961  _index = hub_id(lpod);
1962  _version = CURRENT_HOST_VERSION;
1963 
1964  attach_handle_data_members();
1965 
1966  // Postconditions:
1967 
1968  ensure(base_space_id() == xbase_space_id);
1969  ensure(base_space().is_attached());
1970  ensure(fiber_schema_id() == xfiber_schema_id);
1971  ensure(fiber_schema().is_attached());
1972 
1973  // Exit:
1974  return;
1975 }
1976 
1977 void
1980  const scoped_index& xbase_space_id,
1981  const scoped_index& xfiber_schema_id)
1982 {
1983  // Preconditions:
1984 
1985  require(xhost != 0);
1986  require(host_is_ancestor_of(xhost));
1987  require(xhost->state_is_read_accessible());
1988  require(xhost->contains_range_member(xbase_space_id, xfiber_schema_id, false));
1989 
1990  // Body:
1991 
1992  attach_to_state(xhost,
1993  xbase_space_id.hub_pod(),
1994  xfiber_schema_id.hub_pod());
1995 
1996  // Postconditions:
1997 
1998  ensure(base_space_id() == xbase_space_id.hub_pod());
1999  ensure(base_space().is_attached());
2000  ensure(fiber_schema_id() == xfiber_schema_id.hub_pod());
2001  ensure(fiber_schema().is_attached());
2002 
2003  // Exit:
2004 
2005  return;
2006 }
2007 
2008 void
2011  const poset_path& xbase_path,
2012  const poset_path& xfiber_schema_path)
2013 {
2014  // Preconditions:
2015 
2016  require(xhost != 0);
2017  require(host_is_ancestor_of(xhost));
2018  require(xhost->state_is_read_accessible());
2019  require(xbase_path.full());
2020  require(xhost->base_space().contains_member(xbase_path.member_name()));
2021  require(xfiber_schema_path.full());
2022  require(xhost->fiber_schema().contains_member(xfiber_schema_path.member_name()));
2023  require(xhost->contains_range_member(xhost->base_space().member_id(xbase_path.member_name(), false),
2024  xhost->fiber_schema().member_id(xfiber_schema_path.member_name(), false), false));
2025 
2026  // Body:
2027 
2028  attach_to_state(xhost,
2029  xhost->base_space().member_id(xbase_path.member_name(), false),
2030  xhost->fiber_schema().member_id(xfiber_schema_path.member_name(), false));
2031 
2032  // Postconditions:
2033 
2034  ensure(is_attached());
2035  ensure(base_space().has_path(xbase_path, false));
2036  ensure(fiber_schema().has_path(xfiber_schema_path, false));
2037 
2038  // Exit
2039 
2040  return;
2041 }
2042 
2043 void
2046 {
2047  // Preconditions:
2048 
2049  // Body:
2050 
2051  _base_space.detach_from_state();
2052  _base_space_id = _base_space.index().pod();
2053  _fiber_schema.detach_from_state();
2054  _fiber_schema_id = _fiber_schema.index().pod();
2055 
2056  schema_poset_member::detach_from_state();
2057 
2058  // Postconditions:
2059 
2060  ensure(!is_attached());
2061 
2062  // Exit
2063 
2064  return;
2065 }
2066 
2067 // PROTECTED MEMBER FUNCTIONS
2068 
2069 // PRIVATE MEMBER FUNCTIONS
2070 
2071 
2072 // ===========================================================
2073 // HOST POSET FACET
2074 // ===========================================================
2075 
2076 // PUBLIC MEMBER FUNCTIONS
2077 
2078 bool
2080 host_is_ancestor_of(const poset_state_handle* xother) const
2081 {
2082  bool result;
2083 
2084  // Preconditions:
2085 
2086  // Body:
2087 
2088  result = dynamic_cast<const section_space_schema_poset*>(xother) != 0;
2089 
2090  // Postconditions:
2091 
2092  // Exit
2093 
2094  return result;
2095 }
2096 
2097 // PROTECTED MEMBER FUNCTIONS
2098 
2099 // PRIVATE MEMBER FUNCTIONS
2100 
2101 
2102 // ===========================================================
2103 // ANY FACET
2104 // ===========================================================
2105 
2106 // PUBLIC MEMBER FUNCTIONS
2107 
2108 bool
2110 is_ancestor_of(const any* xother) const
2111 {
2112  bool result;
2113 
2114  // Preconditions:
2115 
2116  // Body:
2117 
2118  result = dynamic_cast<const section_space_schema_member*>(xother) != 0;
2119 
2120  // Postconditions:
2121 
2122  // Exit
2123 
2124  return result;
2125 }
2126 
2127 bool
2129 invariant() const
2130 {
2131  bool result = true;
2132 
2133  // Preconditions:
2134 
2135  // Body:
2136 
2137  // Must satisfy base class invariant
2138 
2139  invariance(schema_poset_member::invariant());
2140 
2141  if(invariant_check())
2142  {
2143  // Prevent recursive calls to invariant
2144 
2145  disable_invariant_check();
2146 
2147  // Invariants for this class:
2148 
2149  invariance(is_factorable() ? base_space().is_attached() : true);
2150  invariance(is_factorable() ? fiber_schema().is_attached() : true);
2151 
2154 
2155  // Finished, turn invariant checking back on.
2156 
2157  enable_invariant_check();
2158  }
2159 
2160  // Postconditions:
2161 
2162  // Exit
2163 
2164  return result;
2165 }
2166 
2167 // PROTECTED MEMBER FUNCTIONS
2168 
2169 // PRIVATE MEMBER FUNCTIONS
2170 
2171 
2172 // ===========================================================
2173 // DEBUGGING FACET
2174 // ===========================================================
2175 
2176 // PUBLIC MEMBER FUNCTIONS
2177 
2178 void
2180 to_stream(std::ostream& xos) const
2181 {
2182  // Preconditions:
2183 
2184 
2185  // Body:
2186 
2187  xos << *this;
2188 
2189  // Postconditions:
2190 
2191 
2192  // Exit:
2193 
2194  return;
2195 }
2196 
2197 // PROTECTED MEMBER FUNCTIONS
2198 
2199 // PRIVATE MEMBER FUNCTIONS
2200 
2201 
2202 // ===========================================================
2203 // NONMEMBER FUNCTIONS
2204 // ===========================================================
2205 
2206 std::ostream& fiber_bundle::operator << (std::ostream &os, section_space_schema_member& p)
2207 {
2208 
2209  // Preconditions:
2210 
2211  // Body:
2212 
2213  if (p.is_attached())
2214  {
2215  p.get_read_access();
2217  os << "member:"
2218  << " host = \'" << p.host()->name() << "\'"
2219  << " index = " << p.index().pod()
2220  << " name = \'" << p.name() << '\''
2221  << " version= " << p.version(false)
2222  << " unaliased version= " << p.version()
2223  << endl;
2224 
2225  os << "base: member index = " << p.base_space().index().hub_pod()
2226  << " '" << p.base_space().name() << "'"
2227  << " in poset '" << p.base_space().host()->name() << "'"
2228  << endl
2229  << "fiber space is poset '" << p.fiber_space().name() << "'"
2230  << endl;
2231 
2232  p.release_access();
2234 
2235  }
2236  else
2237  {
2238  os << "member: host = \'\'' index = -1 name = \'\''"
2239  << endl;
2240  }
2241 
2242  // Exit:
2243 
2244  return os;
2245 }
2246 
virtual const std::string & class_name() const
The name of this class.
poset_state_handle * host() const
The poset which this is a handle to a component of.
std::string name() const
Definition: subposet.h:796
A client handle for a subposet.
Definition: subposet.h:86
section_space_schema_poset * host() const
The poset which this is a handle to a component of.
bool full() const
True if both poset name and member name are not empty.
Definition: poset_path.cc:311
int version(bool xunalias=true) const
The (possibly aliased) version of this component. The version of the host used when evaluating proper...
bool in_scope() const
True if and only if scope() contains an entry for pod().
Definition: scoped_index.h:584
const pod_type & pod() const
The "plain old data" storage of this; the value in the external id space.
Definition: scoped_index.h:672
virtual bool conforms_to(const schema_poset_member &xother, bool xis_table_dofs) const
True if this schema contains all the table dofs (xis_table_dofs true) or row dofs (xis_is_table_dofs ...
An abstract iterator over the ids of an id space.
schema_poset_member & fiber_schema()
The fiber schema component of this (mutable version).
pod_type pod() const
The current id in the iteration.
virtual ~section_space_schema_member()
Destructor; deletes a poset member and its attached state, if any.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
virtual size_t size() const =0
The number of bytes in this dof.
subposet & evaluation()
The evaluation subposet for section spaces on this schema (mutable version).
A client handle for a general, abstract partially order set.
bool contains_range_member(const scoped_index &xbase_space_id, const scoped_index &xfiber_schema_id, bool xauto_access) const
True if this poset contains a member with base space id xbase_space_id and fiber schema id xfiber_sch...
virtual void update_table_dof_descriptors() const
Update the table dof descriptors.
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 is_same_state(const poset_state_handle *xhost, pod_index_type xhub_id) const
True is this is attached to state with hub id xhub_id in host xhost.
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
virtual sheaf::primitive_type type() const =0
The primitive type index of the dof defined by this.
virtual bool host_is_ancestor_of(const poset_state_handle *other) const
True if other conforms to host.
virtual void get_read_access() const
Get read access to the state associated with this.
const scoped_index & index() const
The index of the component state this handle is attached to.
virtual void next()=0
Makes id() the next id in the iteration.
std::string name() const
A name for this.
bool is_factorable() const
True if this member is factorable into base space and fiber schema components.
static const std::string & static_class_name()
The name of this class.
bool same_scope(const scoped_index &xother) const
True if and only if this is in the same id space as xother.
Definition: scoped_index.h:464
virtual void update_table_dof_id_space() const
Updates table dof id space.
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
virtual size_t alignment() const =0
The alignment for this dof.
Abstract base class with useful features for all objects.
Definition: any.h:39
pod_index_type fiber_schema_id() const
The member id of the fiber schema component of this.
virtual section_space_schema_member & operator=(const abstract_poset_member &xother)
Assignment operator; attaches this to the same state as xother.
bool is_done() const
True if iteration is finished.
bool same_base_space(const section_space_schema_member &xother) const
True if this has the same base as xother.
primitive_type
Type ids for sheaf primitives.
virtual void attach_handle_data_members()
Initializes the handle data members when this handle is attached to a state.
A client handle for a mutable partially ordered set.
Definition: poset.h:40
virtual pod_index_type get_ext_id(const std::string &xid_space_name) const
Gets an external id corresponding to index() in the id space with name xid_space_name. /.
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
virtual bool is_attached() const
True if this handle is attached to a non-void state.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
static std::string intersection_id_space_name(const subposet &xsp, const pod_index_type xhub_id)
The name of the id space for intersection of xsp with the down set of the member with hub id xhub_id...
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. ...
bool same_fiber_schema(const section_space_schema_member &xother) const
True if this has the same fiber schema as xother.
std::string name(pod_index_type xdof_id, bool xis_table_dof) const
The name of the table dof (xis_table_dof true) or row dof referred to by xdof_id in the schema define...
void reserve(size_type xcapacity)
Reserve enough memory for xcapacity number of ids.
int discretization_ct() const
The number of members in the intersection of the discretization subposet and the down set of the base...
void put(const index_space_handle &xid_space, pod_type xpod)
Set the scope to id space, xid_space and pod() to xpod.
Definition: scoped_index.h:332
An array for storing structs which describe the size, alignment, and offset of dofs within a dof tupl...
std::string evaluator_family_name() const
The name of the evaluator family for section spaces on schemae hosted by this.
subposet & discretization()
The discretization subposet for section spaces on this schema (mutable version).
virtual std::string name() const
The name of this poset.
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
Definition: any.h:97
section_space_schema_member()
Default constructor; creates a new, unattached section_space_schema_member handle. Intended for use only by descendants.
bool same_discretization(const section_space_schema_member &xother) const
True if this has the same discretization as xother.
virtual void to_stream(std::ostream &xos=std::cout) const
Virtual stream insertion.
bool contains_dof(const schema_poset_member &xother, bool xin_table_dofs) const
True if xother is a dof in the table dofs part (xin_table_dofs == true) or in the row dofs part (xin_...
virtual bool invariant() const
Class invariant.
size_type fiber_size() const
The number of bytes in the fiber.
const index_space_handle & fiber_schema_id_space(bool xis_table_dofs) const
The id space for the dofs in the down set of the fiber schema of this.
virtual bool is_ancestor_of(const any *other) const
True if other conforms to this.
An abstract schema poset for a section space. A Cartesian product subspace of the tensor product of a...
virtual void detach_from_state()
Detach this handle from its state, if any.
total_poset_member & base_space()
The base space component of this (mutable version).
poset_state_handle & fiber_schema()
The fiber schema for section spaces on this schema (mutable version).
const index_space_handle & discretization_id_space() const
The id space for the discretization members in the down set of the base space of this (const version)...
size_type component_size(pod_index_type xfiber_dof_id) const
The number of bytes in the component referred to by xfiber_dof_id.
void ordinal(const scoped_index &xbase_space_id, const scoped_index &xfiber_schema_id, scoped_index &xindex) const
The ordinal conversion from base space id xbase_space_id and fiber schema id xfiber_schema_id to sect...
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
poset & fiber_space()
The fiber space for section spaces on this schema (mutable version).
std::string member_name() const
The member name part of the path.
Definition: poset_path.cc:511
bool same_rep(const section_space_schema_member &xother) const
True if this has the same rep as xother.
int evaluation_ct() const
The number of members in the intersection of the evaluation subposet and the down set of the base spa...
A handle for a scattered_insertion_index_space_state.
A client handle for a poset member which has been prepared for use as a schema for a section space...
int db() const
The dimension of the base space component.
bool same_evaluation(const section_space_schema_member &xother) const
True if this has the same evaluation as xother.
void push_back(const scoped_index &xhub_id)
Make the next id in this space equivalent to xhub_id in the hub id space. synonym for push_back(xhub_...
int df() const
The dimension of the fiber space component.
An abstract client handle for a member of a poset.
sec_rep_descriptor & rep()
The representation for section spaces on this schema (mutable version).
virtual schema_poset_member & unrestricted_schema()
The unrestricted schema for this poset member (mutable version).
virtual schema_poset_member & schema()
The schema for this member (mutable version).
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
Definition: pod_types.cc:37
Namespace for the fiber_bundles component of the sheaf system.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
Definition: pod_types.cc:31
virtual void attach_to_state(pod_index_type xbase_space_id, pod_index_type xfiber_schema_id)=0
Attach to the state in host() with component ids xbase_id and xfiber_schema_id.
void enable_invariant_check() const
Enable invariant checking.
Definition: any.h:87
A client handle for a poset member which has been prepared for use as a schema.
pod_type hub_pod() const
The current unglued hub id in the iteration. synonym for unglued_hub_pod().
A client handle for an unrestricted member of a poset. A total_poset_member is guaranteed not to be r...
virtual size_type offset(pod_index_type xdof_id, bool xis_table_dof) const
The offset for the table dof (xis_table_dof true) or row dof referred to by xdof_id in the schema def...
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const binary_index &xbi)
Insert binary_index& xbi into ostream& os.
Definition: binary_index.cc:35
base_space_poset & base_space()
The base space for section spaces on this schema.
A description for a section representation scheme.
virtual const scoped_index & member_id(bool xauto_access) const
An id in the member hub id space; intended for copying to initialize ids to the member id space...
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
Definition: scoped_index.h:710
pod_index_type base_space_id() const
The member id of the base space component of this.