SheafSystem  0.0.0.0
ij_connectivity_index_space_interval.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/ij_connectivity_index_space_interval.h"
22 
23 #include "SheafSystem/abstract_product_structure.h"
24 #include "SheafSystem/assert_contract.h"
25 #include "SheafSystem/ij_connectivity_implicit_index_space_iterator.h"
26 #include "SheafSystem/ij_product_structure.h"
27 #include "SheafSystem/forwarding_index_space_handle.h"
28 #include "SheafSystem/explicit_index_space_state.h"
29 #include "SheafSystem/hub_index_space_handle.h"
30 #include "SheafSystem/index_space_family.h"
31 
32 using namespace std;
33 using namespace fiber_bundle; // Workaround for MS C++ bug.
34 
35 // ===========================================================
36 // SPACE FACTORY FACET
37 // ===========================================================
38 
39 // PUBLIC MEMBER FUNCTIONS
40 
44  size_type xub,
45  pod_type xvertex_hub_begin,
46  size_type xj_size)
47 {
48  // Preconditions:
49 
50  require(xub > 0);
51  require(xid_spaces.hub_id_space().contains(xvertex_hub_begin));
52  require(xj_size > 0);
53 
54  // Body:
55 
56  define_old_variable(size_type old_id_spaces_end = xid_spaces.end());
57 
59  result_ptr->new_state(xid_spaces, xub);
60 
61  result_ptr->_vertex_hub_begin = xvertex_hub_begin;
62  result_ptr->_j_size = xj_size;
63 
64  result_ptr->_j_vertex_size = result_ptr->_j_size+1;
65 
66  const ij_connectivity_index_space_interval& result = *result_ptr;
67 
68  // Postconditions:
69 
70  ensure(&result.id_spaces() == &xid_spaces);
71  ensure(result.begin() == old_id_spaces_end);
72  ensure(result.end() == xid_spaces.end());
73  ensure(result.end() == result.begin() + xub);
74 
75  ensure(result.vertex_hub_begin() == xvertex_hub_begin);
76  ensure(result.j_size() == xj_size);
77 
78  // Exit:
79 
80  return result;
81 }
82 
83 // PROTECTED MEMBER FUNCTIONS
84 
85 // PRIVATE MEMBER FUNCTIONS
86 
87 
88 // ===========================================================
89 // IJ_CONNECTIVITY_INDEX_SPACE_INTERVAL FACET
90 // ===========================================================
91 
92 // PUBLIC MEMBER FUNCTIONS
93 
96 {
97  // Preconditions:
98 
99  // Body:
100 
101  // Nothing to do.
102 
103  // Postconditions:
104 
105  // Exit:
106 
107  return;
108 }
109 
113 {
114  // Preconditions:
115 
116  // Body:
117 
118  // Postconditions:
119 
120  ensure(is_basic_query);
121 
122  // Exit:
123 
124  return _vertex_hub_begin;
125 }
126 
129 vertex_hub_begin(pod_type xlocal_id) const
130 {
131  // Preconditions:
132 
133  // Body:
134 
135  // xlocal_id is the zone id, compute the i, j indices.
136 
137  pod_type i, j, k;
138  sheaf::tuple(xlocal_id, _j_size, i, j);
139 
140  // Compute the vertex id.
141 
142  pod_type result = ordinal(i, j, _j_vertex_size) + _vertex_hub_begin;
143 
144  // Postconditions:
145 
146  ensure(is_basic_query);
147 
148  // Exit:
149 
150  return result;
151 }
152 
155 j_size() const
156 {
157  // Preconditions:
158 
159  // Body:
160 
161  // Postconditions:
162 
163  ensure(is_basic_query);
164 
165  // Exit:
166 
167  return _j_size;
168 }
169 
173 {
174  // Preconditions:
175 
176  // Body:
177 
178  // Postconditions:
179 
180  ensure(is_basic_query);
181 
182  // Exit:
183 
184  return _j_vertex_size;
185 }
186 
187 // PROTECTED MEMBER FUNCTIONS
188 
192 {
193  // Preconditions:
194 
195  // Body:
196 
197  // Postconditions:
198 
199  ensure(invariant());
200 
201  // Exit:
202 
203  return;
204 }
205 
206 // PRIVATE MEMBER FUNCTIONS
207 
208 
209 // ===========================================================
210 // INDEX_SPACE_INTERVAL FACET
211 // ===========================================================
212 
213 // PUBLIC MEMBER FUNCTIONS
214 
215 // PROTECTED MEMBER FUNCTIONS
216 
217 // PRIVATE MEMBER FUNCTIONS
218 
219 
220 // ===========================================================
221 // FACTORY FACET
222 // ===========================================================
223 
224 // PUBLIC MEMBER FUNCTIONS
225 
226 const std::string&
228 class_name() const
229 {
230  static const string result("ij_connectivity_index_space_interval");
231  return result;
232 }
233 
236 clone() const
237 {
238  // Preconditions:
239 
240  // Body:
241 
244 
245  // Postconditions:
246 
247  ensure(result != 0);
248  ensure(is_same_type(result));
249 
250  // Exit:
251 
252  return result;
253 }
254 
255 // PROTECTED MEMBER FUNCTIONS
256 
257 // PRIVATE MEMBER FUNCTIONS
258 
259 bool
260 fiber_bundle::ij_connectivity_index_space_interval::
261 make_prototype()
262 {
263  // Preconditions:
264 
265  // Body:
266 
268 
269  id_space_interval_factory().insert_prototype(lproto);
270 
271  // Postconditions:
272 
273  // Exit:
274 
275  return true;
276 }
277 
278 
279 // ===========================================================
280 // INDEX_SPACE_COLLECTION FACET
281 // ===========================================================
282 
283 // PUBLIC MEMBER FUNCTIONS
284 
285 bool
287 operator==(const index_space_collection& xother) const
288 {
289  // Preconditions:
290 
291  require(is_ancestor_of(&xother));
292 
293  // Body:
294 
296  dynamic_cast<const ij_connectivity_index_space_interval&>(xother);
297 
298  bool result = index_space_interval::operator==(xother);
299 
300  result = result && (_vertex_hub_begin == lother._vertex_hub_begin);
301  result = result && (_j_size == lother._j_size);
302  result = result && (_j_vertex_size == lother._j_vertex_size);
303 
304  // Postconditions:
305 
306  // Exit
307 
308  return result;
309 }
310 
313 deep_size(bool xinclude_shallow) const
314 {
315  // Preconditions:
316 
317  // Body:
318 
319  size_type result = fiber_bundle::deep_size(*this, xinclude_shallow);
320 
321  // Postconditions:
322 
323  ensure(result >= 0);
324 
325  // Exit:
326 
327  return result;
328 }
329 
330 // PROTECTED MEMBER FUNCTIONS
331 
335 {
336  // Preconditions:
337 
338  require(is_ancestor_of(&xother));
339 
340  // Body:
341 
343  dynamic_cast<const ij_connectivity_index_space_interval&>(xother);
344 
346  _j_size = lother._j_size;
348 
350 
351  // Postconditions:
352 
353  ensure(invariant());
354  ensure((*this) == xother);
355 
356  // Exit:
357 
358  return *this;
359 }
360 
363 explicit_state(pod_type xlocal_id) const
364 {
365  // Preconditions:
366 
367  // Body:
368 
370 
371  explicit_index_space_state* result = 0;
372 
373  // Postconditions:
374 
375  ensure(is_basic_query);
376 
377  // Exit:
378 
379  return result;
380 }
381 
382 // PRIVATE MEMBER FUNCTIONS
383 
384 
385 // ===========================================================
386 // INDEX SPACE FACET
387 // ===========================================================
388 
389 // PUBLIC MEMBER FUNCTIONS
390 
391 void
393 remove(pod_type xlocal_id)
394 {
395  // Preconditions:
396 
397  // Body:
398 
400 
401  not_implemented();
402 
403  // Postconditions:
404 
405  ensure(!contains(xlocal_id));
406 
407  // Exit:
408 
409  return;
410 }
411 
414 ct(pod_type xlocal_id) const
415 {
416  // Preconditions:
417 
418  require(contains(xlocal_id));
419 
420  // Body:
421 
422  size_type result = 4;
423 
424  // Postconditions:
425 
426  ensure(is_basic_query);
427 
428  // Exit:
429 
430  return result;
431 }
432 
435 begin(pod_type xlocal_id) const
436 {
437  // Preconditions:
438 
439  require(contains(xlocal_id));
440 
441  // Body:
442 
443  pod_type result = 0;
444 
445  // Postconditions:
446 
447  ensure(is_basic_query);
448 
449  // Exit:
450 
451  return result;
452 }
453 
456 end(pod_type xlocal_id) const
457 {
458  // Preconditions:
459 
460  require(contains(xlocal_id));
461 
462  // Body:
463 
464  pod_type result = 4;
465 
466  // Postconditions:
467 
468  ensure(is_basic_query);
469 
470  // Exit:
471 
472  return result;
473 }
474 
475 bool
477 contains(pod_type xlocal_id, pod_type xid) const
478 {
479  // Preconditions:
480 
481  require(contains(xlocal_id));
482 
483  // Body:
484 
485  bool result = (0 <= xid) && (xid < 4);
486 
487  // Postconditions:
488 
489  ensure(is_basic_query);
490 
491  // Exit:
492 
493  return result;
494 }
495 
496 bool
499 {
500  // Preconditions:
501 
502  require(contains(xlocal_id));
503 
504  // Body:
505 
506  pod_type result;
507  pod_type loffset = xid - vertex_hub_begin(xlocal_id);
508 
509  if(loffset >= _j_vertex_size)
510  {
511  // i+1.
512 
513  loffset -= _j_vertex_size;
514  result = ((0 <= loffset) && (loffset < 2));
515  }
516  else
517  {
518  // i.
519 
520  result = ((0 <= loffset) && (loffset < 2));
521  }
522 
523  // Postconditions:
524 
525  ensure(is_basic_query);
526 
527  // Exit:
528 
529  return result;
530 }
531 
532 bool
534 contains(pod_type xlocal_id, pod_type xid, pod_type xhub_id) const
535 {
536  // Preconditions:
537 
538  require(contains(xlocal_id));
539 
540  // Body:
541 
542  bool result = is_valid(xhub_id) && (hub_pod(xlocal_id, xid) == xhub_id);
543 
544  // Postconditions:
545 
546  ensure(is_basic_query);
547 
548  // Exit:
549 
550  return result;
551 }
552 
555 pod(pod_type xlocal_id, pod_type xid) const
556 {
557  // Preconditions:
558 
559  require(contains(xlocal_id));
560 
561  // Body:
562 
563  pod_type result;
564  pod_type loffset = xid - vertex_hub_begin(xlocal_id);
565 
566  if(loffset >= _j_vertex_size)
567  {
568  // i+1.
569 
570  loffset -= _j_vertex_size;
571  if(loffset == 0)
572  {
573  // Vertex (i+1, j)
574 
575  result = 1;
576  }
577  else if(loffset == 1)
578  {
579  // Vertex (i+1, j+1)
580 
581  result = 2;
582  }
583  else
584  {
585  // Not a valid range id.
586 
587  result = invalid_pod_index();
588  }
589  }
590  else
591  {
592  // i
593 
594  if(loffset == 0)
595  {
596  // Vertex (i, j)
597 
598  result = 0;
599  }
600  else if(loffset == 1)
601  {
602  // Vertex (i, j+1)
603 
604  result = 3;
605  }
606  else
607  {
608  // Not a valid range id.
609 
610  result = invalid_pod_index();
611  }
612  }
613 
614  // Postconditions:
615 
616  ensure(!is_valid(result) || contains(xlocal_id, result));
617 
618  // Exit:
619 
620  return result;
621 }
622 
625 unglued_hub_pod(pod_type xlocal_id, pod_type xid) const
626 {
627  // Preconditions:
628 
629  require(contains(xlocal_id));
630 
631  // Body:
632 
633  pod_type result = vertex_hub_begin(xlocal_id);
634 
635  switch(xid)
636  {
637  case 0:
638  {
639  // vertex (0, 0)
640 
641  break;
642  }
643  case 1:
644  {
645  // vertex (1, 0)
646 
647  result += _j_vertex_size;
648  break;
649  }
650  case 2:
651  {
652  // vertex (1, 1)
653 
654  result += _j_vertex_size + 1;
655  break;
656  }
657  case 3:
658  {
659  // vertex (0, 1)
660 
661  result += 1;
662  break;
663  }
664  default:
665  {
666  result = invalid_pod_index();
667  break;
668  }
669  }
670 
671  // Postconditions:
672 
673  ensure(!is_valid(result) || contains_unglued_hub(xlocal_id, result));
674 
675  // Exit:
676 
677  return result;
678 }
679 
680 bool
682 is_persistent(pod_type xlocal_id) const
683 {
684  // Preconditions:
685 
686  require(contains(xlocal_id));
687 
688  // Body:
689 
690  bool result = false;
691 
692  // Postconditions:
693 
694  ensure(is_basic_query);
695 
696  // Exit:
697 
698  return result;
699 }
700 
701 // PROTECTED MEMBER FUNCTIONS
702 
703 // PRIVATE MEMBER FUNCTIONS
704 
705 
706 // ===========================================================
707 // PRODUCT STRUCTURE FACET
708 // ===========================================================
709 
710 // PUBLIC MEMBER FUNCTIONS
711 
712 void
715  const abstract_product_structure& xproduct)
716 {
717  // Preconditions:
718 
719  require(contains(xlocal_id));
720 
721  // Body:
722 
724 
725  not_implemented();
726 
727  // Postconditions:
728 
729  ensure(has_product_structure(xlocal_id));
730 
731  // Exit:
732 
733  return;
734 }
735 
736 void
739 {
740  // Preconditions:
741 
742  require(contains(xlocal_id));
743 
744  // Body:
745 
747 
748  not_implemented();
749 
750  // Postconditions:
751 
752  ensure(!has_product_structure(xlocal_id));
753 
754  // Exit:
755 
756  return;
757 }
758 
761 product_structure(pod_type xlocal_id) const
762 {
763  // Preconditions:
764 
765  require(contains(xlocal_id));
766  require(has_product_structure(xlocal_id));
767 
768  // Body:
769 
771 
772  const abstract_product_structure* result = 0; // Just to silence compiler warnings.
773 
774  not_implemented();
775 
776  // Postconditions:
777 
778  ensure(is_basic_query);
779 
780  // Exit:
781 
782  return *result;
783 }
784 
788 {
789  // Preconditions:
790 
791  require(contains(xlocal_id));
792  require(has_product_structure(xlocal_id));
793 
794  // Body:
795 
797 
798  abstract_product_structure* result = 0; // Just to silence compiler warnings.
799 
800  not_implemented();
801 
802  // Postconditions:
803 
804  ensure(is_basic_query);
805 
806  // Exit:
807 
808  return *result;
809 }
810 
811 bool
814 {
815  // Preconditions:
816 
817  require(contains(xlocal_id));
818 
819  // Body:
820 
822 
823  bool result = false; // Just to silence compiler warnings.
824 
825  not_implemented();
826 
827  // Postconditions:
828 
829  ensure(is_basic_query);
830 
831  // Exit:
832 
833  return result;
834 }
835 
836 // PROTECTED MEMBER FUNCTIONS
837 
838 // PRIVATE MEMBER FUNCTIONS
839 
840 
841 // ===========================================================
842 // HANDLE POOL FACET
843 // ===========================================================
844 
845 // PUBLIC MEMBER FUNCTIONS
846 
849 get_id_space(pod_type xlocal_id) const
850 {
851  // Preconditions:
852 
853  require(contains(xlocal_id));
854 
855  // Body:
856 
857  index_space_handle& result = _handles.get();
858  result.attach_to(*this, xlocal_id);
859 
860  // Postconditions:
861 
862  ensure(result.is_attached());
863 
864  // Exit:
865 
866  return result;
867 }
868 
869 void
872 {
873  // Preconditions:
874 
875  require(allocated_id_space(xid_space));
876 
877  // Body:
878 
879  // Detach the handle.
880 
881  xid_space.detach();
882 
883  // Release the handle to the pool.
884 
885  _handles.release(reinterpret_cast<forwarding_index_space_handle&>(xid_space));
886 
887  // Postconditions:
888 
889  ensure(is_basic_query);
890 
891  // Exit:
892 
893  return;
894 }
895 
896 bool
898 allocated_id_space(const index_space_handle& xid_space) const
899 {
900  // Preconditions:
901 
902  // Body:
903 
904  const forwarding_index_space_handle* lid_space =
905  dynamic_cast<const forwarding_index_space_handle*>(&xid_space);
906 
907  bool result = (lid_space != 0) && _handles.allocated(*lid_space);
908 
909  // Postconditions:
910 
911  ensure(is_basic_query);
912 
913  // Exit:
914 
915  return result;
916 }
917 
918 // PROTECTED MEMBER FUNCTIONS
919 
920 // PRIVATE MEMBER FUNCTIONS
921 
922 
923 // ===========================================================
924 // ITERATOR POOL FACET
925 // ===========================================================
926 
927 // PUBLIC MEMBER FUNCTIONS
928 
932 {
933  // Preconditions:
934 
935  require(contains(xlocal_id));
936 
937  // Body:
938 
939  index_space_iterator& result = _iterators.get();
940  result.attach_to(*this, xlocal_id);
941 
942  // Postconditions:
943 
944  ensure(result.is_attached());
945 
946  // Exit:
947 
948  return result;
949 }
950 
951 void
954 {
955  // Preconditions:
956 
957  require(allocated_id_space_iterator(xitr));
958 
959  // Body:
960 
961  // Detach the iterator.
962 
963  xitr.detach();
964 
965  // Release the iterator to the pool.
966 
967  _iterators.release(reinterpret_cast<ij_connectivity_implicit_index_space_iterator&>(xitr));
968 
969  // Postconditions:
970 
971  ensure(is_basic_query);
972 
973  // Exit:
974 
975  return;
976 }
977 
978 bool
981 {
982  // Preconditions:
983 
984  // Body:
985 
987  dynamic_cast<const ij_connectivity_implicit_index_space_iterator*>(&xitr);
988 
989  bool result = (litr != 0) && _iterators.allocated(*litr);
990 
991  // Postconditions:
992 
993  ensure(is_basic_query);
994 
995  // Exit:
996 
997  return result;
998 }
999 
1000 // PROTECTED MEMBER FUNCTIONS
1001 
1002 // PRIVATE MEMBER FUNCTIONS
1003 
1004 
1005 // ===========================================================
1006 // ANY FACET
1007 // ===========================================================
1008 
1009 // PUBLIC MEMBER FUNCTIONS
1010 
1011 bool
1013 is_ancestor_of(const any *other) const
1014 {
1015  // Preconditions:
1016 
1017  require(other != 0);
1018 
1019  // Body:
1020 
1021  // True if other conforms to this
1022 
1023  bool result = dynamic_cast<const ij_connectivity_index_space_interval*>(other) != 0;
1024 
1025  // Postconditions:
1026 
1027  // Exit:
1028 
1029  return result;
1030 }
1031 
1032 bool
1034 invariant() const
1035 {
1036  bool result = true;
1037 
1038  if(invariant_check())
1039  {
1040  // Prevent recursive calls to invariant
1041 
1043 
1044  // Must satisfy base class invariant
1045 
1046  invariance(index_space_interval::invariant());
1047 
1048  // Invariances for this class:
1049 
1050  // Finished, turn invariant checking back on.
1051 
1053  }
1054 
1055  // Exit
1056 
1057  return result;
1058 }
1059 
1060 // PROTECTED MEMBER FUNCTIONS
1061 
1062 // PRIVATE MEMBER FUNCTIONS
1063 
1064 
1065 // ===========================================================
1066 // NON-MEMBER FUNCTIONS
1067 // ===========================================================
1068 
1069 size_t
1070 fiber_bundle::
1071 deep_size(const ij_connectivity_index_space_interval& xn, bool xinclude_shallow)
1072 {
1073  // Preconditions:
1074 
1075  // Body:
1076 
1077  size_t result = xinclude_shallow ? sizeof(xn) : 0;
1078 
1079  // Add contributions for _handles.
1080 
1081  result += deep_size(xn._handles, false);
1082 
1083  // Add contributions for _iterators.
1084 
1085  result += deep_size(xn._iterators, false);
1086 
1087  // Postconditions:
1088 
1089  ensure(result >= 0);
1090 
1091  // Exit
1092 
1093  return result;
1094 }
friend SHEAF_DLL_SPEC size_t deep_size(const ij_connectivity_index_space_interval &xn, bool xinclude_shallow)
The deep size of ij_connectivity_index_space_interval& xn.
virtual void release_id_space(index_space_handle &xid_space) const
Returns the id space handle xid_space to the handle pool.
pod_type end() const
The ending index of the id spaces.
virtual bool allocated_id_space_iterator(const index_space_iterator &xitr) const
True if and only if id space iterator xitr was allocated by the iterator pool.
pod_type vertex_hub_begin() const
The hub id of the beginning of the vertex id space.
An abstract class that defines the product structure for an id space.
virtual const index_space_family & id_spaces() const
The id space family for this (const version).
An abstract iterator over the ids of an id space.
virtual pod_type unglued_hub_pod(pod_type xlocal_id, pod_type xid) const
The pod index in the unglued_hub id space equivalent to xid in the id space with id xlocal_id...
size_type _j_size
The number of zones in the j direction.
virtual index_space_iterator & get_id_space_iterator(pod_type xlocal_id) const
Allocates an id space iterator from the iterator pool attached to state with id xlocal_id.
virtual void release_id_space_iterator(index_space_iterator &xitr) const
Returns the id space iterator xitr to the iterator pool.
pod_index_type ordinal(pod_index_type xi, pod_index_type xj, size_type xj_ub)
2-tuple to ordinal conversion.
virtual index_space_interval & operator=(const index_space_collection &xother)
Assignment operator.
virtual bool invariant() const
Class invariant.
virtual size_type ct(pod_type xlocal_id) const
The number of members for the id space with id xlocal_id.
STL namespace.
virtual void detach()=0
Detach this handle form its state, if any.
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
virtual bool operator==(const index_space_collection &xother) const
True if this is equivalent to xother.
virtual pod_type begin(pod_type xlocal_id) const
Beginning id of this space with id xlocal_id.
pod_index_type pod_type
The "plain old data" index type for this.
virtual bool is_attached() const =0
True if this handle is attached to a state.
virtual void detach()=0
Detach this handle form its state, if any.
size_type j_vertex_size() const
The number of vertices in the j direction.
size_type _j_vertex_size
The number of vertices in the j direction.
virtual ij_connectivity_index_space_interval & operator=(const index_space_collection &xother)
Assignment operator.
list_pool< forwarding_index_space_handle > _handles
The handle pool.
Abstract base class with useful features for all objects.
Definition: any.h:39
An implemenation of index_space_collection that adds an interface for the interval [begin()...
size_type j_size() const
The number of zones in the j direction.
virtual pod_type pod(pod_type xlocal_id, pod_type xid) const
The pod index in the space with id xlocal_id equivalent to xid in the hub id space.
An immutable abstract state for a space of alternate integer identifiers (aliases) for a subset of th...
virtual bool contains_unglued_hub(pod_type xlocal_id, pod_type xid) const
True if the space with id xlocal_id contains an id equivalent to xid in the unglued hub id space...
virtual bool operator==(const index_space_collection &xother) const
True if this is equivalent to xother.
An implementation of class index_space_handle for an forwarding_index_space_state.
void attach_to(const index_space_family &xid_spaces, pod_type xindex)
Attach to the state with index xindex in the id space family xid_spaces.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
An implementation of index_space_interval for an interval of implicit id spaces for the connectivity ...
static const ij_connectivity_index_space_interval & new_space(index_space_family &xid_spaces, size_type xub, pod_type xvertex_hub_begin, size_type xj_size)
Create a new interval of id spaces for 2D structured block connectivity in the id space family xid_sp...
virtual bool allocated_id_space(const index_space_handle &xid_space) const
True if and only if id space handle xid_space was allocated by the handle pool.
virtual explicit_index_space_state * explicit_state(pod_type xlocal_id) const
The explicit id space state for id xlocal_id. Returns null if there is no explicit id space for xloca...
A collection of id space states. This is a virtual class with provides an interface for accessing the...
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 new_product_structure(pod_type xlocal_id, const abstract_product_structure &xproduct)
Creates a new product structure for the id space with id xlocal_id by cloning the product structure...
void attach_to(const index_space_family &xid_spaces, pod_type xindex)
Attach to the state with index xindex in the id space family xid_spaces.
list_pool< ij_connectivity_implicit_index_space_iterator > _iterators
The iterator pool.
static factory< index_space_interval > & id_space_interval_factory()
A factory for making descendants of this class.
pod_type _vertex_hub_begin
The hub id of the beginning of the vertex id space.
SHEAF_DLL_SPEC size_t deep_size(const sec_vd &x0, bool xinclude_shallow=true)
The deep size of the referenced object of type sec_vd. if xinclude_shallow, add the sizeof x0 to the ...
Definition: sec_vd.cc:1448
virtual ij_connectivity_index_space_interval * clone() const
Virtual constructor; create a new instance of the same type at this.
virtual pod_type end(pod_type xlocal_id) const
Ending id of this space with id xlocal_id.
An implementation of implicit_index_space_iterator for an implicit id space in an ij_connectivity_ind...
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
virtual bool is_persistent(pod_type xlocal_id) const
True if the id space with id xlocal_id should be written to disk.
virtual bool is_attached() const =0
True if this iterator is attached to a state.
bool invariant_check() const
True if invariant checking is enabled.
Definition: any.h:79
virtual bool has_product_structure(pod_type xlocal_id) const
True if the id space with id xlocal_id has a product structure.
virtual index_space_handle & get_id_space(pod_type xlocal_id) const
Allocates an id space handle from the handle pool attached to state with id xlocal_id.
virtual bool contains(pod_type xlocal_id, pod_type xid) const
True if the space with id xlocal_id contains id xid.
pod_type end() const
Ending space id of this interval in the id space family scope.
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 remove(pod_type xlocal_id)
Remove the id space with id xlocal_id.
Factory and container for a family of id spaces.
pod_type hub_pod(pod_type xlocal_id, pod_type xid) const
The pod index in the glued hub id space equivalent to xid in the id space with id xlocal_id...
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.
pod_type begin() const
Beginning space id of this interval in the id space family scope.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
Definition: pod_types.cc:31
bool is_same_type(const any *other) const
True if other is the same type as this.
Definition: any.cc:79
void enable_invariant_check() const
Enable invariant checking.
Definition: any.h:87
virtual void delete_product_structure(pod_type xlocal_id)
Deletes the product structure for the id space with id xlocal_id.
const hub_index_space_handle & hub_id_space() const
The hub id space of this family.
virtual bool contains(pod_type xid) const
True if this space contains id xid.
virtual const std::string & class_name() const
The name of this class.
virtual const abstract_product_structure & product_structure(pod_type xlocal_id) const
The product structure for the id space with id xlocal_id (const version).