SheafSystem  0.0.0.0
section_space_schema_member.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/arg_list.h"
24 #include "SheafSystem/assert_contract.h"
25 #include "SheafSystem/array_index_space_handle.h"
26 #include "SheafSystem/array_index_space_state.h"
27 #include "SheafSystem/base_space_member.h"
28 #include "SheafSystem/binary_section_space_schema_member.impl.h"
29 #include "SheafSystem/binary_section_space_schema_poset.h"
30 #include "SheafSystem/discretization_iterator.h"
31 #include "SheafSystem/ij_product_structure.h"
32 #include "SheafSystem/index_space_iterator.h"
33 #include "SheafSystem/scattered_insertion_index_space_handle.h"
34 #include "SheafSystem/namespace_poset.h"
35 #include "SheafSystem/postorder_member_iterator.h"
36 #include "SheafSystem/postorder_itr.h"
37 #include "SheafSystem/preorder_itr.h"
38 #include "SheafSystem/sec_rep_descriptor.h"
39 #include "SheafSystem/section_component_iterator.h"
40 #include "SheafSystem/section_dof_iterator.h"
41 #include "SheafSystem/section_space_schema_jims_index_space_handle.h"
42 #include "SheafSystem/section_space_schema_jims_index_space_state.h"
43 #include "SheafSystem/section_space_schema_poset.h"
44 #include "SheafSystem/sheaves_namespace.h"
45 #include "SheafSystem/std_set.h"
46 #include "SheafSystem/wsv_block.h"
47 
48 
49 using namespace std;
50 using namespace fiber_bundle; // Workaround for MS C++ bug.
51 
52 // ===========================================================
53 // HOST FACTORY FACET
54 // ===========================================================
55 
56 // PUBLIC MEMBER FUNCTIONS
57 
58 
59 const sheaf::poset_path&
62 {
63  // Preconditions:
64 
65 
66  // Body:
67 
68  static const poset_path result("section_space_schema_schema", "section_space_schema_schema");
69 
70  // Postconditions:
71 
72  ensure(result.full());
73 
74  // Exit:
75 
76  return result;
77 }
78 
79 
80 void
83 {
84  // Preconditions:
85 
86  require(xns.state_is_read_write_accessible());
87  require(xns.contains_poset(standard_schema_path(), false));
88  require(xns.member_poset(standard_schema_path(), false).state_is_read_write_accessible());
89  require(!xns.contains_poset_member(standard_schema_path(), false));
90 
91  // Body:
92 
93  string ldof_specs;
94 
95  // Row dofs are same as row dofs of primitives:
96 
97  ldof_specs = "size SIZE_TYPE false";
98  ldof_specs += " alignment SIZE_TYPE false";
99  ldof_specs += " type POD_INDEX_TYPE false";
100 
101  // Table dofs:
102 
103  ldof_specs += " rep_path C_STRING true";
104  ldof_specs += " base_space_path C_STRING true";
105  ldof_specs += " fiber_space_path C_STRING true";
106 
107  schema_poset_member lschema(xns,
108  standard_schema_path().member_name(),
109  poset_path(standard_schema_path().member_name(), "bottom"),
110  ldof_specs,
111  false);
112 
113  lschema.detach_from_state();
114 
115  // Postconditions:
116 
117  ensure(xns.contains_poset_member(standard_schema_path()));
118 
119  // Exit
120 
121  return;
122 }
123 
124 
125 // PROTECTED MEMBER FUNCTIONS
126 
127 // PRIVATE MEMBER FUNCTIONS
128 
129 
130 // ===========================================================
131 // SECTION_SPACE_SCHEMA_MEMBER FACET
132 // ===========================================================
133 
134 // PUBLIC MEMBER FUNCTIONS
135 
136 const std::string&
138 class_name() const
139 {
140  // Preconditions:
141 
142  // Body:
143 
144  const string& result = static_class_name();
145 
146  // Postconditions:
147 
148  ensure(!result.empty());
149 
150  // Exit:
151 
152  return result;
153 }
154 
155 const std::string&
158 {
159  // Preconditions:
160 
161  // Body:
162 
163  static const string result("section_space_schema_member");
164 
165  // Postconditions:
166 
167  ensure(!result.empty());
168 
169  // Exit:
170 
171  return result;
172 }
173 
174 std::string
176 standard_member_name(const std::string& xfiber_schema_member_name,
177  const std::string& xbase_member_name)
178 {
179  // Preconditions:
180 
181  require(poset_path::is_valid_name(xfiber_schema_member_name));
182  require(poset_path::is_valid_name(xbase_member_name));
183 
184  // Body:
185 
186  string result(xfiber_schema_member_name);
187  result += "_on_";
188  result += xbase_member_name;
189 
190  // Postconditions:
191 
192  ensure(poset_path::is_valid_name(result));
193 
194  // Exit:
195 
196  return result;
197 }
198 
202 {
203  // Preconditions:
204 
205  // Body:
206 
207  attach_to_state(&xother);
208 
209  // Postconditions:
210 
211  ensure(is_same_state(&xother));
212 
213  // Exit
214 
215  return *this;
216 }
217 
221 {
222 
223  // Preconditions:
224 
225  require(is_ancestor_of(&xother));
226 
227  //Body:
228 
229  not_implemented();
230 
231  //Postconditions:
232 
233  ensure(invariant());
234 
235  //Exit:
236 
237  return *this;
238 }
239 
242 {
243 
244  // Preconditions:
245 
246  // Body:
247 
248  if(_discretization_id_space != 0)
249  {
250  _discretization_id_space->release_id_space();
251  }
252 
253  // Postconditions:
254 
255  // Exit
256 
257  return;
258 }
259 
263 {
264  // Preconditions:
265 
266  require(is_attached());
267 
268  // Body:
269 
270  sec_rep_descriptor& result = host()->rep();
271 
272  // Postconditions:
273 
274  // Exit
275 
276  return result;
277 }
278 
281 rep() const
282 {
283  // Preconditions:
284 
285  require(is_attached());
286 
287  // Body:
288 
289  sec_rep_descriptor& result = host()->rep();
290 
291  // Postconditions:
292 
293  // Exit
294 
295  return result;
296 }
297 
298 bool
301 {
302  bool result;
303 
304  // Preconditions:
305 
306  require(is_attached());
307  require(xother.is_attached());
308 
309  // Body:
310 
311  result = rep().is_same_state(&xother.rep());
312 
313  // Postconditions:
314 
315 
316  // Exit:
317 
318  return result;
319 }
320 
324 {
325  return _base_space_id;
326 }
327 
328 void
331 {
332  // Preconditions:
333 
334  // Body:
335 
336  result.put(_base_space.hub_id_space(), _base_space_id);
337 
338  // Postconditions:
339 
340  ensure(result.same_scope(base_space().hub_id_space()));
341 
342  // Exit:
343 
344  return;
345 }
346 
350 {
351  return _base_space;
352 }
353 
356 base_space() const
357 {
358  return _base_space;
359 }
360 
361 bool
364 {
365  bool result;
366 
367  // Preconditions:
368 
369  require(is_attached());
370  require(xother.is_attached());
371 
372  // Body:
373 
374  result = base_space().is_same_state(&xother.base_space());
375 
376  // Postconditions:
377 
378 
379  // Exit:
380 
381  return result;
382 }
383 
387 {
388  return _fiber_schema_id;
389 }
390 
391 void
394 {
395  // Preconditions:
396 
397  // Body:
398 
399  result.put(_fiber_schema.hub_id_space(), _fiber_schema_id);
400 
401  // Postconditions:
402 
403  ensure(result.same_scope(fiber_schema().hub_id_space()));
404 
405  // Exit:
406 
407  return;
408 }
409 
413 {
414  return _fiber_schema;
415 }
416 
420 {
421  return _fiber_schema;
422 }
423 
424 bool
427 {
428  bool result;
429 
430  // Preconditions:
431 
432  require(is_attached());
433  require(xother.is_attached());
434 
435  // Body:
436 
437  result = fiber_schema().is_same_state(&xother.fiber_schema());
438 
439  // Postconditions:
440 
441 
442  // Exit:
443 
444  return result;
445 }
446 
447 
451 {
452  // Preconditions:
453 
454  require(is_attached());
455 
456  // Body:
457 
458  poset& result = host()->fiber_space();
459 
460  // Postconditions:
461 
462  // Exit
463 
464  return result;
465 }
466 
467 const sheaf::poset&
469 fiber_space() const
470 {
471  // Preconditions:
472 
473  require(is_attached());
474 
475  // Body:
476 
477  poset& result = host()->fiber_space();
478 
479  // Postconditions:
480 
481  // Exit
482 
483  return result;
484 }
485 
486 int
488 db() const
489 {
490  int result;
491 
492  // Preconditions:
493 
494  require(base_space().state_is_read_accessible());
495 
496  // Body:
497 
498  if(!row_cache_consistent())
499  {
500  update_row_cache();
501  }
502 
503  result = _db;
504 
505  // Postconditions:
506 
507  ensure(result >= 0);
508 
509  // Exit
510 
511  return result;
512 }
513 
514 int
517 {
518  int result;
519 
520  // Preconditions:
521 
522  // Body:
523 
524  if(!row_cache_consistent())
525  {
526  update_row_cache();
527  }
528 
529  result = _evaluation_ct;
530 
531  // Postconditions:
532 
533  ensure(result >= 0);
534 
535  // Exit
536 
537  return result;
538 }
539 
540 int
543 {
544  int result;
545 
546  // Preconditions:
547 
548  require(state_is_read_accessible());
549 
550  // Body:
551 
552  if(!row_cache_consistent())
553  {
554  update_row_cache();
555  }
556 
557  result = _discretization_ct;
558 
559  // Postconditions:
560 
561  ensure(result >= 0);
562 
563  // Exit
564 
565  return result;
566 }
567 
568 int
570 df() const
571 {
572  int result;
573 
574  // Preconditions:
575 
576  require(state_is_read_accessible());
577 
578  // Body:
579 
580  result = fiber_schema().row_dof_ct();
581 
582  // Postconditions:
583 
584  ensure(result >= 0);
585 
586  // Exit
587 
588  return result;
589 }
590 
591 int
593 df(bool xauto_access)
594 {
595  int result;
596 
597  // Preconditions:
598 
599  require(state_is_auto_read_accessible(xauto_access));
600 
601  // Body:
602 
603  if(xauto_access)
604  {
605  get_read_access();
606  }
607 
608  result = df();
609 
610  if(xauto_access)
611  {
612  release_access();
613  }
614 
615  // Postconditions:
616 
617  ensure(result >= 0);
618 
619  // Exit
620 
621  return result;
622 }
623 
627 {
628  // Preconditions:
629 
630  // Body:
631 
632  subposet& result = host()->discretization();
633 
634  // Postconditions:
635 
636  // Exit
637 
638  return result;
639 }
640 
641 const sheaf::subposet&
644 {
645  // Preconditions:
646 
647  // Body:
648 
649  subposet& result = host()->discretization();
650 
651  // Postconditions:
652 
653  // Exit
654 
655  return result;
656 }
657 
658 bool
661 {
662  bool result;
663 
664  // Preconditions:
665 
666  require(is_attached());
667  require(xother.is_attached());
668 
669  // Body:
670 
671  result = discretization().is_same_state(&xother.discretization());
672 
673  // Postconditions:
674 
675 
676  // Exit:
677 
678  return result;
679 }
680 
681 bool
684 {
685  // Preconditions:
686 
687  // Body:
688 
689  bool result = host()->is_multivalued();
690 
691  // Postconditions:
692 
693  // Exit:
694 
695  return result;
696 }
697 
701 {
702  // Preconditions:
703 
704  // Body:
705 
706  subposet& result = host()->multivalued();
707 
708  // Postconditions:
709 
710  // Exit
711 
712  return result;
713 }
714 
715 const sheaf::subposet&
717 multivalued() const
718 {
719  // Preconditions:
720 
721  // Body:
722 
723  subposet& result = host()->multivalued();
724 
725  // Postconditions:
726 
727  // Exit
728 
729  return result;
730 }
731 
735 {
736  // Preconditions:
737 
738  // Body:
739 
740  subposet& result = host()->evaluation();
741 
742  // Postconditions:
743 
744  // Exit
745 
746  return result;
747 }
748 
749 const sheaf::subposet&
751 evaluation() const
752 {
753  // Preconditions:
754 
755  // Body:
756 
757  subposet& result = host()->evaluation();
758 
759  // Postconditions:
760 
761  // Exit
762 
763  return result;
764 }
765 
766 bool
769 {
770  bool result;
771 
772  // Preconditions:
773 
774  require(is_attached());
775  require(xother.is_attached());
776 
777  // Body:
778 
779  result = evaluation().is_same_state(&xother.evaluation());
780 
781  // Postconditions:
782 
783 
784  // Exit:
785 
786  return result;
787 }
788 
792 {
793  section_component_iterator* result = 0;
794 
795  // Preconditions:
796 
797  require(state_is_read_accessible());
798 
799  // Body:
800 
801  // This member is conceptually abstract in this class and intended
802  // to be redefined in descendants. Implemented only to
803  // define the pre- and post-conditions.
804 
805  not_implemented();
806 
807  // Postconditions:
808 
809  ensure(result != 0);
810 
811  // Exit
812 
813  return result;
814 }
815 
816 std::string
819 {
820 
821  // Preconditions:
822 
823  require(is_attached());
824 
825  // Body:
826 
827  string result = rep().evaluator_family_name();
828 
829  // Postconditions:
830 
831  // Exit
832 
833  return result;
834 }
835 
836 std::string
839 {
840  // Preconditions:
841 
842  require(xsp.state_is_read_accessible());
843  require(!xsp.name().empty());
844 
845  // Body:
846 
847  string result;
848 
849  if(xhub_id == TOP_INDEX)
850  {
851  result = xsp.name();
852  }
853  else
854  {
855  result = poset_path::make_reserved_name("", xhub_id,
856  xsp.name() + "_id_space");
857  }
858 
859  // Postconditions:
860 
861  ensure(!result.empty());
862 
863  // Exit:
864 
865  return result;
866 }
867 
868 std::string
871 {
872  // Preconditions:
873 
874  require(xsp.state_is_read_accessible());
875  require(!xsp.name().empty());
876  require(xid.in_scope());
877 
878  // Body:
879 
880  string result = intersection_id_space_name(xsp, xid.hub_pod());
881 
882  // Postconditions:
883 
884  ensure(!result.empty());
885 
886  // Exit:
887 
888  return result;
889 }
890 
893 dof_iterator(bool xis_table_dofs, int xversion) const
894 {
895  section_dof_iterator* result = 0;
896 
897  // Preconditions:
898 
899  require(state_is_read_accessible());
900  require(has_version(xversion));
901 
902  // Body:
903 
904  // This member is conceptually abstract in this class and intended
905  // to be redefined in descendants. Implemented only to
906  // define the pre- and post- conditions.
907 
908  // Postconditions:
909 
910  ensure(result != 0);
911 
912  // Exit
913 
914  return result;
915 }
916 
917 bool
919 conforms_to(const schema_poset_member& xother, bool xis_table_dofs) const
920 {
921  bool result;
922 
923  // Preconditions:
924 
925  require(state_is_read_accessible());
926  require(is_ancestor_of(&xother));
927 
928  // Body:
929 
930  // The dofs defined by this must agree in type and in order
931  // with those defined by xother. For section_space_schema,
932  // this obviously requires that the host, rep, and version
933  // of this be the same as those of xother. In addition,
934  // the fiber schema of this must exactly match the fiber
935  // schema of xother and the initial part of the traversal of this
936  // discretization must match the traversal of the xother
937  // discretization. The only practical way to ensure this
938  // is to require the base space of this and xother to be
939  // exactly the same. Hence, section_space_schema only
940  // conform if they are identical.
941 
942  result = is_same_state(&xother);
943 
944  // Postconditions:
945 
946  // Exit
947 
948  return result;
949 }
950 
951 bool
954  const poset_path& xpath,
955  const poset_path& xfiber_schema_path,
956  bool xauto_access)
957 {
958  bool result;
959 
960  // Preconditions:
961 
962  require(!xauto_access ? xns.state_is_read_accessible() : true);
963  require(xpath.full());
964  require(xns.contains_poset_member(xpath));
965 
967 
968  require(dynamic_cast<binary_section_space_schema_poset*>(&xns.member_poset(xpath)) != 0);
969  require(!xauto_access ?
971  true);
972 
973  require(xns.contains_poset_member(xfiber_schema_path));
974  require(!xauto_access ?
975  xns.member_poset(xfiber_schema_path).state_is_read_accessible() :
976  true);
977 
978 
979  // Body:
980 
981 
982  if(xauto_access)
983  {
984  xns.get_read_access();
985  xns.member_poset(xpath).get_read_access();
986  xns.member_poset(xfiber_schema_path).get_read_access();
987  }
988 
989  binary_section_space_schema_member lschema(const_cast<namespace_poset&>(xns), xpath);
990 
991  result = schema_poset_member::conforms_to(xns,
992  lschema.fiber_schema().path(),
993  xfiber_schema_path,
994  false);
995 
996  lschema.detach_from_state();
997 
998  if(xauto_access)
999  {
1000  xns.release_access();
1001  xns.member_poset(xpath).release_access();
1002  xns.member_poset(xfiber_schema_path).release_access();
1003  }
1004 
1005  // Postconditions:
1006 
1007  // Exit
1008 
1009  return result;
1010 }
1011 
1012 // PROTECTED MEMBER FUNCTIONS
1013 
1016 {
1017 
1018  // Preconditions:
1019 
1020  // Body:
1021 
1022  // The following invalidate calls are not really neccessary but serve
1023  // to make things clearer.
1024 
1025  _base_space_id = invalid_pod_index();
1026  _fiber_schema_id = invalid_pod_index();
1027 
1028  _discretization_id_space = 0;
1029 
1030  // Postconditions:
1031 
1032  ensure(invariant());
1033  ensure(!is_attached() );
1034 
1035  ensure(!is_valid(base_space_id()));
1036  ensure(!is_valid(fiber_schema_id()));
1037 
1038  ensure(!base_space().is_attached());
1039  ensure(!fiber_schema().is_attached());
1040 
1041  // Exit:
1042 }
1043 
1044 void
1046 make_schema_info(bool xis_table_dof)
1047 {
1048  // Preconditions:
1049 
1050  require(state_is_read_write_accessible());
1051 
1052  // Body:
1053 
1055 
1056  not_implemented();
1057 
1058  // Postconditions:
1059 
1060  ensure(unexecutable(schema info initialized));
1061 
1062  // Exit
1063 
1064  return;
1065 }
1066 
1067 void
1070 {
1071  // Preconditions:
1072 
1073  require(state_is_read_accessible());
1074 
1075  // Body:
1076 
1077  // Initialize inherited data members
1078 
1079  schema_poset_member::attach_handle_data_members();
1080 
1081  // Compute the component member ids.
1082 
1083  _base_space_id = host()->get_base_space_id_from_index(_index.pod());
1084  _fiber_schema_id = host()->get_fiber_schema_id_from_index(_index.pod());
1085 
1086  // Attach the component handles
1087 
1088  _base_space.attach_to_state(&(host()->base_space()), _base_space_id);
1089  _fiber_schema.attach_to_state(&(host()->fiber_schema()), _fiber_schema_id);
1090 
1093 
1094  _base_space.put_version(_version, false);
1095 
1096  // Postconditions:
1097 
1098  ensure(base_space().is_attached());
1099  ensure(fiber_schema().is_attached());
1100 
1101  // Exit
1102 
1103  return;
1104 }
1105 
1106 void
1109 {
1110  // Preconditions:
1111 
1112  require(state_is_read_accessible());
1113 
1114  // Body:
1115 
1116  base_space_poset& lbase_host = host()->base_space();
1117  const subposet& leval_sp = evaluation();
1118  const subposet& ldisc_sp = discretization();
1119  const subposet& ljims_sp = lbase_host.jims();
1120 
1121  // Get the disc ct from the id space.
1122 
1123  _discretization_ct = _discretization_id_space->ct();
1124 
1125  // Try to get evaluation_ct from eval id space.
1126 
1127  string leval_id_space_name = intersection_id_space_name(leval_sp, _base_space_id);
1128  if(lbase_host.member_id_spaces(false).contains(leval_id_space_name))
1129  {
1130  _evaluation_ct = lbase_host.member_id_spaces(false).ct(leval_id_space_name);
1131  }
1132  else
1133  {
1134  _evaluation_ct = 0;
1135 
1136  unordered_set_postorder_itr itr(_base_space, DOWN, NOT_STRICT);
1137  while(!itr.is_done())
1138  {
1139  pod_index_type lindex = itr.index().pod();
1140 
1141  if(leval_sp.contains_member(lindex))
1142  {
1143  _evaluation_ct++;
1144  }
1145 
1146  itr.next();
1147  }
1148  }
1149 
1150  // Get db from the base space.
1151 
1152  _db = lbase_host.db(_base_space.index());
1153 
1154  // Postconditions:
1155 
1156  // Exit
1157 
1158  return;
1159 }
1160 
1161 void
1164 {
1165  // Preconditions:
1166 
1167  require(state_is_read_accessible());
1168  require(host()->base_space().state_is_read_write_accessible());
1169  require(discretization().has_id_space());
1170 
1171  // Body:
1172 
1173  base_space_poset& lbase_host = host()->base_space();
1174  const subposet& leval_sp = evaluation();
1175  const subposet& ldisc_sp = discretization();
1176  const subposet& ljims_sp = lbase_host.jims();
1177 
1178  // Traverse the down set; count the eval and disc members and find
1179  // the maximum dimension and client id.
1180 
1181  _db = 0;
1182  _evaluation_ct = 0;
1183  _discretization_ct = 0;
1184 
1185  // This schema is either new or changed, so we need
1186  // to (re)build the sequence id space.
1187 
1188  // Refiners extend client id space; so we need to maintain same order.
1189  // Do this in two steps:
1190 
1191  // First: find the disc members in the down set of the base and
1192  // store their client ids in a set, which will keep them
1193  // sorted in order.
1194 
1195  set<scoped_index::pod_type> ltop_seq_ids;
1196  const index_space_handle& ltop_space = ldisc_sp.id_space();
1197 
1198  unordered_set_postorder_itr itr(_base_space, DOWN, NOT_STRICT);
1199  while(!itr.is_done())
1200  {
1201  const scoped_index& lindex = itr.index();
1202 
1203  if(ljims_sp.contains_member(lindex))
1204  {
1205  int ldb = lbase_host.member_dof_tuple(lindex)->db;
1206 
1207  _db = (ldb > _db) ? ldb : _db;
1208  }
1209 
1210  if(leval_sp.contains_member(lindex))
1211  {
1212  _evaluation_ct++;
1213  }
1214 
1215  if(ldisc_sp.contains_member(lindex))
1216  {
1217  _discretization_ct++;
1218  ltop_seq_ids.insert(ltop_space.pod(lindex));
1219  }
1220 
1221  itr.next();
1222  }
1223 
1224  // Second: iterate over the set and define the new seq id space.
1225  // The new space will contain a subset of the members in the
1226  // original client id space in the same relative order as the original.
1227 
1228  assertion(dynamic_cast<scattered_insertion_index_space_handle*>(_discretization_id_space) != 0);
1229 
1230  scattered_insertion_index_space_handle* ldisc_id_space =
1231  reinterpret_cast<scattered_insertion_index_space_handle*>(_discretization_id_space);
1232 
1233  ldisc_id_space->clear();
1234  ldisc_id_space->reserve(_discretization_ct);
1235 
1236  set<pod_index_type>::iterator lseq_id_itr;
1237  for(lseq_id_itr = ltop_seq_ids.begin();
1238  lseq_id_itr != ltop_seq_ids.end();
1239  ++lseq_id_itr)
1240  {
1241  ldisc_id_space->push_back(ltop_space.hub_pod(*lseq_id_itr));
1242  }
1243 
1244  // Postconditions:
1245 
1246  // Exit:
1247 
1248  return;
1249 }
1250 
1251 void
1254 {
1255  // Preconditions:
1256 
1257  // Body:
1258 
1259  const index_space_handle& lfiber_schema_id_space =
1260  fiber_schema().row_dof_id_space();
1261 
1262  if(_host->member_id_spaces(false).contains(row_dof_subposet_name()))
1263  {
1264  // Row dof id space already exists, set the factors.
1265 
1266  _row_dof_id_space =
1267  &_host->member_id_spaces(false).get_id_space(row_dof_subposet_name());
1268 
1270  (_row_dof_id_space)->put_factors(*_discretization_id_space,
1271  lfiber_schema_id_space,
1272  host()->product_structure());
1273  }
1274  else
1275  {
1276  // Create the row dof id space.
1277 
1279  section_space_schema_jims_index_space_state::new_space(_host->member_id_spaces(false),
1280  row_dof_subposet_name(),
1281  *_discretization_id_space,
1282  lfiber_schema_id_space,
1283  host()->product_structure());
1284 
1285  _row_dof_id_space = &lrow_dof_id_space.get_id_space();
1286  }
1287 
1288  // Postconditions:
1289 
1290  // Exit
1291 
1292  return;
1293 }
1294 
1295 // PRIVATE MEMBER FUNCTIONS
1296 
1297 
1298 // ===========================================================
1299 // SCHEMA_POSET_MEMBER FACET
1300 // ===========================================================
1301 
1302 // PUBLIC MEMBER FUNCTIONS
1303 
1304 bool
1307  pod_index_type xfiber_id,
1308  bool xin_table_dofs) const
1309 {
1310  bool result;
1311 
1312  // Preconditions:
1313 
1314  require(state_is_read_accessible());
1315 
1316  // Body:
1317 
1318  pod_index_type l_id = host()->get_index_from_components(xbase_id, xfiber_id);
1319  result = contains_dof(l_id, xin_table_dofs);
1320 
1321  // Postconditions:
1322 
1323  // Exit
1324 
1325  return result;
1326 }
1327 
1328 bool
1330 contains_dof(const scoped_index& xbase_id,
1331  const scoped_index& xfiber_id,
1332  bool xin_table_dofs) const
1333 {
1334  bool result;
1335 
1336  // Preconditions:
1337 
1338  require(state_is_read_accessible());
1339 
1340  // Body:
1341 
1342  return contains_dof(xbase_id.hub_pod(), xfiber_id.hub_pod());
1343 }
1344 
1345 // PROTECTED MEMBER FUNCTIONS
1346 
1347 void
1350 {
1351  // Preconditions:
1352 
1353  require(state_is_read_accessible());
1354 
1355  // Body:
1356 
1357  if(!host()->member_id_spaces(false).contains(table_dof_subposet_name()))
1358  {
1359  // Create the table dof id space.
1360 
1361  array_index_space_handle ltable_dof_id_space =
1362  array_index_space_state::new_space(host()->member_id_spaces(false),
1363  table_dof_subposet_name(),
1364  false, 0);
1365 
1366  _table_dof_id_space = &ltable_dof_id_space.get_id_space();
1367 
1368  // Populate the table dof id map.
1369 
1370  // The table dofs of the section space schema are the same as
1371  // the table dofs of the fiber space schema and map into
1372  // the section space schema id space as (base bottom, fiber schema mbr).
1373 
1375  // Assume base space id is first index, fiber schema id is second.
1376 
1377  ltable_dof_id_space.reserve(fiber_schema().table_dof_id_space().ct());
1378 
1379  index_space_iterator& litr =
1380  fiber_schema().table_dof_id_space().get_iterator();
1381  while(!litr.is_done())
1382  {
1383  // Iterating over the ids of the fiber schema table dof id space
1384  // in host (poset) order.
1385 
1386  ltable_dof_id_space.insert(litr.pod(), litr.hub_pod());
1387 
1388  litr.next();
1389  }
1390  fiber_schema().table_dof_id_space().release_iterator(litr);
1391  }
1392  else
1393  {
1394  _table_dof_id_space =
1395  &host()->member_id_spaces(false).get_id_space(table_dof_subposet_name());
1396  }
1397 
1398  schema_poset_member::update_table_cache();
1399 
1400  // Postconditions:
1401 
1402  // Exit
1403 
1404  return;
1405 }
1406 
1407 void
1409 update_row_cache(bool xupdate_id_space) const
1410 {
1411  // Preconditions:
1412 
1413  require(state_is_read_accessible()); // see error below
1414 
1415  // Body:
1416 
1417  base_space_poset& lbase_host = host()->base_space();
1418 
1419  // Declare an enum for determining what needs updated.
1420 
1421  enum update_type
1422  {
1423  only_row_cache, // Update only the row cache counts.
1424  only_row_dof_id_space, // Update the row cache counts and row dof id space.
1425  all_id_spaces // Update the row cache counts, discretization id space, and row dof id space.
1426  };
1427 
1428  update_type lupdate = xupdate_id_space ? all_id_spaces : only_row_cache;
1429 
1432 
1433  lbase_host.get_read_write_access(true);
1434 
1435  // Release old discretization handle if one was set.
1436 
1437  if(_discretization_id_space != 0)
1438  {
1439  _discretization_id_space->release_id_space();
1440  }
1441 
1444 
1445  string ldisc_id_space_name =
1446  intersection_id_space_name(discretization(), _base_space_id);
1447 
1448  // Assign the discretization id space.
1449 
1450  if(lbase_host.member_id_spaces(false).contains(ldisc_id_space_name))
1451  {
1452  _discretization_id_space =
1453  &lbase_host.member_id_spaces(false).get_id_space(ldisc_id_space_name);
1454 
1455  if((lupdate == all_id_spaces) &&
1456  (*_discretization_id_space == discretization().id_space()))
1457  {
1458  // The user requested that all the id spaces be update but since
1459  // the this member's discretization id space is the same as the
1460  // discretization id space of the host, only update the row id space.
1461 
1462  lupdate = only_row_dof_id_space;
1463  }
1464  }
1465  else
1466  {
1467  // Create the discretization id space.
1468 
1469  array_index_space_handle ldiscretization_id_space =
1470  array_index_space_state::new_space(lbase_host.member_id_spaces(false),
1471  ldisc_id_space_name,
1472  discretization().is_persistent(),
1473  0);
1474 
1475  _discretization_id_space = &ldiscretization_id_space.get_id_space();
1476 
1477  if(lupdate == only_row_cache)
1478  {
1479  // The discretization id space was created, update the discretization
1480  // id space and the row dof id space.
1481 
1482  lupdate = all_id_spaces;
1483  }
1484  }
1485 
1486  // Make sure a row dof id space is created.
1487 
1488  if((lupdate == only_row_cache) &&
1489  !_host->member_id_spaces(false).contains(row_dof_subposet_name()))
1490  {
1491  lupdate = only_row_dof_id_space;
1492  }
1493 
1494  // Update the row cache and any id spaces needed.
1495 
1496  switch(lupdate)
1497  {
1498  case only_row_cache:
1499  update_row_cache_without_disc_id_space();
1500  break;
1501 
1502  case only_row_dof_id_space:
1503  update_row_cache_without_disc_id_space();
1504  update_row_dof_id_space();
1505  break;
1506 
1507  case all_id_spaces:
1508  update_row_cache_with_disc_id_space();
1509  update_row_dof_id_space();
1510  break;
1511  }
1512 
1513  lbase_host.release_access();
1514 
1515  // Postconditions:
1516 
1517  // Exit
1518 
1519  return;
1520 }
1521 
1522 // PRIVATE MEMBER FUNCTIONS
1523 
1524 
1525 // ===========================================================
1526 // NEW DOF ACCESS FACET
1527 // ===========================================================
1528 
1529 // PUBLIC MEMBER FUNCTIONS
1530 
1534 {
1535  // Preconditions:
1536 
1537  require(state_is_read_accessible());
1538 
1539  // Body:
1540 
1541  if(!row_cache_consistent())
1542  {
1543  update_row_cache();
1544  }
1545 
1546  const index_space_handle& result = *_discretization_id_space;
1547 
1548  // Postconditions:
1549 
1550 
1551  // Exit:
1552 
1553  return result;
1554 }
1555 
1558 discretization_id_space(bool xauto_access) const
1559 {
1560  // Preconditions:
1561 
1562  require(state_is_auto_read_accessible(xauto_access));
1563 
1564  // Body:
1565 
1566  if(xauto_access)
1567  {
1568  get_read_access();
1569  }
1570 
1571  if(!row_cache_consistent())
1572  {
1573  update_row_cache();
1574  }
1575 
1576  const index_space_handle& result = *_discretization_id_space;
1577 
1578  if(xauto_access)
1579  {
1580  release_access();
1581  }
1582 
1583  // Postconditions:
1584 
1585 
1586  // Exit:
1587 
1588  return result;
1589 }
1590 
1594 {
1595  // Preconditions:
1596 
1597  require(state_is_read_accessible());
1598 
1599  // Body:
1600 
1601  if(!row_cache_consistent())
1602  {
1603  update_row_cache();
1604  }
1605 
1606  index_space_handle& result = *_discretization_id_space;
1607 
1608  // Postconditions:
1609 
1610 
1611  // Exit:
1612 
1613  return result;
1614 }
1615 
1618 discretization_id_space(bool xauto_access)
1619 {
1620  // Preconditions:
1621 
1622  require(state_is_auto_read_accessible(xauto_access));
1623 
1624  // Body:
1625 
1626  if(xauto_access)
1627  {
1628  get_read_access();
1629  }
1630 
1631  if(!row_cache_consistent())
1632  {
1633  update_row_cache();
1634  }
1635 
1636  index_space_handle& result = *_discretization_id_space;
1637 
1638  if(xauto_access)
1639  {
1640  release_access();
1641  }
1642 
1643  // Postconditions:
1644 
1645 
1646  // Exit:
1647 
1648  return result;
1649 }
1650 
1653 fiber_schema_id_space(bool xis_table_dofs) const
1654 {
1655  // Preconditions:
1656 
1657  require(state_is_read_accessible());
1658 
1659  // Body:
1660 
1661  const index_space_handle& result = fiber_schema().dof_id_space(xis_table_dofs);
1662 
1663  // Postconditions:
1664 
1665 
1666  // Exit:
1667 
1668  return result;
1669 }
1670 
1673 fiber_schema_id_space(bool xis_table_dofs, bool xauto_access) const
1674 {
1675  // Preconditions:
1676 
1677  require(state_is_auto_read_accessible(xauto_access));
1678 
1679  // Body:
1680 
1681  const index_space_handle& result =
1682  fiber_schema().dof_id_space(xis_table_dofs, xauto_access);
1683 
1684  // Postconditions:
1685 
1686 
1687  // Exit:
1688 
1689  return result;
1690 }
1691 
1692 
1695 size(pod_index_type xdof_id, bool xis_table_dofs) const
1696 {
1697  // Preconditions:
1698 
1699  require(state_is_read_accessible());
1700  require(xis_table_dofs ? fiber_schema_id_space(xis_table_dofs).contains(xdof_id) : true);
1701 
1702  // Body:
1703 
1704  pod_index_type lfiber_dof_id = xdof_id;
1705 
1706  if(!xis_table_dofs)
1707  {
1708  pod_index_type ldisc_id;
1709  row_dof_id_space().product_structure<ij_product_structure>().
1710  tuple(xdof_id, ldisc_id, lfiber_dof_id);
1711  }
1712 
1713  size_type result = fiber_schema().size(lfiber_dof_id, xis_table_dofs);
1714 
1715  // Postconditions:
1716 
1717 
1718  // Exit:
1719 
1720  return result;
1721 }
1722 
1725 size(pod_index_type xdisc_id, pod_index_type xfiber_dof_id, bool xis_table_dof) const
1726 {
1727  // Preconditions:
1728 
1729  require(state_is_read_accessible());
1730  require(fiber_schema_id_space(xis_table_dof).contains(xfiber_dof_id));
1731 
1732  // Body:
1733 
1734  size_type result = fiber_schema().size(xfiber_dof_id, xis_table_dof);
1735 
1736  // Postconditions:
1737 
1738 
1739  // Exit:
1740 
1741  return result;
1742 }
1743 
1746 size(const scoped_index& xdisc_id,
1747  const scoped_index& xfiber_dof_id,
1748  bool xis_table_dof,
1749  bool xauto_access) const
1750 {
1751  // Preconditions:
1752 
1753  require(state_is_read_accessible());
1754  require(fiber_schema_id_space(xis_table_dof, xauto_access).contains(xfiber_dof_id));
1755 
1756  // Body:
1757 
1758  size_type result = fiber_schema().size(xfiber_dof_id, xis_table_dof, xauto_access);
1759 
1760  // Postconditions:
1761 
1762 
1763  // Exit:
1764 
1765  return result;
1766 }
1767 
1770 alignment(pod_index_type xdof_id, bool xis_table_dofs) const
1771 {
1772  // Preconditions:
1773 
1774  require(state_is_read_accessible());
1775  require(xis_table_dofs ? fiber_schema_id_space(xis_table_dofs).contains(xdof_id) : true);
1776 
1777  // Body:
1778 
1779  pod_index_type lfiber_dof_id = xdof_id;
1780 
1781  if(!xis_table_dofs)
1782  {
1783  pod_index_type ldisc_id;
1784  row_dof_id_space().product_structure<ij_product_structure>().
1785  tuple(xdof_id, ldisc_id, lfiber_dof_id);
1786  }
1787 
1788  size_type result = fiber_schema().alignment(lfiber_dof_id, xis_table_dofs);
1789 
1790  // Postconditions:
1791 
1792 
1793  // Exit:
1794 
1795  return result;
1796 }
1797 
1800 alignment(pod_index_type xdisc_id, pod_index_type xfiber_dof_id, bool xis_table_dof) const
1801 {
1802  // Preconditions:
1803 
1804  require(state_is_read_accessible());
1805  require(fiber_schema_id_space(xis_table_dof).contains(xfiber_dof_id));
1806 
1807  // Body:
1808 
1809  size_type result = fiber_schema().alignment(xfiber_dof_id, xis_table_dof);
1810 
1811  // Postconditions:
1812 
1813 
1814  // Exit:
1815 
1816  return result;
1817 }
1818 
1821 alignment(const scoped_index& xdisc_id,
1822  const scoped_index& xfiber_dof_id,
1823  bool xis_table_dof,
1824  bool xauto_access) const
1825 {
1826  // Preconditions:
1827 
1828  require(state_is_read_accessible());
1829  require(fiber_schema_id_space(xis_table_dof, xauto_access).contains(xfiber_dof_id));
1830 
1831  // Body:
1832 
1833  size_type result =
1834  fiber_schema().alignment(xfiber_dof_id, xis_table_dof, xauto_access);
1835 
1836  // Postconditions:
1837 
1838 
1839  // Exit:
1840 
1841  return result;
1842 }
1843 
1846 type(pod_index_type xdof_id, bool xis_table_dofs) const
1847 {
1848  // Preconditions:
1849 
1850  require(state_is_read_accessible());
1851  require(xis_table_dofs ? fiber_schema_id_space(xis_table_dofs).contains(xdof_id) : true);
1852 
1853  // Body:
1854 
1855  pod_index_type lfiber_dof_id = xdof_id;
1856 
1857  if(!xis_table_dofs)
1858  {
1859  pod_index_type ldisc_id;
1860  row_dof_id_space().product_structure<ij_product_structure>().
1861  tuple(xdof_id, ldisc_id, lfiber_dof_id);
1862  }
1863 
1864  primitive_type result = fiber_schema().type(lfiber_dof_id, xis_table_dofs);
1865 
1866  // Postconditions:
1867 
1868 
1869  // Exit:
1870 
1871  return result;
1872 }
1873 
1876 type(pod_index_type xdisc_id, pod_index_type xfiber_dof_id, bool xis_table_dof) const
1877 {
1878  // Preconditions:
1879 
1880  require(state_is_read_accessible());
1881  require(fiber_schema_id_space(xis_table_dof).contains(xfiber_dof_id));
1882 
1883  // Body:
1884 
1885  primitive_type result = fiber_schema().type(xfiber_dof_id, xis_table_dof);
1886 
1887  // Postconditions:
1888 
1889 
1890  // Exit:
1891 
1892  return result;
1893 }
1894 
1897 type(const scoped_index& xdisc_id,
1898  const scoped_index& xfiber_dof_id,
1899  bool xis_table_dof,
1900  bool xauto_access) const
1901 {
1902  // Preconditions:
1903 
1904  require(state_is_read_accessible());
1905  require(fiber_schema_id_space(xis_table_dof, xauto_access).contains(xfiber_dof_id));
1906 
1907  // Body:
1908 
1909  primitive_type result =
1910  fiber_schema().type(xfiber_dof_id, xis_table_dof, xauto_access);
1911 
1912  // Postconditions:
1913 
1914 
1915  // Exit:
1916 
1917  return result;
1918 }
1919 
1922 offset(pod_index_type xdof_id, bool xis_table_dof) const
1923 {
1924  size_type result;
1925 
1926  // Preconditions:
1927 
1928  require(state_is_read_accessible());
1929  require(xis_table_dof ? fiber_schema_id_space(xis_table_dof).contains(xdof_id) : true);
1930 
1931  // Body:
1932 
1933  if(xis_table_dof)
1934  {
1935  result = fiber_schema().offset(xdof_id, true);
1936  }
1937  else
1938  {
1939  pod_index_type lfiber_dof_id, ldisc_id;
1940  row_dof_id_space().product_structure<ij_product_structure>().
1941  tuple(xdof_id, ldisc_id, lfiber_dof_id);
1942 
1943  result = offset(ldisc_id, lfiber_dof_id, false);
1944  }
1945 
1946 
1947  // Postconditions:
1948 
1949 
1950  // Exit:
1951 
1952  return result;
1953 }
1954 
1957 offset(pod_index_type xdisc_id, pod_index_type xfiber_dof_id, bool xis_table_dof) const
1958 {
1959  // Preconditions:
1960 
1961  require(state_is_read_accessible());
1962  require(fiber_schema_id_space(xis_table_dof).contains(xfiber_dof_id));
1963 
1964  // Body:
1965 
1966  size_type result;
1967 
1968  if(xis_table_dof)
1969  {
1970  result = fiber_schema().offset(xfiber_dof_id, true);
1971  }
1972  else
1973  {
1974  result = fiber_size()*xdisc_id + fiber_schema().offset(xfiber_dof_id, false);
1975  }
1976 
1977  // Postconditions:
1978 
1979 
1980  // Exit:
1981 
1982  return result;
1983 }
1984 
1987 offset(const scoped_index& xdisc_id,
1988  const scoped_index& xfiber_dof_id,
1989  bool xis_table_dof,
1990  bool xauto_access) const
1991 {
1992  // Preconditions:
1993 
1994  require(state_is_read_accessible());
1995  require(fiber_schema_id_space(xis_table_dof, xauto_access).contains(xfiber_dof_id));
1996 
1997  // Body:
1998 
1999  if(xauto_access)
2000  {
2001  get_read_access();
2002  }
2003 
2004  pod_index_type ldisc_id = _discretization_id_space->pod(xdisc_id);
2005  pod_index_type lfiber_dof_id =
2006  fiber_schema_id_space(xis_table_dof).pod(xfiber_dof_id);
2007 
2008  size_type result = offset(ldisc_id, lfiber_dof_id, xis_table_dof);
2009 
2010  if(xauto_access)
2011  {
2012  release_access();
2013  }
2014 
2015  // Postconditions:
2016 
2017 
2018  // Exit:
2019 
2020  return result;
2021 }
2022 
2025 fiber_size() const
2026 {
2027  // Preconditions:
2028 
2029  require(state_is_read_accessible());
2030 
2031  // Body:
2032 
2033  size_type result = fiber_schema().dof_tuple_ub(false);
2034 
2035  // Postconditions:
2036 
2037 
2038  // Exit:
2039 
2040  return result;
2041 }
2042 
2045 fiber_size(bool xauto_access) const
2046 {
2047  // Preconditions:
2048 
2049  require(state_is_auto_read_accessible(xauto_access));
2050 
2051  // Body:
2052 
2053  if(xauto_access)
2054  {
2055  get_read_access();
2056  }
2057 
2058  size_type result = fiber_size();
2059 
2060  if(xauto_access)
2061  {
2062  release_access();
2063  }
2064 
2065  // Postconditions:
2066 
2067 
2068  // Exit:
2069 
2070  return result;
2071 }
2072 
2075 component_size(pod_index_type xfiber_dof_id) const
2076 {
2077  // Preconditions:
2078 
2079  require(state_is_read_accessible());
2080  require(fiber_schema_id_space(false).contains(xfiber_dof_id));
2081 
2082  // Body:
2083 
2084  if(!row_cache_consistent())
2085  {
2086  update_row_cache();
2087  }
2088 
2089  size_type result =
2090  fiber_schema().size(xfiber_dof_id, false)*_discretization_ct;
2091 
2092  // Postconditions:
2093 
2094 
2095  // Exit:
2096 
2097  return result;
2098 }
2099 
2102 component_size(const scoped_index& xfiber_dof_id, bool xauto_access) const
2103 {
2104  // Preconditions:
2105 
2106  require(state_is_auto_read_accessible(xauto_access));
2107  require(fiber_schema_id_space(false, xauto_access).contains(xfiber_dof_id));
2108 
2109  // Body:
2110 
2111  if(xauto_access)
2112  {
2113  get_read_access();
2114  }
2115 
2116  pod_index_type lfiber_dof_id =
2117  fiber_schema_id_space(false).pod(xfiber_dof_id);
2118  size_type result = component_size(lfiber_dof_id);
2119 
2120  if(xauto_access)
2121  {
2122  release_access();
2123  }
2124 
2125  // Postconditions:
2126 
2127 
2128  // Exit:
2129 
2130  return result;
2131 }
2132 
2133 // PROTECTED MEMBER FUNCTIONS
2134 
2135 // PRIVATE MEMBER FUNCTIONS
2136 
2137 
2138 // ===========================================================
2139 // I/O SUPPORT FACET
2140 // ===========================================================
2141 
2142 // PUBLIC MEMBER FUNCTIONS
2143 
2146 get_ext_id(const std::string& xid_space_name) const
2147 {
2148  // Preconditions:
2149 
2150  require(state_is_read_accessible());
2151 
2154 
2155  // Can't support the following precondition:
2156 
2157  // require(precondition_of(host()->get_ext_id(index(), xid_space_name)));
2158 
2159  // Instead:
2160 
2161  require(precondition_of(host()->base_space().get_ext_id(base_space_id(), xid_space_name)));
2162 
2168 
2169  require(host()->base_space().is_explicit_member(base_space_id()) ||
2170  host()->base_space().is_block_member(base_space_id()));
2171 
2172  // Body:
2173 
2174  pod_index_type result =
2175  host()->base_space().get_ext_id(base_space_id(), xid_space_name, false);
2176 
2177  // Postconditions:
2178 
2179  ensure(result >= 0);
2180 
2181  // Exit:
2182 
2183  return result;
2184 }
2185 
2186 // PROTECTED MEMBER FUNCTIONS
2187 
2188 // PRIVATE MEMBER FUNCTIONS
2189 
2190 
2194 {
2195  // Preconditions:
2196 
2197  require(state_is_read_accessible());
2198 
2199  // Body:
2200 
2201  // Memebers of this class don't have dof tuples,
2202  // so the unrestricted schema is always the schema of the host.
2203 
2204  schema_poset_member& result = host()->schema();
2205 
2206  // Postconditions:
2207 
2208  ensure(result.is_same_state(&(host()->schema())));
2209 
2210  // Exit
2211 
2212  return result;
2213 }
2214 
2218 {
2219  // Preconditions:
2220 
2221  require(state_is_read_accessible());
2222 
2223  // Body:
2224 
2225  // Memebers of this class don't have dof tuples,
2226  // so the unrestricted schema is always the schema of the host.
2227 
2228  const schema_poset_member& result = host()->schema();
2229 
2230  // Postconditions:
2231 
2232  ensure(result.is_same_state(&(host()->schema())));
2233 
2234  // Exit
2235 
2236  return result;
2237 }
2238 
2239 // PROTECTED MEMBER FUNCTIONS
2240 
2241 // PRIVATE MEMBER FUNCTIONS
2242 
2243 // ===========================================================
2244 // DOWN SET FACET
2245 // ===========================================================
2246 
2247 // PUBLIC MEMBER FUNCTIONS
2248 
2249 int
2251 down_ct(pod_index_type xfilter_index) const
2252 {
2253  int result = 0;
2254 
2255  // Preconditions:
2256 
2257  // Body:
2258 
2259  result = base_space().down_ct() * fiber_schema().down_ct();
2260 
2261  // Postconditions:
2262 
2263  ensure(result > 0 );
2264 
2265  // Exit
2266 
2267  return result;
2268 }
2269 
2272 down() const
2273 {
2274  subposet* result;
2275 
2276  // Preconditions:
2277 
2278  require(state_is_read_write_accessible());
2279 
2280  // Body:
2281 
2282  not_implemented();
2283 
2284  result = new subposet(host());
2285  down_pa(result);
2286 
2287 
2288  // Postconditions:
2289 
2290  require(result != 0);
2291  require(postcondition_of(down_pa));
2292 
2293  // Exit
2294 
2295  return result;
2296 }
2297 
2298 void
2300 down_pa(subposet* result) const
2301 {
2302 
2303  // Preconditions:
2304 
2305  // Body:
2306 
2307  not_implemented();
2308 
2309 
2310  // Postconditions:
2311 
2312  ensure(result->invariant());
2313  ensure(unexecutable(result is down set
2314  of this));
2315 
2316  // Exit
2317 
2318  return;
2319 }
2320 
2321 int
2323 up_ct(pod_index_type xfilter_index) const
2324 {
2325  int result = 0;
2326 
2327  // Preconditions:
2328 
2329  // Body:
2330 
2331  result = base_space().up_ct() * fiber_schema().up_ct();
2332 
2333  // Postconditions:
2334 
2335  ensure(result > 0 );
2336 
2337  // Exit
2338 
2339  return result;
2340 }
2341 
2344 up() const
2345 {
2346  subposet* result;
2347 
2348  // Preconditions:
2349 
2350  require(state_is_read_write_accessible());
2351 
2352  // Body:
2353 
2354  not_implemented();
2355 
2356  result = new subposet(host());
2357  up_pa(result);
2358 
2359  // Postconditions:
2360 
2361  ensure(result != 0);
2362  ensure(postcondition_of(up_pa));
2363 
2364  // Exit
2365 
2366  return result;
2367 }
2368 
2369 void
2371 up_pa(subposet* result) const
2372 {
2373 
2374  // Preconditions:
2375 
2376  // Body:
2377 
2378  // Traverse up set, inserting members into result
2379 
2381 
2382  not_implemented();
2383 
2384  // Postconditions:
2385 
2386  ensure(result->invariant());
2387  ensure(unexecutable(result is up set
2388  of this));
2389 
2390  // Exit
2391 
2392  return;
2393 }
2394 
2395 int
2397 jim_ct() const
2398 {
2399  int result = 0;
2400 
2401  // Preconditions:
2402 
2403  // Body:
2404 
2405  result = base_space().jim_ct() * fiber_schema().jim_ct();
2406 
2407  // Postconditions:
2408 
2409  ensure(is_jem(&(host()->bottom())) ? result == 0 : result > 0 );
2410 
2411  // Exit
2412 
2413  return result;
2414 }
2415 
2419 {
2420  subposet* result;
2421 
2422  // Preconditions:
2423 
2424  require(state_is_read_write_accessible());
2425 
2426  // Body:
2427 
2428  not_implemented();
2429 
2430  result = new subposet(host());
2431  jims_pa(result);
2432 
2433 
2434  // Postconditions:
2435 
2436  ensure(result != 0);
2437  ensure(postcondition_of(jims_pa));
2438 
2439  // Exit
2440 
2441  return result;
2442 }
2443 
2444 void
2447 {
2448 
2449  // Preconditions:
2450 
2451  require(state_is_read_write_accessible());
2452 
2453  // Body:
2454 
2455  not_implemented();
2456 
2457  // Postconditions:
2458 
2459  ensure(result->invariant());
2460  ensure(unexecutable(result is jims set
2461  of this));
2462 
2463  // Exit
2464 
2465  return;
2466 }
2467 
2468 int
2471 {
2472  int result = 0;
2473 
2474  // Preconditions:
2475 
2476  // Body:
2477 
2478  result = base_space().maximal_jim_ct() * fiber_schema().maximal_jim_ct();
2479 
2480  // Postconditions:
2481 
2482  ensure(is_jem(&(host()->bottom())) ? result == 0 : result > 0 );
2483 
2484  // Exit
2485 
2486  return result;
2487 }
2488 
2489 
2493 {
2494  subposet* result;
2495 
2496  // Preconditions:
2497 
2498  require(state_is_read_write_accessible());
2499 
2500  // Body:
2501 
2502  not_implemented();
2503 
2504  result = new subposet(host());
2505  maximal_jims_pa(result);
2506 
2507 
2508  // Postconditions:
2509 
2510  ensure(has_same_host(result));
2511  ensure(postcondition_of(maximal_jims_pa));
2512 
2513  // Exit
2514 
2515  return result;
2516 }
2517 
2518 void
2521 {
2522  // Preconditions:
2523 
2524  require(has_same_host(result));
2525 
2526  // Body:
2527 
2528  not_implemented();
2529 
2530  // Postconditions:
2531 
2532  ensure(result->invariant());
2533  ensure(unexecutable(result is union of maximal_jims of this with old result));
2534 
2535  // Exit
2536 
2537  return;
2538 }
2539 
2540 // PROTECTED MEMBER FUNCTIONS
2541 
2542 // PRIVATE MEMBER FUNCTIONS
2543 
2544 
2545 // ===========================================================
2546 // POSET ALGEBRA FACET
2547 // ===========================================================
2548 
2549 // PUBLIC MEMBER FUNCTIONS
2550 
2551 void
2554 {
2555  // Preconditions:
2556 
2557  require(has_same_host(other));
2558  require(!result->is_attached());
2559  // this precondition ensures the attachment below will not
2560  // leave an orphan temporary in the poset
2561  require(result->is_ancestor_of(this));
2562  require(state_is_read_accessible());
2563 
2564  // Body:
2565 
2566  not_implemented();
2567 
2568  // Postconditions:
2569 
2570  ensure(unexecutable(result is least upper bound in host of this and other));
2571 
2572  // Exit
2573 
2574  return;
2575 }
2576 
2577 void
2580 {
2581  // Preconditions:
2582 
2583  require(has_same_host(other));
2584  require(!result->is_attached());
2585  // this precondition ensures the attachment below will not
2586  // leave an orphan temporary in the poset
2587  require(result->is_ancestor_of(this));
2588  require(state_is_read_accessible());
2589 
2590  // Body:
2591 
2592  not_implemented();
2593 
2594  // Postconditions:
2595 
2596  ensure(unexecutable(result is least upper bound in host of this and other));
2597 
2598  // Exit
2599 
2600  return;
2601 }
2602 
2603 // PROTECTED MEMBER FUNCTIONS
2604 
2605 // PRIVATE MEMBER FUNCTIONS
2606 
2607 
2608 // ===========================================================
2609 // COMPONENT INDEX FACET
2610 // ===========================================================
2611 
2612 // PUBLIC MEMBER FUNCTIONS
2613 
2614 void
2616 put_version(int xversion, bool xunalias)
2617 {
2618  // Preconditions:
2619 
2620  require(state_is_read_accessible());
2621  require(has_version(xversion));
2622  require(!xunalias ? xversion != CURRENT_MEMBER_VERSION : true);
2623 
2624  // Body:
2625 
2626  schema_poset_member::put_version(xversion, xunalias);
2627 
2630 
2631  _base_space.put_version(xversion, xunalias);
2632 
2633  // Postconditions:
2634 
2635  ensure(xunalias ?
2636  version(false) == unaliased_version(xversion) :
2637  version(false) == xversion);
2638 
2639  // Exit
2640 
2641  return;
2642 }
2643 
2644 // PROTECTED MEMBER FUNCTIONS
2645 
2646 // PRIVATE MEMBER FUNCTIONS
2647 
2648 
2649 // ===========================================================
2650 // COMPONENT NAME FACET
2651 // ===========================================================
2652 
2653 // PUBLIC MEMBER FUNCTIONS
2654 
2655 // PROTECTED MEMBER FUNCTIONS
2656 
2657 void
2659 put_standard_name(bool xunique, bool xauto_access)
2660 {
2661  // Preconditions:
2662 
2663  require(is_attached());
2664  require(state_is_auto_read_write_accessible(xauto_access));
2665 
2666  // Body:
2667 
2668  string lname = standard_member_name(fiber_schema().name(true),
2669  base_space().name(true));
2670 
2671  put_name(lname, xunique, xauto_access);
2672 
2673  // Postconditions:
2674 
2675  ensure(xunique ?
2676  name(xauto_access) == standard_member_name(fiber_schema().name(true), base_space().name(true)) :
2677  has_name(standard_member_name(fiber_schema().name(true), base_space().name(true)), xauto_access));
2678 
2679  // Exit:
2680 
2681  return;
2682 }
2683 
2684 // PRIVATE MEMBER FUNCTIONS
2685 
2686 
2687 // ===========================================================
2688 // STATE FACET
2689 // ===========================================================
2690 
2691 // PUBLIC MEMBER FUNCTIONS
2692 
2693 void
2696  pod_index_type xfiber_schema_id)
2697 {
2698  // Preconditions:
2699 
2700  require(state_is_read_accessible());
2701  require(host()->base_space().contains_member(xbase_space_id));
2702  require(host()->fiber_schema().contains_member(xfiber_schema_id));
2703 
2704  // Body:
2705 
2706  is_abstract();
2707 
2708  // Postconditions:
2709 
2710  ensure(base_space_id() == xbase_space_id);
2711  ensure(base_space().is_attached());
2712  ensure(fiber_schema_id() == xfiber_schema_id);
2713  ensure(fiber_schema().is_attached());
2714 
2715  // Exit:
2716 
2717  return;
2718 }
2719 
2720 void
2722 attach_to_state(const scoped_index& xbase_space_id,
2723  const scoped_index& xfiber_schema_id)
2724 {
2725  // Preconditions:
2726 
2727  require(state_is_read_accessible());
2728  require(host()->base_space().contains_member(xbase_space_id));
2729  require(host()->fiber_schema().contains_member(xfiber_schema_id));
2730 
2731  // Body:
2732 
2733  attach_to_state(xbase_space_id.hub_pod(),
2734  xfiber_schema_id.hub_pod());
2735 
2736  // Postconditions:
2737 
2738  ensure(base_space_id() == xbase_space_id.hub_pod());
2739  ensure(base_space().is_attached());
2740  ensure(fiber_schema_id() == xfiber_schema_id.hub_pod());
2741  ensure(fiber_schema().is_attached());
2742 
2743  // Exit:
2744 
2745  return;
2746 }
2747 
2748 void
2751  pod_index_type xbase_space_id,
2752  pod_index_type xfiber_schema_id)
2753 {
2754  // Preconditions:
2755 
2756  require(xhost != 0);
2757  require(host_is_ancestor_of(xhost));
2758  require(xhost->state_is_read_accessible());
2759  require(xhost->base_space().contains_member(xbase_space_id));
2760  require(xhost->fiber_schema().contains_member(xfiber_schema_id));
2761 
2762  // Body:
2763 
2764  is_abstract();
2765 
2766  // Postconditions:
2767 
2768  ensure(base_space_id() == xbase_space_id);
2769  ensure(base_space().is_attached());
2770  ensure(fiber_schema_id() == xfiber_schema_id);
2771  ensure(fiber_schema().is_attached());
2772 
2773  // Exit:
2774  return;
2775 }
2776 
2777 void
2780  const scoped_index& xbase_space_id,
2781  const scoped_index& xfiber_schema_id)
2782 {
2783  // Preconditions:
2784 
2785  require(xhost != 0);
2786  require(host_is_ancestor_of(xhost));
2787  require(xhost->state_is_read_accessible());
2788  require(xhost->base_space().contains_member(xbase_space_id));
2789  require(xhost->fiber_schema().contains_member(xfiber_schema_id));
2790 
2791  // Body:
2792 
2793  attach_to_state(xhost,
2794  xbase_space_id.hub_pod(),
2795  xfiber_schema_id.hub_pod());
2796 
2797  // Postconditions:
2798 
2799  ensure(base_space_id() == xbase_space_id.hub_pod());
2800  ensure(base_space().is_attached());
2801  ensure(fiber_schema_id() == xfiber_schema_id.hub_pod());
2802  ensure(fiber_schema().is_attached());
2803 
2804  // Exit:
2805 
2806  return;
2807 }
2808 
2809 void
2812 {
2813  // Preconditions:
2814 
2815  // Body:
2816 
2817  _base_space.detach_from_state();
2818  _base_space_id = _base_space.index().pod();
2819  _fiber_schema.detach_from_state();
2820  _fiber_schema_id = _fiber_schema.index().pod();
2821 
2822  schema_poset_member::detach_from_state();
2823 
2824 
2825  // Postconditions:
2826 
2827  ensure(!is_attached());
2828  ensure(!base_space().is_attached());
2829  ensure(!fiber_schema().is_attached());
2830 
2831  // Exit
2832 
2833  return;
2834 }
2835 
2836 // PROTECTED MEMBER FUNCTIONS
2837 
2838 // PRIVATE MEMBER FUNCTIONS
2839 
2840 
2841 // ===========================================================
2842 // HOST POSET FACET
2843 // ===========================================================
2844 
2845 // PUBLIC MEMBER FUNCTIONS
2846 
2847 bool
2850 {
2851  bool result;
2852 
2853  // Preconditions:
2854 
2855  // Body:
2856 
2857  result = dynamic_cast<const section_space_schema_poset*>(xother) != 0;
2858 
2859  // Postconditions:
2860 
2861  // Exit
2862 
2863  return result;
2864 }
2865 
2866 // PROTECTED MEMBER FUNCTIONS
2867 
2868 // PRIVATE MEMBER FUNCTIONS
2869 
2870 
2871 // ===========================================================
2872 // ANY FACET
2873 // ===========================================================
2874 
2875 // PUBLIC MEMBER FUNCTIONS
2876 
2877 bool
2879 is_ancestor_of(const any* xother) const
2880 {
2881  bool result;
2882 
2883  // Preconditions:
2884 
2885  // Body:
2886 
2887  result = dynamic_cast<const section_space_schema_member*>(xother) != 0;
2888 
2889  // Postconditions:
2890 
2891  // Exit
2892 
2893  return result;
2894 }
2895 
2896 bool
2898 invariant() const
2899 {
2900  bool result = true;
2901 
2902  // Preconditions:
2903 
2904  // Body:
2905 
2906  // Must satisfy base class invariant
2907 
2908  invariance(schema_poset_member::invariant());
2909 
2910  if(invariant_check())
2911  {
2912  // Prevent recursive calls to invariant
2913 
2914  disable_invariant_check();
2915 
2916  // Invariants for this class:
2917 
2918  invariance(is_attached() == base_space().is_attached());
2919  invariance(is_attached() == fiber_schema().is_attached());
2920 
2923 
2924  // Finished, turn invariant checking back on.
2925 
2926  enable_invariant_check();
2927  }
2928 
2929  // Postconditions:
2930 
2931  // Exit
2932 
2933  return result;
2934 }
2935 
2936 // PROTECTED MEMBER FUNCTIONS
2937 
2938 // PRIVATE MEMBER FUNCTIONS
2939 
2940 
2941 // ===========================================================
2942 // DEBUGGING FACET
2943 // ===========================================================
2944 
2945 // PUBLIC MEMBER FUNCTIONS
2946 
2947 void
2949 to_stream(std::ostream& xos) const
2950 {
2951  // Preconditions:
2952 
2953 
2954  // Body:
2955 
2956  xos << *this;
2957 
2958  // Postconditions:
2959 
2960 
2961  // Exit:
2962 
2963  return;
2964 }
2965 
2966 // PROTECTED MEMBER FUNCTIONS
2967 
2968 // PRIVATE MEMBER FUNCTIONS
2969 
2970 
2971 // ===========================================================
2972 // NONMEMBER FUNCTIONS
2973 // ===========================================================
2974 
2975 std::ostream& fiber_bundle::operator << (std::ostream &os, section_space_schema_member& p)
2976 {
2977 
2978  // Preconditions:
2979 
2980  // Body:
2981 
2982  if (p.is_attached())
2983  {
2984  p.get_read_access();
2986  os << "member:"
2987  << " host = \'" << p.host()->name() << "\'"
2988  << " index = " << p.index().pod()
2989  << " name = \'" << p.name() << '\''
2990  << " version= " << p.version(false)
2991  << " unaliased version= " << p.version()
2992  << endl;
2993 
2994  os << "base: member index = " << p.base_space().index().hub_pod()
2995  << " '" << p.base_space().name() << "'"
2996  << " in poset '" << p.base_space().host()->name() << "'"
2997  << endl
2998  << "fiber space is poset '" << p.fiber_space().name() << "'"
2999  << endl;
3000 
3001  p.release_access();
3003 
3004  }
3005  else
3006  {
3007  os << "member: host = \'\'' index = -1 name = \'\''"
3008  << endl;
3009  }
3010 
3011  // Exit:
3012 
3013  return os;
3014 }
3015 
virtual void get_read_write_access(bool xrelease_read_only_access=false)
Get read write access to the state associated with this. If release_read_only_access is requested...
void put_standard_name(bool xunique, bool xauto_access)
Sets the name of this member to a standard name; if xunique, make xname the only name.
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
virtual void maximal_jims_pa(subposet *result) const
The maximal members of the set of jims contained in this member, pre-allocated.
An implementation of class explicit_index_space_handle that has a section space schema jims id space ...
bool is_done() const
True if iteration finished.
section_space_schema_poset * host() const
The poset which this is a handle to a component of.
int down_ct() const
The number of members in the down set of this member.
A client handle for a poset member which has been prepared for use as a schema for a section space...
virtual void jims_pa(subposet *result)
The set of jims contained in the down set of this member, pre-allocated.
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 const abstract_product_structure & product_structure() const =0
The product structure for this id space (const version).
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).
virtual subposet * up() const
The up set of this member, auto- and pre-allocated versions.
poset_path path(bool xauto_access=true) const
A path to this component.
pod_type pod() const
The current id in the iteration.
The default name space; a poset which contains other posets as members.
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.
bool is_persistent(const std::string &xname) const
True if the id space with name xname should be written to disk.
virtual void p_join_pa(abstract_poset_member *other, abstract_poset_member *result) const
Poset join of this with other, pre-allocated. The poset join is the least upper bound in the poset...
subposet & evaluation()
The evaluation subposet for section spaces on this schema (mutable version).
bool contains_poset_member(pod_index_type xposet_hub_id, pod_index_type xmember_hub_id, bool xauto_access=true) const
True if this contains a poset with hub id xposet_hub_id which contains a member with hub id xmember_h...
A client handle for a general, abstract partially order set.
Iterates in postorder over dofs of a schema member anchor. Attaches an a handle of type section_space...
index_space_handle & get_id_space(const std::string &xname) const
Allocates an id space handle from the handle pool attached to state with name xname.
virtual void update_row_cache(bool xupdate_id_space=false) const
Updates cached row properties.
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
const index_space_family & member_id_spaces(bool xauto_access) const
Collection of member id spaces for this (const version).
bool is_multivalued() const
Switch that tells the user if the multivalued subposet exists.
int up_ct() const
The number of members in the up set of this member.
virtual bool contains_member(pod_index_type xmbr_hub_id) const
True if this poset contains poset member with hub id xmbr_hub_id.
Definition: subposet.cc:955
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.
Specialization of the filtered depth-first iterator which exposes the POSTVISIT_ACTION to the client...
Definition: postorder_itr.h:40
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 void update_table_cache() const
Updates cached table properties.
virtual void make_schema_info(bool xis_table_dof)
Makes the table or row dof subposets, client id maps, and other schema info for 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.
poset_state_handle & member_poset(pod_index_type xhub_id, bool xauto_access=true) const
The poset_state_handle object referred to by hub id xhub_id.
virtual index_space_handle & get_id_space() const =0
Allocates an id space handle from the handle pool attached to the same id space.
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.
virtual subposet * maximal_jims()
The maximal members of the set of jims contained in this member, auto-allocated.
virtual section_dof_iterator * dof_iterator(bool xis_table_dofs, int xversion=CURRENT_MEMBER_VERSION) const
A postorder iterator over the table (xis_table_dofs == true) or row (xis_table_dofs == false) dofs de...
static const std::string & static_class_name()
The name of this class.
virtual int jim_ct() const
The number of members in the set of jims contained in the down set of this member.
virtual void up_pa(subposet *result) const
The up set of this member, auto- and pre-allocated versions.
virtual subposet * down() const
The down set of this member, auto- and pre-allocated versions.
const scoped_index & index() const
The index of the current member of the iteration.
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 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.
The lattice of closed cells of a cellular space; a lattice representation of a computational mesh...
virtual section_space_schema_member & operator=(const abstract_poset_member &xother)
Assignment operator; attaches this to the same state as xother.
const bool NOT_STRICT
Iteration strictness control.
Definition: sheaf.h:102
const bool DOWN
Iteration directions.
Definition: sheaf.h:77
bool is_done() const
True if iteration is finished.
virtual section_component_iterator * component_iterator() const
A postorder iterator over the components defined by this.
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 index_space_handle & get_id_space() const
Allocates an id space handle from the handle pool.
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
bool state_is_read_write_accessible() const
True if this is attached and if the state is accessible for read and write or access control is disab...
virtual bool invariant() const
Class invariant.
Definition: subposet.cc:2963
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. /.
virtual void detach_from_state()
Detach this handle from its state, if any.
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
virtual bool is_attached() const
True if this handle is attached to a non-void state.
An array implementation of class scattered_insertion_index_space_handle. This representation is inten...
virtual void get_read_access() const
Get read access to the state associated with this.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
virtual int maximal_jim_ct() const
The number of maximal members in the set of jims contained in the down set of this member...
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...
Iterates in postorder over components of a section_space_schema_member anchor. The components of a se...
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...
int db(pod_index_type xmbr_hub_id) const
The base space dimension of the member with hub id xmbr_hub_id.
void reserve(size_type xcapacity)
Reserve enough memory for xcapacity number of ids.
void insert(pod_type xid, const scoped_index &xhub_id)
Make id xid in this id space equivalent to xhub_id in the hub id space. synonym for insert(xid...
virtual bool is_ancestor_of(const any *other) const
True if other conforms to this.
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
void update_row_dof_id_space() const
Updates _row_dof_id_space.
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
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...
section_space_schema_member()
Default constructor; creates a new, unattached section_space_schema_member handle. Intended for use only by descendants.
virtual pod_type pod(pod_type xid) const =0
The pod index in this space equivalent to xid in the hub id space.
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 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.
void update_row_cache_with_disc_id_space() const
Updates row cache including _discretization_id_space.
virtual void put_version(int xversion, bool xunalias=false)
Sets version to (possibly aliased) xversion. If unalias == true, set version to the actual version al...
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_...
const scattered_insertion_index_space_handle & id_space() const
The id space for the members of with this (const version).
Definition: subposet.cc:508
virtual bool invariant() const
Class invariant.
pod_type hub_pod(pod_type xid) const
The pod index in the unglued hub id space equivalent to xid in this id space; synonym for unglued_hub...
void next()
Makes this the next member of the subset.
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.
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
void update_row_cache_without_disc_id_space() const
Updates row cache using existing _discretization_id_space.
A 2D implementation of abstract_product_structure.
poset & fiber_space()
The fiber space for section spaces on this schema (mutable version).
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...
bool contains(pod_type xid) const
True, if this contains an id space with id xid.
int db() const
The dimension of the base space component.
virtual subposet & jims()
The subset of all jims (mutable version)
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.
static std::string standard_member_name(const std::string &xfiber_schema_member_name, const std::string &xbase_member_name)
The standard member name for a schema with fiber schema member with name xfiber_schema_member_name an...
virtual void down_pa(subposet *result) const
The down set of this member, auto- and pre-allocated versions.
void tuple(pod_index_type x, size_type xj_ub, pod_index_type &xi, pod_index_type &xj)
Ordinal to 2-tuple conversion.
virtual void get_read_access() const
Get read access to the state associated with this.
An abstract client handle for a member of a poset.
sec_rep_descriptor & rep()
The representation for section spaces on this schema (mutable version).
size_type ct(const std::string &xname) const
The number of members for the id space with name xname.
virtual void p_meet_pa(abstract_poset_member *other, abstract_poset_member *result)
Poset meet of this with other, pre-allocated version. The poset meet is the greatest lower bound in t...
row_dof_tuple_type * member_dof_tuple(pod_index_type xmbr_hub_id, bool xrequire_write_access=false) const
The row dof tuple for the member with member hub id xmbr_hub_id.
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).
static bool fiber_schema_conforms_to(const namespace_poset &xns, const poset_path &xpath, const poset_path &xfiber_schema_path, bool xauto_access=true)
True if the fiber schema associated with xpath conforms to xfiber_schema_path.
virtual subposet * jims()
The set of jims contained in the down set of this member, auto-allocated.
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
static const poset_path & standard_schema_path()
The path of the schema required by this class.
A client handle for a poset member which has been prepared for use as a schema.
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...
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...
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
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.
subposet & multivalued()
The multivalued subposet for section spaces on this schema (mutable version).
A description for a section representation scheme.
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.