SheafSystem  0.0.0.0
product_section_space_schema_poset.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/product_section_space_schema_poset.h"
22 
23 #include "SheafSystem/abstract_poset_member.impl.h"
24 #include "SheafSystem/arg_list.h"
25 #include "SheafSystem/array_poset_dof_map.h"
26 #include "SheafSystem/ij_product_structure.h"
27 #include "SheafSystem/index_iterator.h"
28 #include "SheafSystem/list_cover_set.h"
29 #include "SheafSystem/error_message.h"
30 #include "SheafSystem/index_space_iterator.h"
31 #include "SheafSystem/namespace_poset.impl.h"
32 #include "SheafSystem/namespace_poset_member.h"
33 #include "SheafSystem/pod_types.h"
34 #include "SheafSystem/poset_handle_factory.h"
35 #include "SheafSystem/poset_member_iterator.h"
36 #include "SheafSystem/poset_state.h"
37 #include "SheafSystem/product_section_space_schema_crg_range.h"
38 #include "SheafSystem/product_section_space_schema_member.impl.h"
39 #include "SheafSystem/schema_descriptor.h"
40 #include "SheafSystem/section_space_schema_table_dofs_type.h"
41 #include "SheafSystem/section_space_schema_table_dof_crg_range.h"
42 #include "SheafSystem/std_limits.h"
43 #include "SheafSystem/wsv_block.h"
44 
45 using namespace std;
46 using namespace fiber_bundle; // Workaround for MS C++ bug.
47 
48 // ===========================================================
49 // PRODUCT_SECTION_SPACE_SCHEMA_POSET FACET
50 // ===========================================================
51 
52 // PUBLIC FUNCTIONS
53 
56 make_arg_list(const poset_path& xrep_path,
57  const poset_path& xbase_space_path,
58  const poset_path& xfiber_space_path)
59 {
60  // Preconditions:
61 
62 
63  // Body:
64 
65  sheaf::arg_list result;
66 
67  result << "rep_path" << xrep_path
68  << "base_space_path" << xbase_space_path
69  << "fiber_space_path" << xfiber_space_path;
70 
71 
72 #ifdef DIAGNOSTIC_OUTPUT
73  cout << "product_section_space_schema_poset::make_arg_list:result: " << result << endl;
74 #endif
75 
76  // Postconditions:
77 
78  ensure(unexecutable("result.conforms_to(schema of this class)"));
79  ensure(result.value("rep_path") == xrep_path);
80  ensure(result.value("base_space_path") == xbase_space_path);
81  ensure(result.value("fiber_space_path") == xfiber_space_path);
82 
83  // Exit:
84 
85  return result;
86 }
87 
90  const std::string& xname,
91  const arg_list& xargs,
92  const poset_path& xschema_path,
93  bool xauto_access)
94 
97 {
98 
99  // Preconditions:
100 
101  require(precondition_of(new_state(same args)));
102 
103  // Body:
104 
105  // Make the new state.
106 
107  new_state(xns, xname, xargs, xschema_path, xauto_access);
108 
109  // Postconditions:
110 
111  ensure(postcondition_of(new_state(same args)));
112 }
113 
114 // PROTECTED FUNCTIONS
115 
120 {
121  // Preconditions:
122 
123  // Body:
124 
125  // Nothing to do, handled by base class
126 
127  // Postconditions:
128 
129  ensure(!is_attached());
130  ensure(!top().is_attached());
131  ensure(!bottom().is_attached());
132 }
133 
138 {
139  // Preconditions:
140 
141  // Body:
142 
143  *this = xother;
144 
145  // Postconditions:
146 
147  ensure(is_same_state(&xother));
148 }
149 
152 {
153  // Preconditions:
154 
155  // Body:
156 
157  // Nothing to do; base class does it all.
158  // Currently, this routine exists mostly for the precondition,
159  // which is the same as poset_state_handle::~poset_state_handle.
160  // With this precondition in place, the source of a precondition
161  // violation will be clearer to the client.
162 
163  // Postconditions:
164 
165  // Exit
166 
167  return;
168 }
169 
170 void
173  const std::string& xname,
174  arg_list& xargs,
175  const poset_path& xschema_path,
176  bool xauto_access)
177 {
178  // Preconditions:
179 
180  require(xns.state_is_auto_read_accessible(xauto_access));
181 
182  require(!xschema_path.empty());
183  require(xns.path_is_auto_read_accessible(xschema_path, xauto_access));
184  require(xschema_path.conforms_to(xns, standard_schema_path(), xauto_access));
185 
186  require(xns.arg_is_auto_read_accessible("rep_path", xargs, xauto_access));
187  require(xns.arg_is_auto_read_accessible("base_space_path", xargs, xauto_access));
188  require(xns.arg_is_auto_read_accessible("fiber_space_path", xargs, xauto_access));
189 
190  // Body:
191 
192  // Nothing to do.
193 
194  // Done.
195 
196 #ifdef DIAGNOSTIC_OUTPUT
197  cout << "product_section_space_schema_poset::initialize_arg_list:xargs: " << endl
198  << xargs << endl;
199 #endif
200 
201  // Postconditions:
202 
203  // Exit:
204 
205  return;
206 }
207 
211 {
212  // Preconditions:
213 
214  // Body:
215 
217 
218  // Postconditions:
219 
220  ensure(is_basic_query);
221 
222  // Exit:
223 
224  return result;
225 }
226 
227 void
230 {
231  // Preconditions:
232 
233  require(state_is_read_accessible());
234  require(base_space().is_attached());
235  require(fiber_schema().is_attached());
236 
237  // Body:
238 
239  // Create the row dof subposet.
240 
241  row_dof_subposet().new_state(this);
243 
244  index_space_iterator& ldisc_itr =
246  index_space_iterator& lfiber_itr =
248 
249  pod_index_type lid;
250 
251  while(!ldisc_itr.is_done())
252  {
253  lfiber_itr.reset();
254 
255  while(lfiber_itr.is_done())
256  {
257  ordinal(ldisc_itr.hub_pod(), lfiber_itr.hub_pod(), lid);
258 
260 
261  lfiber_itr.next();
262  }
263 
264  ldisc_itr.next();
265  }
266 
269 
270  // Postconditions:
271 
272  ensure(row_dof_subposet().is_attached());
273 
274  // Exit:
275 
276  return;
277 }
278 
282 {
283  // Preconditions:
284 
285  // Body:
286 
287  // Postconditions:
288 
289  ensure(is_basic_query);
290 
291  // Exit:
292 
293  return *_table_dof_range;
294 }
295 
296 void
299 {
300  // Preconditions:
301 
302  // Body:
303 
304  _table_dof_range = &xtable_dof_range;
305 
306  // Postconditions:
307 
308  // Exit:
309 
310  return;
311 }
312 
316 {
317  // Preconditions:
318 
319  // Body:
320 
321  // Postconditions:
322 
323  ensure(is_basic_query);
324 
325  // Exit:
326 
327  return *_product_range;
328 }
329 
330 void
333 {
334  // Preconditions:
335 
336  // Body:
337 
338  _product_range = &xproduct_range;
339 
340  // Postconditions:
341 
342  // Exit:
343 
344  return;
345 }
346 
347 bool
350 {
351  // Preconditions:
352 
353  // Body:
354 
355  poset_type ltype = PRODUCT_SECTION_SPACE_SCHEMA_POSET_ID;
356 
359 
360  factory().insert_prototype(lproto);
361  factory().insert_prototype(ltype, lproto);
362 
363  // Postconditions:
364 
365  // Exit:
366 
367  return true;
368 }
369 
370 // PRIVATE FUNCTIONS
371 
372 
373 // ===========================================================
374 // SECTION_SPACE_SCHEMA_POSET FACET
375 // ===========================================================
376 
377 // PUBLIC FUNCTIONS
378 
379 const sheaf::poset_path&
382 {
383  // Preconditions:
384 
385  // Body:
386 
387  static const poset_path
388  result(standard_schema_poset_name(), "product_section_space_schema_schema");
389 
390  // Postconditions:
391 
392  ensure(result.full());
393  ensure(result.poset_name() == standard_schema_poset_name());
394 
395  // Exit:
396 
397  return result;
398 }
399 
400 void
403 {
404  // Preconditions:
405 
406  require(xns.state_is_read_write_accessible());
407  require(xns.contains_poset(standard_schema_poset_name(), false));
409  require(!xns.contains_poset_member(standard_schema_path(), false));
410 
411  // Body:
412 
413  // This class doesn't add any dofs.
414 
415  schema_poset_member lschema(xns,
418  "",
419  false,
420  false);
421 
422  lschema.detach_from_state();
423 
424  // Postconditions:
425 
427 
428  // Exit
429 
430  return;
431 }
432 
433 void
436  pod_index_type& xbase_space_id,
437  pod_index_type& xfiber_schema_id) const
438 {
439  // Preconditions:
440 
441  require(state_is_read_accessible());
442  require(is_homogeneous(xindex));
443 
444  // Body:
445 
446  if(_product_range->contains_member(xindex))
447  {
448  _product_range->tuple(xindex, xbase_space_id, xfiber_schema_id);
449  }
450  else
451  {
452  _table_dof_range->tuple(xindex, xbase_space_id, xfiber_schema_id);
453  }
454 
455  // Postconditions:
456 
457  ensure(contains_range_member(xbase_space_id, xfiber_schema_id, false));
458 
459  // Exit:
460 
461  return;
462 }
463 
464 void
466 ordinal(pod_index_type xbase_space_id,
467  pod_index_type xfiber_schema_id,
468  pod_index_type& xindex) const
469 {
470  // Preconditions:
471 
472  require(contains_range_member(xbase_space_id, xfiber_schema_id, false));
473 
474  // Body:
475 
476  if(_product_range->contains_member(xbase_space_id, xfiber_schema_id))
477  {
478  _product_range->ordinal(xbase_space_id, xfiber_schema_id, xindex);
479  }
480  else
481  {
482  _table_dof_range->ordinal(xbase_space_id, xfiber_schema_id, xindex);
483  }
484 
485  // Postconditions:
486 
487  ensure(is_homogeneous(xindex));
488 
489  // Exit:
490 
491  return;
492 }
493 
494 bool
497 {
498  // Preconditions:
499 
500  // Body:
501 
502  bool result =
503  _product_range->contains_member(xindex) ||
505 
506  // Postconditions:
507 
508  ensure(is_basic_query);
509 
510  // Exit:
511 
512  return result;
513 }
514 
515 bool
518  pod_index_type xfiber_schema_id,
519  bool xauto_access) const
520 {
521  // Preconditions:
522 
523  require(state_is_auto_read_accessible(xauto_access));
524 
525  // Body:
526 
527  bool result =
528  _product_range->contains_member(xbase_space_id, xfiber_schema_id) ||
529  _table_dof_range->contains_member(xbase_space_id, xfiber_schema_id);
530 
531  // Postconditions:
532 
533  ensure(is_basic_query);
534 
535  // Exit:
536 
537  return result;
538 }
539 
540 void
542 update_hub_id_space(bool xauto_access)
543 {
544  // Preconditions:
545 
546  require(state_is_auto_read_write_accessible(xauto_access));
547 
548  // Body:
549 
550  if(xauto_access)
551  {
552  get_read_write_access(true);
553  }
554 
556 
557  size_type lbase_space_ub = base_space().gathered_member_id_space(false).ct();
558  size_type lfiber_schema_ub = fiber_schema().gathered_member_id_space(false).ct();
559 
560  extend_last_member_term(lbase_space_ub * lfiber_schema_ub, false);
561 
563 
564  if(xauto_access)
565  {
566  release_access();
567  }
568 
569  // Postconditions:
570 
571  // Exit:
572 
573  return;
574 }
575 
576 // PROTECTED FUNCTIONS
577 
578 // PRIVATE FUNCTIONS
579 
580 
581 // ===========================================================
582 // STATE FACET
583 // ===========================================================
584 
585 // PUBLIC FUNCTIONS
586 
589 type_id() const
590 {
591  return PRODUCT_SECTION_SPACE_SCHEMA_POSET_ID;
592 }
593 
594 const char*
596 class_name() const
597 {
598  // Preconditions:
599 
600  // Body:
601 
602  static const char* result = "product_section_space_schema_poset";
603 
604  // Postconditions:
605 
606  // Exit:
607 
608  return result;
609 }
610 
611 // PROTECTED FUNCTIONS
612 
613 void
616  const std::string& xname,
617  const arg_list& xargs,
618  const poset_path& xschema_path,
619  bool xauto_access)
620 {
621 
622  // Preconditions:
623 
624  require(xauto_access || xns.in_jim_edit_mode());
625 
626  require(poset_path::is_valid_name(xname));
627  require(!xns.contains_poset(xname, xauto_access));
628 
633 
634  require(unexecutable(xname != xns.name()));
635 
636  require(xns.path_is_auto_read_accessible(xschema_path, xauto_access));
637  require(xschema_path.conforms_to(xns, standard_schema_path(), xauto_access));
638 
639  require(xargs.conforms_to(xns, xschema_path, true, xauto_access));
640 
641  require(xns.arg_is_auto_read_accessible("rep_path", xargs, xauto_access));
642  require(xns.arg_is_auto_read_accessible("base_space_path", xargs, xauto_access));
643  require(xns.arg_is_auto_read_accessible("fiber_space_path", xargs, xauto_access));
644 
645  require(rep_is_valid(xns, xargs, xauto_access));
646 
647  // Body:
648 
649  if(xauto_access)
650  {
651  xns.get_read_write_access();
652  }
653 
654  // Set any class specific args in arg list.
655 
656  arg_list largs(xargs);
657  initialize_arg_list(xns, xname, largs, xschema_path, xauto_access);
658 
659  // Disable invariant checking in
660  // member functions until construction finished.
661 
663 
664  // Get a temporary handle to the schema.
665 
666  schema_poset_member lschema(&xns, xschema_path, xauto_access);
667  if(xauto_access)
668  {
669  lschema.get_read_access();
670  }
671 
672  // Create the poset state object;
673  // allocates the data structures but does not (fully) initialize them.
674 
675  _state = new poset_state(&lschema, PRODUCT_SECTION_SPACE_SCHEMA_POSET_ID);
676 
677  // Get write access;
678  // handle data members aren't attached yet,
679  // so use psh version.
680 
682 
683  // Initialize the table dofs ("class variables").
684  // Do this before initializing the row structure so the subposet
685  // and member initialization routines can use the table dofs if needed.
686 
687  array_poset_dof_map* lmap = new array_poset_dof_map(&lschema, true);
688  lmap->put_dof_tuple(xargs);
690 
691  // Initialize any additional handle data members
692  // that may depend on table dofs.
693 
695 
696  // Release and regain access;
697  // will get access to handle data members.
698 
701 
702  // Initialize the row structure.
703 
706 
707  // Initialize the namespace features.
708 
709  initialize_namespace(xns, xname);
710 
711  // Set the standard id spaces.
712 
714 
715  // Initialize the table dof subposet.
716 
718 
719  // Initialize the row dof subposet.
720 
722 
723  // Cleanup temporary schema handle.
724 
725  if(xauto_access)
726  {
727  lschema.release_access();
728  }
729  lschema.detach_from_state();
730 
731  // Now invariant should be satisfied
732 
734 
735  // Postconditions:
736 
737  ensure(invariant());
738  ensure(is_attached());
739  ensure(schema().path() == xschema_path);
740  ensure(name() == xname);
741  ensure(!in_jim_edit_mode());
743  //ensure(has_standard_row_dof_tuple_ct());
744  //ensure(has_standard_subposet_ct());
745  ensure(member_id_spaces(false).has_only_standard_id_spaces());
746  ensure(rep().is_attached());
747  ensure(base_space().is_attached());
748  ensure(db() >= 0);
749  ensure(fiber_schema().is_attached());
750  ensure(df() > 0);
751  ensure(fiber_space().is_attached());
752 
753  // Now we're finished, release all access
754 
755  release_access();
756 
757  // One final postcondition
758 
760 
761  if(xauto_access)
762  {
763  xns.release_access();
764  }
765 
766  // Exit:
767 
768  return;
769 }
770 
771 void
774  array_poset_dof_map& xdof_map)
775 {
776 
777  // Preconditions:
778 
779  require(name_space() != 0);
780  require(name_space()->state_is_read_accessible());
781 
782  require(xschema.state_is_read_accessible());
783  require(is_external());
784  require(schema_is_ancestor_of(&xschema));
785  require(xschema.host()->name_space()->is_same_state(name_space()));
787 // require(xschema.is_schematized(false));
788 
791 
793 
794  require(unexecutable(xschema.is_same_state(xdof_map.schema())));
795 
796  require(unexecutable("rep in xdof_map exists"));
797  require(unexecutable("rep in xdof_map is read accessible"));
798 
799  require(unexecutable("base space in xdof_map exists"));
800  require(unexecutable("base space in xdof_map is read accessible"));
801 
802  require(unexecutable("fiber space in xdof_map exists"));
803  require(unexecutable("fiber space in xdof_map is read accessible"));
804 
805  require(unexecutable("rep in xdof_map is valid for base and fiber in xdof_map"));
806 
807 
808  // Body:
809 
810  // Disable invariant checking in
811  // member functions until construction finished.
812 
814 
815  // Create the poset state object;
816  // allocates the data structures but does not (fully) initialize them.
817 
818  _state = new poset_state(&xschema, PRODUCT_SECTION_SPACE_SCHEMA_POSET_ID);
819 
820  // Get write access;
821  // handle data members aren't attached yet,
822  // so use psh version.
823 
825 
826  // Initialize the table dofs.
827  // Must be called before initialize_standard_members
828  // because precondition contains_member in put_member_dof_tuple_id
829  // called from new_member indirectly needs table dofs.
830 
831  initialize_table_dof_tuple(&xdof_map);
832 
833  // Initialize any additional handle data members
834  // that may depend on table dofs.
835 
837 
838  // Release and regain access;
839  // will get access to handle data members.
840 
843 
844  // Initialize the row structure.
845 
848 
849  // Set the standard id spaces.
850 
852 
853  // Initialize the table dof subposet.
854 
856 
857  // Now invariant should be satisfied
858 
860 
861  // Postconditions:
862 
863  ensure(invariant());
864  ensure(is_attached());
865  ensure(!in_jim_edit_mode());
866  ensure(schema().is_same_state(&xschema));
867 // ensure(has_standard_row_dof_tuple_ct());
868 // ensure(has_standard_subposet_ct());
869  ensure(member_id_spaces(false).has_only_standard_id_spaces());
870  ensure(&(table_dof_map()) == &xdof_map);
871  ensure(rep().is_attached());
872  ensure(base_space().is_attached());
873  ensure(fiber_schema().is_attached());
874  ensure(fiber_space().is_attached());
875 
876  // Now we're finished, release all access
877 
878  release_access();
879 
880  // One final postcondition
881 
883 
884  // Exit:
885 
886  return;
887 }
888 
889 // PRIVATE FUNCTIONS
890 
891 
892 // ===========================================================
893 // SCHEMA FACET
894 // ===========================================================
895 
896 // PUBLIC FUNCTIONS
897 
898 // PROTECTED FUNCTIONS
899 
900 // PRIVATE FUNCTIONS
901 
902 
904 // // ===========================================================
905 // // SCHEMATIZATION FACET
906 // // ===========================================================
907 
908 // // PUBLIC FUNCTIONS
909 
910 // bool
911 // fiber_bundle::product_section_space_schema_poset::
912 // is_schematized(bool xauto_access) const
913 // {
914 // bool result;
915 
916 // // Preconditions:
917 
918 // require(xauto_access || state_is_read_accessible());
919 
920 // // Body:
921 
922 // if(xauto_access)
923 // {
924 // get_read_access();
925 // }
926 
927 // /// @issue What is the correct schematization test. The table dof subposet
928 // /// is constructed but the row dof subposet is not.
929 
930 // result = fiber_schema().is_schematized(false);
931 
932 // if(xauto_access)
933 // {
934 // release_access();
935 // }
936 
937 // // Postconditions:
938 
939 // /// @todo make the following executable.
940 
941 // ensure(unexecutable(result == top member has been schematized));
942 
943 // // Exit
944 
945 // return result;
946 // }
947 
948 // bool
949 // fiber_bundle::product_section_space_schema_poset::
950 // is_schematized(pod_index_type xindex, bool xauto_access) const
951 // {
952 // bool result;
953 
954 // // Preconditions:
955 
956 // require(xauto_access || state_is_read_accessible());
957 
958 // // Body:
959 
960 // if(xauto_access)
961 // {
962 // get_read_access();
963 // }
964 
965 // pod_index_type lbase_id, lfiber_id;
966 // _range->tuple(xindex, lbase_id, lfiber_id);
967 
968 // result = fiber_schema().is_schematized(lfiber_id, false);
969 
970 // if(xauto_access)
971 // {
972 // release_access();
973 // }
974 
975 // // Postconditions:
976 
977 // // This routine is a primitive query and hence its postcondition
978 // // is not expressible in terms of other queries. In particular,
979 // // the result is only equivalent to the existence of dof subposets
980 // // in some descendants.
981 
982 // ensure(unexecutable(result == member with index xindex has been prepared for use as a schema));
983 
984 // // Exit
985 
986 // return result;
987 // }
988 
989 // void
990 // fiber_bundle::product_section_space_schema_poset::
991 // schematize(subposet* xtable_dof_subposet,
992 // subposet* xrow_dof_subposet,
993 // bool xall_members)
994 // {
995 // // Preconditions:
996 
997 // require(state_is_read_write_accessible());
998 // require(dynamic_cast<primitives_poset_schema*>(schema().host()) != 0);
999 // // can only schematize posets which have same schema as primitives_poset
1000 // require(xtable_dof_subposet != 0);
1001 // require(includes_subposet(xtable_dof_subposet));
1002 // require(xrow_dof_subposet != 0);
1003 // require(includes_subposet(xrow_dof_subposet));
1004 
1005 // // Body:
1006 
1007 // not_implemented();
1008 
1009 // /// @error this poset is immutable and does not support this operation
1010 
1011 // // Postconditions:
1012 
1013 // ensure(is_schematized(false));
1014 
1015 // // Exit
1016 
1017 // return;
1018 // }
1019 
1020 // // PROTECTED FUNCTIONS
1021 
1022 // // PRIVATE FUNCTIONS
1023 
1024 
1025 // ===========================================================
1026 // MEMBERSHIP FACET
1027 // ===========================================================
1028 
1029 // PUBLIC FUNCTIONS
1030 
1034 {
1035  // Preconditions:
1036 
1037  // Body:
1038 
1039  // Postconditions:
1040 
1041  // Exit
1042 
1043  return *(static_cast<product_section_space_schema_member*>(_top));
1044 }
1045 
1048 top() const
1049 {
1050  // Preconditions:
1051 
1052  // Body:
1053 
1054  // Postconditions:
1055 
1056  // Exit
1057 
1058  return *(static_cast<const product_section_space_schema_member*>(_top));
1059 }
1060 
1064 {
1065  // Preconditions:
1066 
1067  // Body:
1068 
1069  // Postconditions:
1070 
1071  // Exit
1072 
1073  return *(static_cast<product_section_space_schema_member*>(_bottom));
1074 }
1075 
1078 bottom() const
1079 {
1080  // Preconditions:
1081 
1082  // Body:
1083 
1084  // Postconditions:
1085 
1086  // Exit
1087 
1088  return *(static_cast<const product_section_space_schema_member*>(_bottom));
1089 }
1090 
1091 bool
1093 is_jim(pod_index_type xindex, bool xin_current_version) const
1094 {
1095  // Preconditions:
1096 
1097  require(state_is_read_accessible());
1098 
1099  // Body:
1100 
1101  bool result;
1102 
1103  if(is_homogeneous(xindex))
1104  {
1105  // xindex is homogeneous, factor members and check to see if it is a jim.
1106 
1107  pod_index_type lbase_space_id, lfiber_schema_id;
1108 
1109  tuple(xindex, lbase_space_id, lfiber_schema_id);
1110 
1111  if(lbase_space_id == BOTTOM_INDEX)
1112  {
1113  result = fiber_schema().table_dof_subposet().contains_member(lfiber_schema_id);
1114  }
1115  else
1116  {
1117  result =
1118  base_space().is_jim(lbase_space_id) &&
1119  fiber_schema().is_jim(lfiber_schema_id);
1120  }
1121  }
1122  else
1123  {
1124  // xindex is not homogeneous, it is not a jim.
1125 
1126  result = false;
1127  }
1128 
1129  // Postconditions:
1130 
1131  // Exit
1132 
1133  return result;
1134 }
1135 
1136 string
1138 member_name(pod_index_type xindex, bool xauto_access) const
1139 {
1140  string result;
1141 
1142  // Preconditions:
1143 
1144  require(state_is_auto_read_accessible(xauto_access));
1145 
1146  // Body:
1147 
1148  if(xauto_access)
1149  {
1150  get_read_access();
1151  }
1152 
1153  result = poset_state_handle::member_name(xindex, false);
1154  if(result.empty())
1155  {
1156  // Member does not have a client assigned name;
1157  // try to construct a default name from factor names.
1158 
1159  if(is_homogeneous(xindex))
1160  {
1161  // Member can be factored.
1162 
1163  pod_index_type lbase_id, lfiber_id;
1164  tuple(xindex, lbase_id, lfiber_id);
1165 
1166  string lfiber_name = fiber_schema().member_name(lfiber_id);
1167 
1168  if( (lbase_id == BOTTOM_INDEX) &&
1170  {
1171  // This is a table dof member;
1172  // name is name of fiber factor.
1173 
1174  result = lfiber_name;
1175  }
1176  else
1177  {
1178  // This is not a table dof member;
1179  // construct name from both base and fiber factor.
1180 
1181  string lbase_name = base_space().member_name(lbase_id);
1182 
1183  if(!lbase_name.empty() || !lfiber_name.empty())
1184  {
1185  result = lbase_name + '_' + lfiber_name;
1186  }
1187  else
1188  {
1189  // Both base and fiber names are empty; do nothing.
1190  }
1191  }
1192  }
1193  else
1194  {
1195  // Index can't be factored; do nothing.
1196  }
1197  }
1198 
1199  if(xauto_access)
1200  {
1201  release_access();
1202  }
1203 
1204  // Postconditions:
1205 
1206 
1207  // Exit:
1208 
1209  return result;
1210 }
1211 
1212 // PROTECTED FUNCTIONS
1213 
1214 void
1217 {
1218  // Preconditions:
1219 
1220  require(state_is_read_write_accessible());
1221 
1222  // Body:
1223 
1224  // Enter jim edit mode.
1225 
1226  begin_jim_edit_mode(false);
1227 
1228  // Allocate members.
1229 
1230  new_member(false); // bottom.
1231  new_member(false); // top.
1232 
1233  // Allocate the member ranges.
1234 
1235  size_type lrange_size;
1236  pod_index_type lrange_id;
1237  block<scoped_index> ldof_tuple_ids; // Dof tuple ids are empty
1238 
1239  // Private data for the ranges have no explicit member or implicit data..
1240 
1241  block<pod_index_type> lprivate_data;
1242  lprivate_data.reserve(2);
1243  lprivate_data.set_ct(2);
1244  lprivate_data[0] = 0; // No explicit upper covers
1245  lprivate_data[1] = 0; // No explicit lower covers
1246 
1247  // Allocate the table dof range.
1248 
1250  lrange_id = poset_state_handle::new_member_range("section_space_schema_table_dof_crg_range", lrange_size);
1252 
1253  // Allocate the product range.
1254 
1256  lrange_id = poset_state_handle::new_member_range("product_section_space_schema_crg_range", lrange_size);
1257  _product_range = reinterpret_cast<product_section_space_schema_crg_range*>(crg().implicit_member(lrange_id));
1258 
1259  // Attach bottom member; becomes index 0.
1260  // No dof tuple allocated.
1261 
1262  bottom().attach_to_state(this, BOTTOM_INDEX);
1263  bottom().put_name("bottom", true, false);
1264 
1265  // Attach top member; becomes index 1.
1266  // No dof tuple allocated.
1267 
1268  top().attach_to_state(this, TOP_INDEX);
1269  top().put_name("top", true, false);
1270 
1271  // Finialize the table dof range.
1272 
1273  _table_dof_range->initialize_dof_tuple_ids(ldof_tuple_ids);
1274  _table_dof_range->put_private_data(lprivate_data);
1275  _table_dof_range->finalize(*this);
1276 
1277  // Finialize the product range.
1278 
1279  _product_range->initialize_dof_tuple_ids(ldof_tuple_ids);
1280  _product_range->put_private_data(lprivate_data);
1281  _product_range->finalize(*this);
1282 
1283  // Create a cover link from the top to base_space.top(), fiber_schema.top().
1284 
1285  pod_index_type link_id;
1286  _product_range->ordinal(TOP_INDEX, TOP_INDEX, link_id);
1287  new_link(TOP_INDEX, link_id);
1288 
1289  // All the members and row dof tuples are standard.
1290 
1293 
1294  end_jim_edit_mode(false, false);
1295 
1296  // Now the cover relation graph invariant is satisfied
1297 
1299 
1300  assertion(crg().invariant());
1301 
1302  // Postconditions:
1303 
1304  ensure(bottom().is_attached() && (bottom().index() == BOTTOM_INDEX));
1305  ensure(top().is_attached() && (top().index() == TOP_INDEX));
1306  ensure(has_standard_member_ct());
1308 
1309  // Exit
1310 
1311  return;
1312 }
1313 
1314 // PRIVATE FUNCTIONS
1315 
1316 
1317 // ===========================================================
1318 // I/O SUPPORT FACET
1319 // ===========================================================
1320 
1321 // PUBLIC FUNCTIONS
1322 
1324 // bool
1325 // fiber_bundle::product_section_space_schema_poset::
1326 // is_valid_int_id(pod_index_type xint_id,
1327 // const std::string& xid_space_name,
1328 // bool xauto_access) const
1329 // {
1330 // // Preconditions:
1331 
1332 // require(xauto_access || state_is_read_accessible());
1333 
1334 // if(xauto_access)
1335 // {
1336 // get_read_access();
1337 // }
1338 
1339 // // Body:
1340 
1341 // bool result = true;
1342 
1343 // if(xint_id >= standard_member_ct())
1344 // {
1345 // result = base_space().member_id_spaces(false).contains(xid_space_name);
1346 // if(result)
1347 // {
1348 // pod_index_type lbase_id, lfiber_id;
1349 // tuple(xint_id, lbase_id, lfiber_id);
1350 
1351 // result = base_space().member_id_spaces(false).contains_hub(xid_space_name,
1352 // lbase_id);
1353 // }
1354 // }
1355 
1356 // if(xauto_access)
1357 // {
1358 // release_access();
1359 // }
1360 
1361 // // Postconditions:
1362 
1363 // // Exit:
1364 
1365 // return result;
1366 // }
1367 
1368 // sheaf::pod_index_type
1369 // fiber_bundle::product_section_space_schema_poset::
1370 // get_ext_id(pod_index_type xint_id,
1371 // const std::string& xid_space_name,
1372 // bool xauto_access) const
1373 // {
1374 // // Preconditions:
1375 
1376 // require(xauto_access || state_is_read_accessible());
1377 // require(is_valid_int_id(xint_id, xid_space_name, xauto_access));
1378 
1379 
1380 // // Body:
1381 
1382 // pod_index_type lbase_id, lfiber_id;
1383 // tuple(xint_id, lbase_id, lfiber_id);
1384 
1385 // pod_index_type result = base_space().get_ext_id(lbase_id,
1386 // xid_space_name,
1387 // xauto_access);
1388 
1389 // // Postconditions:
1390 
1391 // ensure(result >= 0);
1392 
1393 // // Exit:
1394 
1395 // return result;
1396 // }
1397 
1398 // PROTECTED FUNCTIONS
1399 
1402 new_schema_handle(const std::string& xid_space_name,
1403  pod_index_type xschema_member_ext_id,
1404  pod_index_type xbase_space_ext_id,
1405  pod_index_type xfiber_schema_ext_id,
1406  pod_index_type xlocal_schema_ext_id)
1407 {
1408  // Preconditions:
1409 
1410  // Body:
1411 
1412  // Create a handle of the type appropriate for members of this
1413  // which will be used as a schema.
1414 
1416 
1417  // Get the internal id for the base space.
1418 
1419  pod_index_type lbase_id =
1420  base_space().get_int_id(xbase_space_ext_id, xid_space_name, false);
1421 
1422  // Get the internal id for the fiber schema.
1423 
1424  pod_index_type lfiber_id =
1425  fiber_schema().get_int_id(xfiber_schema_ext_id, xid_space_name, false);
1426 
1427  // Get the member id from its components
1428 
1429  pod_index_type lint_id;
1430  ordinal(lbase_id, lfiber_id, lint_id);
1431 
1432  // Attach the handle.
1433 
1434  result->attach_to_state(this, lint_id);
1435 
1436  // Postconditions:
1437 
1438  ensure(result != 0);
1439  ensure(schema_is_ancestor_of(result));
1440  ensure(result->is_attached());
1441 
1442  // Exit
1443 
1444  return result;
1445 }
1446 
1447 // PRIVATE FUNCTIONS
1448 
1449 
1450 // ===========================================================
1451 // ANY FACET
1452 // ===========================================================
1453 
1454 // PUBLIC FUNCTIONS
1455 
1456 bool
1458 is_ancestor_of(const any* xother) const
1459 {
1460  bool result;
1461 
1462  // Preconditions:
1463 
1464  // Body:
1465 
1466  result = dynamic_cast<const product_section_space_schema_poset*>(xother) != 0;
1467 
1468  // Postconditions:
1469 
1470  // Exit
1471 
1472  return result;
1473 }
1474 
1475 bool
1477 invariant() const
1478 {
1479  bool result = true;
1480 
1482 
1483  if(invariant_check())
1484  {
1486 
1489 
1491  }
1492 
1493  return result;
1494 }
1495 
1496 // PROTECTED FUNCTIONS
1497 
1500 clone() const
1501 {
1503 
1504  // Preconditions:
1505 
1506  // Body:
1507 
1509 
1510  // Postconditions:
1511 
1512  ensure(result != 0);
1513  ensure(!result->is_attached());
1514 
1515  // Exit
1516 
1517  return result;
1518 }
1519 
1523 {
1524  // Preconditions:
1525 
1526  require(is_ancestor_of(&xother));
1527 
1528  // Body:
1529 
1531 
1532  // Postconditions:
1533 
1534  ensure(is_same_state(&xother));
1535 
1536  // Exit:
1537 
1538  return *this;
1539 }
1540 
1541 // PRIVATE FUNCTIONS
1542 
1543 
1544 // ===========================================================
1545 // EXPLICIT INSTANTIATIONS FOR CLASS PRODUCT_SECTION_SPACE_SCHEMA_POSET
1546 // ===========================================================
1547 
1548 #ifndef DOXYGEN_SKIP_INSTANTIATIONS
1549 
1550 template
1551 SHEAF_DLL_SPEC
1553 sheaf::namespace_poset::
1554 member_poset<fiber_bundle::product_section_space_schema_poset>(const poset_path& xpath, bool xauto_access) const;
1555 
1556 template
1557 SHEAF_DLL_SPEC
1558 bool
1559 sheaf::namespace_poset::
1560 contains_poset<fiber_bundle::product_section_space_schema_poset>(const poset_path& xpath, bool xauto_access) const;
1561 
1562 template
1563 SHEAF_DLL_SPEC
1564 bool
1565 sheaf::namespace_poset::
1566 contains_path<fiber_bundle::product_section_space_schema_poset>(const poset_path& xpath, bool xauto_access) const;
1567 
1568 template
1569 SHEAF_DLL_SPEC
1570 bool
1571 sheaf::namespace_poset::
1572 path_is_auto_read_accessible<fiber_bundle::product_section_space_schema_poset>(const poset_path& xpath, bool xauto_access) const;
1573 
1574 template
1575 SHEAF_DLL_SPEC
1576 bool
1577 sheaf::namespace_poset::
1578 path_is_auto_read_available<fiber_bundle::product_section_space_schema_poset>(const poset_path& xpath, bool xauto_access) const;
1579 
1580 template
1581 SHEAF_DLL_SPEC
1582 bool
1583 sheaf::namespace_poset::
1584 path_is_auto_read_write_accessible<fiber_bundle::product_section_space_schema_poset>(const poset_path& xpath, bool xauto_access) const;
1585 
1586 template
1587 SHEAF_DLL_SPEC
1588 bool
1589 sheaf::namespace_poset::
1590 path_is_auto_read_write_available<fiber_bundle::product_section_space_schema_poset>(const poset_path& xpath, bool xauto_access) const;
1591 
1592 #endif // ifndef DOXYGEN_SKIP_INSTANTIATIONS
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...
poset_state_handle * host() const
The poset which this is a handle to a component of.
virtual poset_path path(bool xauto_access=true) const
The path of this poset.
bool state_is_auto_read_write_accessible(bool xauto_access) const
True if state is auto accessible for read and write, that is, if the state is already accessible for ...
void insert_prototype(const poset_state_handle *xprototype)
Sets xprototype as the prototype for its client class.
void extend_last_member_term(size_type xct, bool xauto_access)
Extends the last term of the member hub id space to ct == xct.
static bool rep_is_valid(const sec_rep_descriptor &xrep, const poset_state_handle &xbase_space)
True if the discretization and evaluation subposets named in xrep are included in xbase_space and the...
int df() const
The dimension of the fiber space.
static void get_size(const product_section_space_schema_poset &xhost, size_type &result)
The size for an instance created with parameter xhost.
void initialize_table_dof_subposet()
Create the table dof members with the same ids as the table dofs in the fiber schema id space and ini...
bool has_standard_member_ct() const
True if poset is in its initial state, that is, it contains just the standard members.
bool full() const
True if both poset name and member name are not empty.
Definition: poset_path.cc:311
virtual pod_index_type new_member(bool xis_jim, pod_index_type xdof_tuple_id)
Create a disconnected member with is_jim == xis_jim. Redefined here only to trap attempts to make a n...
static void get_size(const product_section_space_schema_poset &xhost, size_type &result)
The size for an instance created with parameter xhost.
The private state of a partially ordered set.
Definition: poset_state.h:49
An abstract iterator over the ids of an id space.
virtual product_section_space_schema_poset * clone() const
Virtual constructor; creates a new handle of the same actual type as this, attached to the same state...
virtual void new_link(pod_index_type xgreater, pod_index_type xlesser)
Insert a link from lesser to greater (i.e. lesser <= greater). Redefined here only to trap attempts t...
virtual bool contains_member(pod_index_type xbase_space_id, pod_index_type xfiber_schema_id) const
True if this range contains the member with base space id xbase_space_id and fiber schema id xfiber_s...
const scoped_index & index() const
The member index of this poset within the namespace host()
implicit_crg_interval * implicit_member(pod_index_type xid) const
The implicit interval for the member with index xid. Returns null, if no implicit interval exists...
virtual void tuple(pod_index_type xindex, pod_index_type &xbase_space_id, pod_index_type &xfiber_schema_id) const
The tuple conversion from section space schema id xindex to the base space id xbase_space_id and fibe...
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
void initialize_table_dof_tuple(array_poset_dof_map *xdof_tuple)
Installs xdof_tuple as the table dof tuple.
The default name space; a poset which contains other posets as members.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
bool path_is_auto_read_accessible(const poset_path &xpath, bool xauto_access) const
True if the state referred to xpath exists and is auto read accessible.
poset_type
Identifiers for poset types.
Definition: poset_type.h:41
virtual void get_read_write_access(bool xrelease_read_only_access=false)
Get read write access to the state associated with this. If release_read_only_access is requested...
virtual schema_poset_member & schema()
The schema on which this is allocated (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...
bool state_is_auto_read_accessible(bool xauto_access) const
True if the state is auto accessible for read, that is, if the state is already accessible for read o...
A client handle for a general, abstract partially order set.
virtual void finalize(poset_state_handle &xhost)
Finialize the initialization of this crg range in the host xhost.
static const std::string & standard_schema_poset_name()
The name of the standard schema poset for this class.
virtual string member_name(pod_index_type xindex, bool xauto_access=false) const
The name of the member with index xindex.
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).
virtual void initialize_standard_subposets(const std::string &xname)
Creates the subposets common to every poset (e.g. whole() and jims()).
subposet & discretization()
The discretization subposet for section spaces on this schema.
virtual void get_read_access() const
Get read access to the state associated with this.
virtual bool contains_member(pod_index_type xbase_space_id, pod_index_type xfiber_schema_id) const
True if this range contains the member with base space id xbase_space_id and fiber schema id xfiber_s...
void put_standard_row_dof_tuple_ct(int xct)
Sets the number of standard row dof tuples automatically allocated by the constructor.
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
void update_product_structure()
Update teh product structure of the local id space.
STL namespace.
abstract_poset_member * _top
Top member of poset.
void reserve(index_type xub)
Makes ub() at least xub; if new storage is allocated, it is uninitialized.
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.
int db() const
The dimension of the base space.
virtual void get_read_write_access(bool xrelease_read_only_access=false)
Get read write access to the state associated with this. If release_read_only_access is requested...
static bool make_prototype()
Creates prototype for this class and enters in in factory.
std::string row_dof_subposet_name() const
The standard name for the row dof subposet associated with this schema member. Synonym for dof_subpos...
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 const char * class_name() const
The name of this class.
virtual void next()=0
Makes id() the next id in the iteration.
virtual void ordinal(pod_index_type xbase_space_id, pod_index_type xfiber_schema_id, pod_index_type &xindex) const
The ordinal conversion from base space id xbase_space_id and fiber schema id xfiber_schema_id to sect...
virtual index_space_iterator & get_iterator() const
Allocates an id space iterator from the iterator pool.
abstract_poset_member * _bottom
Bottom members of poset.
An schema poset for a section space represented by a Cartesian product subspace of the tensor product...
void new_state(namespace_poset &xhost, const std::string &xname, const arg_list &xargs, const poset_path &xschema_path, bool xauto_access)
Attaches this to a new poset state in namespace xhost, schema specified by xschema_path, name xname, and table dofs initialized by xargs.
virtual bool is_ancestor_of(const any *other) const
True if other conforms to this.
virtual void reset()=0
Restarts the iteration.
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 bool invariant() const
Class invariant.
product_section_space_schema_poset & operator=(const poset_state_handle &xother)
Assignment operator; attaches this to the same state as xother.
Abstract base class with useful features for all objects.
Definition: any.h:39
product_section_space_schema_member & bottom()
The bottom of member of the lattice (mutable version)
poset & fiber_space()
The fiber space for section spaces on this schema.
A whitespace separated list of arguments. Insertion operaters are used to insert arguments into the l...
Definition: arg_list.h:63
virtual void put_name(const std::string &xname, bool xunique, bool xauto_access)
Make xname a name for this; if xunique, make xname the only name.
Definition: subposet.cc:2782
virtual void initialize_namespace(namespace_poset &xns, const std::string &xposet_name, bool xauto_link=true)
Installs this as a member of xns. If xauto_link, automatically links the member into an appropriate g...
bool conforms_to(const poset_path &xother, bool xauto_access) const
True if the schema member this refers to conforms to the schema member xother refers to in the curren...
Definition: poset_path.cc:1155
pod_index_type get_int_id(pod_index_type xext_id, const std::string &xid_space_name, bool xauto_access) const
Translates xext_id to an internal id using the equivalence map with name xid_space_name.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
virtual bool is_homogeneous(pod_index_type xindex) const
True if xindex is in the homogeneous member id space.
Abstract emulator for a range of implicit section space schema members.
bool is_done() const
True if iteration is finished.
virtual void ordinal(pod_index_type xbase_space_id, pod_index_type xfiber_schema_id, pod_index_type &xindex) const
The ordinal conversion from base space id xbase_space_id and fiber schema id xfiber_schema_id to sect...
subposet & row_dof_subposet()
The row dof subposet when this poset is used as a schema (mutable version).
virtual void finalize(poset_state_handle &xhost)
Finialize the initialization of this crg range in the host xhost.
void initialize_row_dof_subposet()
Initialize the row dof subposet to the product of the row dof ids in the base space and the row dof i...
void update_standard_member_id_spaces()
Update the initially allocated id spaces.
bool is_external() const
True if this has a corresponding member in a name space, but is not yet attached to a state...
bool state_is_read_write_accessible() const
True if this is attached and if the state is accessible for read and write or access control is disab...
bool has_standard_row_dof_tuple_ct() const
True if poset is in its initial state, that is, it contains just the standard row_dof_tuples.
primitive_value & value(int xi)
The value of the xi-th argument.
Definition: arg_list.cc:267
virtual void detach_from_state()
Detach this handle from its state, if any.
void set_ct(size_type xct)
Sets ct() == xct.
virtual bool is_attached() const
True if this handle is attached to a non-void state.
product_section_space_schema_member & top()
The top of member of the lattice (mutable version)
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
std::string poset_name() const
The poset name part of the path.
Definition: poset_path.cc:473
virtual void insert_member(pod_index_type xmbr_hub_id)
Inserts the member of host() with hub id xmbr_hub_id.
Definition: subposet.cc:1091
size_type row_dof_tuple_ct() const
The number of row_dof_tuples of this poset.
product_section_space_schema_crg_range & product_range()
The implicit crg range that represents the product members of this poset.
sec_rep_descriptor & rep()
The representation for section spaces on this schema.
virtual std::string member_name(pod_index_type xmbr_hub_id, bool xauto_access=false) const
A name for the member with hub id xmbr_hub_id.
virtual void initialize_handle_data_members(const namespace_poset &xns)
Initializes the handle data members that depend on the table dofs and are required to get access when...
virtual void put_name(const std::string &xname, bool xunique, bool xauto_access)
Make xname a name for this; if xunique, make xname the only name.
void put_standard_member_ct(int xct)
Sets the number of standard members automatically allocated by the constructor.
section_space_schema_table_dof_crg_range & table_dof_range()
The implicit crg range that represents the table dof members of this poset.
void put_product_range(product_section_space_schema_crg_range &xproduct_range)
Set the product range.
virtual std::string name() const
The name of this poset.
bool empty() const
True if both poset name and member name are empty.
Definition: poset_path.cc:291
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
Definition: any.h:97
const ij_product_structure & product_structure() const
The product structure of the local 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...
const ij_product_structure & product_structure() const
The product structure of this poset.
virtual void tuple(pod_index_type xindex, pod_index_type &xbase_space_id, pod_index_type &xfiber_schema_id) const
The tuple conversion from section space schema id xindex to the base space id xbase_space_id and fibe...
bool contains_poset(pod_index_type xhub_id, bool xauto_access=true) const
True if this contains a poset with hub id xhub_id..
virtual void update_hub_id_space(bool xauto_access)
Extends the hub id space to match extension of the base space.
const scattered_insertion_index_space_handle & id_space() const
The id space for the members of with this (const version).
Definition: subposet.cc:508
static poset_handle_factory & factory()
The poset handle factory.
virtual bool contains_range_member(pod_index_type xbase_space_id, pod_index_type 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 int member_ct() const
The number of members of this poset.
namespace_poset * name_space() const
The namespace this poset resides in.
virtual bool is_attached() const
True if this is attached to a state.
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 conforms_to(const namespace_poset &xns, const poset_path &xschema_path, bool xuse_table_schema, bool xauto_access) const
True if the values in this conform to the table schema (xuse_table_schema true) or row schema (xuse_t...
Definition: arg_list.cc:529
section_space_schema_poset & operator=(const poset_state_handle &xother)
Assignment operator; disabled.
product_section_space_schema_crg_range * _product_range
The implicit crg range that represents the product members of this poset.
virtual void put_dof_tuple(const void *xbuf, size_t xbuflen)
Copies the entire dof tuple from xbuf into internal storage.
poset_state * _state
State object for this poset.
An abstract schema poset for a section space. A Cartesian product subspace of the tensor product of a...
poset_crg_state & crg() const
The cover relation graph.
product_section_space_schema_poset()
Default constructor; creates a new product_section_space_schema_poset handle not attached to any stat...
bool invariant_check() const
True if invariant checking is enabled.
Definition: any.h:79
virtual std::string name() const
The name of this poset.
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...
poset_state_handle & fiber_schema()
The fiber schema for section spaces on this schema (mutable version).
static void make_standard_schema(namespace_poset &xns)
Creates standard schema for this class in namespace xns.
Emulator for a range of implicit section space schema members representing the Cartesian product the ...
subposet & table_dof_subposet()
The table dof subposet when this poset is used as a schema (mutable version).
virtual void initialize_arg_list(const namespace_poset &xns, const std::string &xname, arg_list &xargs, const poset_path &xschema_path, bool xauto_access)
Initializes xarg to satisfy class invariants.
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
A 2D implementation of abstract_product_structure.
virtual bool is_jim(pod_index_type xmbr_hub_id, bool xin_current_version=true) const
True if the member with hub id xmbr_hub_id is a jim in the current version (xin_current_version == tr...
virtual void end_jim_edit_mode(bool xensure_lattice_invariant=true, bool xauto_access=true)
Prevent editing of jims and jim order relation.
Definition: poset.cc:253
bool is_same_state(const poset_state_handle *xother) const
True if this is attached to the same state as xother.
virtual schema_poset_member * new_schema_handle(const std::string &xid_space_name, pod_index_type xschema_member_ext_id, pod_index_type xbase_space_ext_id, pod_index_type xfiber_schema_ext_id, pod_index_type xlocal_schema_ext_id)
Creates a member handle of the type appropriate for members of this when used as a schema...
void attach_to_state(const namespace_poset *xns, const poset_path &xpath, bool xauto_access=true)
Attach to the state specified by path xpath in the namespace xns.
static bool is_valid_name(const std::string &xname)
True if xname is not empty and contains only name legal characters.
Definition: poset_path.cc:331
virtual void release_iterator(index_space_iterator &xitr) const
Returns the id space iterator xitr to the iterator pool.
virtual void ordinal(pod_index_type xbase_space_id, pod_index_type xfiber_schema_id, pod_index_type &xindex) const
The ordinal conversion from base space id xbase_space_id and fiber schema id xfiber_schema_id to sect...
virtual bool is_jim(pod_index_type xindex, bool xin_current_version=true) const
True if the member with index xindex is a jim.
static arg_list make_arg_list(const poset_path &xrep_path, const poset_path &xbase_space_path, const poset_path &xfiber_space_path)
Creates an arg list which conforms to the schema of this.
bool in_jim_edit_mode() const
True if editing jims and jim order relation is allowed.
An array representation of abstract class poset_dof_map.
virtual void new_state(bool xinitialize=true, bool xauto_access=true)
Creates a new subposet state in host() and attaches this object to it. If xinitialize, initialize the membership to xmembers, If !xinitialize, leave the membership uninitialized.
Definition: subposet.cc:295
Namespace for the fiber_bundles component of the sheaf system.
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 put_table_dof_range(section_space_schema_table_dof_crg_range &xtable_dof_range)
Set the table dof crg range.
void enable_invariant_check() const
Enable invariant checking.
Definition: any.h:87
virtual void initialize_standard_members()
Creates the members common to every poset (i.e. _top and _bottom).
virtual void tuple(pod_index_type xindex, pod_index_type &xbase_space_id, pod_index_type &xfiber_schema_id) const
The tuple conversion from section space schema id xindex to the base space id xbase_space_id and fibe...
section_space_schema_table_dof_crg_range * _table_dof_range
The implicit crg range that represents the table dof members of this poset.
virtual poset_type type_id() const
Identifier for the type of this poset.
bool state_is_not_read_accessible() const
True if this is attached and if the state is accessible for read or if access control is disabled...
A client handle for a poset member which has been prepared for use as a schema.
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...
void update_gathered_id_spaces()
Update the gathered hub id spaces for the base space and fiber schema.
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
pod_type hub_pod() const
The current unglued hub id in the iteration. synonym for unglued_hub_pod().
virtual bool schema_is_ancestor_of(const schema_poset_member *xother_schema) const
True if xother_schema conforms to the type of schema required by this.
base_space_poset & base_space()
The base space for section spaces on this schema.
virtual array_poset_dof_map & table_dof_map(bool xrequire_write_access=false)
The map from table dof client_ids to table dof values for this poset (mutable version) ...
virtual void begin_jim_edit_mode(bool xauto_access=true)
Allow editing of jims and jim order relation.
Definition: poset.cc:230
A client handle for a poset member which has been prepared for use as a schema for a section space...