SheafSystem  0.0.0.0
i_adjacency_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/i_adjacency_index_space_interval.h"
22 
23 #include "SheafSystem/abstract_product_structure.h"
24 #include "SheafSystem/assert_contract.h"
25 #include "SheafSystem/i_adjacency_implicit_index_space_iterator.h"
26 #include "SheafSystem/forwarding_index_space_handle.h"
27 #include "SheafSystem/explicit_index_space_state.h"
28 #include "SheafSystem/hub_index_space_handle.h"
29 #include "SheafSystem/index_space_family.h"
30 
31 using namespace std;
32 using namespace fiber_bundle; // Workaround for MS C++ bug.
33 
34 // ===========================================================
35 // SPACE FACTORY FACET
36 // ===========================================================
37 
38 // PUBLIC MEMBER FUNCTIONS
39 
43  size_type xub,
44  pod_type xzone_hub_begin,
45  size_type xi_size)
46 {
47  // Preconditions:
48 
49  require(xub > 0);
50  require(xid_spaces.hub_id_space().contains(xzone_hub_begin));
51  require(xi_size > 0);
52 
53  // Body:
54 
55  define_old_variable(size_type old_id_spaces_end = xid_spaces.end());
56 
58  result_ptr->new_state(xid_spaces, xub);
59 
60  result_ptr->_zone_hub_begin = xzone_hub_begin;
61  result_ptr->_i_size = xi_size;
62 
63  const i_adjacency_index_space_interval& result = *result_ptr;
64 
65  // Postconditions:
66 
67  ensure(&result.id_spaces() == &xid_spaces);
68  ensure(result.begin() == old_id_spaces_end);
69  ensure(result.end() == xid_spaces.end());
70  ensure(result.end() == result.begin() + xub);
71 
72  ensure(result.zone_hub_begin() == xzone_hub_begin);
73  ensure(result.i_size() == xi_size);
74 
75  // Exit:
76 
77  return result;
78 }
79 
80 // PROTECTED MEMBER FUNCTIONS
81 
82 // PRIVATE MEMBER FUNCTIONS
83 
84 
85 // ===========================================================
86 // I_ADJACENCY_INDEX_SPACE_INTERVAL FACET
87 // ===========================================================
88 
89 // PUBLIC MEMBER FUNCTIONS
90 
93 {
94  // Preconditions:
95 
96  // Body:
97 
98  // Nothing to do.
99 
100  // Postconditions:
101 
102  // Exit:
103 
104  return;
105 }
106 
110 {
111  // Preconditions:
112 
113  // Body:
114 
115  // Postconditions:
116 
117  ensure(is_basic_query);
118 
119  // Exit:
120 
121  return _zone_hub_begin;
122 }
123 
126 zone_hub_begin(pod_type xlocal_id) const
127 {
128  // Preconditions:
129 
130  require(contains(xlocal_id));
131 
132  // Body:
133 
134  pod_type result = xlocal_id + _zone_hub_begin;
135 
136  if(xlocal_id > 0)
137  {
138  result -= 1;
139  }
140 
141  // Postconditions:
142 
143  ensure(result >= zone_hub_begin());
144 
145  // Exit:
146 
147  return result;
148 }
149 
150 void
153  pod_type& xzone_hub_begin,
154  size_type& xi_ct) const
155 {
156  // Preconditions:
157 
158  require(contains(xlocal_id));
159 
160  // Body:
161 
162  // Calculate the first adjacent zone id and the number of adjacent
163  // zones in the i and j directions.
164 
165  xi_ct = 0;
166  xzone_hub_begin = xlocal_id + _zone_hub_begin;
167 
168  if(xlocal_id > 0)
169  {
170  xi_ct++;
171  xzone_hub_begin -= 1;
172  }
173 
174  if(xlocal_id < _i_size)
175  {
176  xi_ct++;
177  }
178 
179  // Postconditions:
180 
181  ensure(xzone_hub_begin >= zone_hub_begin());
182  ensure((0 < xi_ct) && (xi_ct <= 2));
183 
184  // Exit:
185 
186  return;
187 }
188 
191 i_size() const
192 {
193  // Preconditions:
194 
195  // Body:
196 
197  // Postconditions:
198 
199  ensure(is_basic_query);
200 
201  // Exit:
202 
203  return _i_size;
204 }
205 
206 // PROTECTED MEMBER FUNCTIONS
207 
211 {
212  // Preconditions:
213 
214  // Body:
215 
216  // Postconditions:
217 
218  ensure(invariant());
219 
220  // Exit:
221 
222  return;
223 }
224 
225 // PRIVATE MEMBER FUNCTIONS
226 
227 
228 // ===========================================================
229 // INDEX_SPACE_INTERVAL FACET
230 // ===========================================================
231 
232 // PUBLIC MEMBER FUNCTIONS
233 
234 // PROTECTED MEMBER FUNCTIONS
235 
236 // PRIVATE MEMBER FUNCTIONS
237 
238 
239 // ===========================================================
240 // FACTORY FACET
241 // ===========================================================
242 
243 // PUBLIC MEMBER FUNCTIONS
244 
245 const std::string&
247 class_name() const
248 {
249  static const string result("i_adjacency_index_space_interval");
250  return result;
251 }
252 
255 clone() const
256 {
257  // Preconditions:
258 
259  // Body:
260 
263 
264  // Postconditions:
265 
266  ensure(result != 0);
267  ensure(is_same_type(result));
268 
269  // Exit:
270 
271  return result;
272 }
273 
274 // PROTECTED MEMBER FUNCTIONS
275 
276 // PRIVATE MEMBER FUNCTIONS
277 
278 bool
279 fiber_bundle::i_adjacency_index_space_interval::
280 make_prototype()
281 {
282  // Preconditions:
283 
284  // Body:
285 
287 
288  id_space_interval_factory().insert_prototype(lproto);
289 
290  // Postconditions:
291 
292  // Exit:
293 
294  return true;
295 }
296 
297 
298 // ===========================================================
299 // INDEX_SPACE_COLLECTION FACET
300 // ===========================================================
301 
302 // PUBLIC MEMBER FUNCTIONS
303 
304 bool
306 operator==(const index_space_collection& xother) const
307 {
308  // Preconditions:
309 
310  require(is_ancestor_of(&xother));
311 
312  // Body:
313 
314  const i_adjacency_index_space_interval& lother =
315  dynamic_cast<const i_adjacency_index_space_interval&>(xother);
316 
317  bool result = index_space_interval::operator==(xother);
318 
319  result = result && (_zone_hub_begin == lother._zone_hub_begin);
320  result = result && (_i_size == lother._i_size);
321 
322  // Postconditions:
323 
324  // Exit
325 
326  return result;
327 }
328 
331 deep_size(bool xinclude_shallow) const
332 {
333  // Preconditions:
334 
335  // Body:
336 
337  size_type result = fiber_bundle::deep_size(*this, xinclude_shallow);
338 
339  // Postconditions:
340 
341  ensure(result >= 0);
342 
343  // Exit:
344 
345  return result;
346 }
347 
348 // PROTECTED MEMBER FUNCTIONS
349 
353 {
354  // Preconditions:
355 
356  require(is_ancestor_of(&xother));
357 
358  // Body:
359 
360  const i_adjacency_index_space_interval& lother =
361  dynamic_cast<const i_adjacency_index_space_interval&>(xother);
362 
364  _i_size = lother._i_size;
365 
367 
368  // Postconditions:
369 
370  ensure(invariant());
371  ensure((*this) == xother);
372 
373  // Exit:
374 
375  return *this;
376 }
377 
380 explicit_state(pod_type xlocal_id) const
381 {
382  // Preconditions:
383 
384  // Body:
385 
387 
388  explicit_index_space_state* result = 0;
389 
390  // Postconditions:
391 
392  ensure(is_basic_query);
393 
394  // Exit:
395 
396  return result;
397 }
398 
399 // PRIVATE MEMBER FUNCTIONS
400 
401 
402 // ===========================================================
403 // INDEX SPACE FACET
404 // ===========================================================
405 
406 // PUBLIC MEMBER FUNCTIONS
407 
408 void
410 remove(pod_type xlocal_id)
411 {
412  // Preconditions:
413 
414  // Body:
415 
417 
418  not_implemented();
419 
420  // Postconditions:
421 
422  ensure(!contains(xlocal_id));
423 
424  // Exit:
425 
426  return;
427 }
428 
431 ct(pod_type xlocal_id) const
432 {
433  // Preconditions:
434 
435  require(contains(xlocal_id));
436 
437  // Body:
438 
439  // Determine if this vertex is adjacent to 1 or 2 zones.
440 
441  pod_type result = (xlocal_id > 0 && xlocal_id < _i_size) ? 2 : 1;
442 
443  // Postconditions:
444 
445  ensure(is_basic_query);
446 
447  // Exit:
448 
449  return result;
450 }
451 
454 begin(pod_type xlocal_id) const
455 {
456  // Preconditions:
457 
458  require(contains(xlocal_id));
459 
460  // Body:
461 
462  pod_type result = 0;
463 
464  // Postconditions:
465 
466  ensure(is_basic_query);
467 
468  // Exit:
469 
470  return result;
471 }
472 
475 end(pod_type xlocal_id) const
476 {
477  // Preconditions:
478 
479  require(contains(xlocal_id));
480 
481  // Body:
482 
483  pod_type result = ct(xlocal_id);
484 
485  // Postconditions:
486 
487  ensure(is_basic_query);
488 
489  // Exit:
490 
491  return result;
492 }
493 
494 bool
496 contains(pod_type xlocal_id, pod_type xid) const
497 {
498  // Preconditions:
499 
500  require(contains(xlocal_id));
501 
502  // Body:
503 
504  bool result = (0 <= xid) && (xid < end(xlocal_id));
505 
506  // Postconditions:
507 
508  ensure(is_basic_query);
509 
510  // Exit:
511 
512  return result;
513 }
514 
515 bool
518 {
519  // Preconditions:
520 
521  require(contains(xlocal_id));
522 
523  // Body:
524 
525  // Compute the adjacent values.
526 
527  pod_type lzone_hub_begin;
528  size_type li_ct;
529 
530  adjacent_zones(xlocal_id, lzone_hub_begin, li_ct);
531 
532  // Calculate the zone id relative to the first adjacent zone
533  // adjacent to vertex xlocal_id.
534 
535  pod_type i = (xid - lzone_hub_begin);
536 
537  bool result = ((0 <= i) && (i < li_ct));
538 
539  // Postconditions:
540 
541  ensure(is_basic_query);
542 
543  // Exit:
544 
545  return result;
546 }
547 
548 bool
550 contains(pod_type xlocal_id, pod_type xid, pod_type xhub_id) const
551 {
552  // Preconditions:
553 
554  require(contains(xlocal_id));
555 
556  // Body:
557 
558  bool result = is_valid(xhub_id) && (hub_pod(xlocal_id, xid) == xhub_id);
559 
560  // Postconditions:
561 
562  ensure(is_basic_query);
563 
564  // Exit:
565 
566  return result;
567 }
568 
571 pod(pod_type xlocal_id, pod_type xid) const
572 {
573  // Preconditions:
574 
575  require(contains(xlocal_id));
576 
577  // Body:
578 
579  // Compute the adjacent values.
580 
581  pod_type lzone_hub_begin;
582  size_type li_ct;
583 
584  adjacent_zones(xlocal_id, lzone_hub_begin, li_ct);
585 
586  // Calculate the zone id relative to the first adjacent zone
587  // adjacent to vertex xlocal_id.
588 
589  pod_type i = (xid - lzone_hub_begin);
590 
591  // Compute pod.
592 
593  pod_type result = ((0 <= i) && (i < li_ct)) ? i : invalid_pod_index();
594 
595  // Postconditions:
596 
597  ensure(!is_valid(result) || contains(xlocal_id, result));
598 
599  // Exit:
600 
601  return result;
602 }
603 
606 unglued_hub_pod(pod_type xlocal_id, pod_type xid) const
607 {
608  // Preconditions:
609 
610  require(contains(xlocal_id));
611 
612  // Body:
613 
614  // Compute the adjacent values.
615 
616  pod_type lzone_hub_begin;
617  size_type li_ct;
618 
619  adjacent_zones(xlocal_id, lzone_hub_begin, li_ct);
620 
621  // Compute the hub pod.
622 
623  pod_type result =
624  ((0 <= xid) && (xid < li_ct)) ? lzone_hub_begin + xid : invalid_pod_index();
625 
626  // Postconditions:
627 
628  ensure(!is_valid(result) || contains_unglued_hub(xlocal_id, result));
629 
630  // Exit:
631 
632  return result;
633 }
634 
635 bool
637 is_persistent(pod_type xlocal_id) const
638 {
639  // Preconditions:
640 
641  require(contains(xlocal_id));
642 
643  // Body:
644 
645  bool result = false;
646 
647  // Postconditions:
648 
649  ensure(is_basic_query);
650 
651  // Exit:
652 
653  return result;
654 }
655 
656 // PROTECTED MEMBER FUNCTIONS
657 
658 // PRIVATE MEMBER FUNCTIONS
659 
660 
661 // ===========================================================
662 // PRODUCT STRUCTURE FACET
663 // ===========================================================
664 
665 // PUBLIC MEMBER FUNCTIONS
666 
667 void
670  const abstract_product_structure& xproduct)
671 {
672  // Preconditions:
673 
674  require(contains(xlocal_id));
675 
676  // Body:
677 
679 
680  not_implemented();
681 
682  // Postconditions:
683 
684  ensure(has_product_structure(xlocal_id));
685 
686  // Exit:
687 
688  return;
689 }
690 
691 void
694 {
695  // Preconditions:
696 
697  require(contains(xlocal_id));
698 
699  // Body:
700 
702 
703  not_implemented();
704 
705  // Postconditions:
706 
707  ensure(!has_product_structure(xlocal_id));
708 
709  // Exit:
710 
711  return;
712 }
713 
716 product_structure(pod_type xlocal_id) const
717 {
718  // Preconditions:
719 
720  require(contains(xlocal_id));
721  require(has_product_structure(xlocal_id));
722 
723  // Body:
724 
726 
727  const abstract_product_structure* result = 0; // Just to silence compiler warnings.
728 
729  not_implemented();
730 
731  // Postconditions:
732 
733  ensure(is_basic_query);
734 
735  // Exit:
736 
737  return *result;
738 }
739 
743 {
744  // Preconditions:
745 
746  require(contains(xlocal_id));
747  require(has_product_structure(xlocal_id));
748 
749  // Body:
750 
752 
753  abstract_product_structure* result = 0; // Just to silence compiler warnings.
754 
755  not_implemented();
756 
757  // Postconditions:
758 
759  ensure(is_basic_query);
760 
761  // Exit:
762 
763  return *result;
764 }
765 
766 bool
769 {
770  // Preconditions:
771 
772  require(contains(xlocal_id));
773 
774  // Body:
775 
777 
778  bool result = false; // Just to silence compiler warnings.
779 
780  not_implemented();
781 
782  // Postconditions:
783 
784  ensure(is_basic_query);
785 
786  // Exit:
787 
788  return result;
789 }
790 
791 // PROTECTED MEMBER FUNCTIONS
792 
793 // PRIVATE MEMBER FUNCTIONS
794 
795 
796 // ===========================================================
797 // HANDLE POOL FACET
798 // ===========================================================
799 
800 // PUBLIC MEMBER FUNCTIONS
801 
804 get_id_space(pod_type xlocal_id) const
805 {
806  // Preconditions:
807 
808  require(contains(xlocal_id));
809 
810  // Body:
811 
812  index_space_handle& result = _handles.get();
813  result.attach_to(*this, xlocal_id);
814 
815  // Postconditions:
816 
817  ensure(result.is_attached());
818 
819  // Exit:
820 
821  return result;
822 }
823 
824 void
827 {
828  // Preconditions:
829 
830  require(allocated_id_space(xid_space));
831 
832  // Body:
833 
834  // Detach the handle.
835 
836  xid_space.detach();
837 
838  // Release the handle to the pool.
839 
840  _handles.release(reinterpret_cast<forwarding_index_space_handle&>(xid_space));
841 
842  // Postconditions:
843 
844  ensure(is_basic_query);
845 
846  // Exit:
847 
848  return;
849 }
850 
851 bool
853 allocated_id_space(const index_space_handle& xid_space) const
854 {
855  // Preconditions:
856 
857  // Body:
858 
859  const forwarding_index_space_handle* lid_space =
860  dynamic_cast<const forwarding_index_space_handle*>(&xid_space);
861 
862  bool result = (lid_space != 0) && _handles.allocated(*lid_space);
863 
864  // Postconditions:
865 
866  ensure(is_basic_query);
867 
868  // Exit:
869 
870  return result;
871 }
872 
873 // PROTECTED MEMBER FUNCTIONS
874 
875 // PRIVATE MEMBER FUNCTIONS
876 
877 
878 // ===========================================================
879 // ITERATOR POOL FACET
880 // ===========================================================
881 
882 // PUBLIC MEMBER FUNCTIONS
883 
887 {
888  // Preconditions:
889 
890  require(contains(xlocal_id));
891 
892  // Body:
893 
894  index_space_iterator& result = _iterators.get();
895  result.attach_to(*this, xlocal_id);
896 
897  // Postconditions:
898 
899  ensure(result.is_attached());
900 
901  // Exit:
902 
903  return result;
904 }
905 
906 void
909 {
910  // Preconditions:
911 
912  require(allocated_id_space_iterator(xitr));
913 
914  // Body:
915 
916  // Detach the iterator.
917 
918  xitr.detach();
919 
920  // Release the iterator to the pool.
921 
922  _iterators.release(reinterpret_cast<i_adjacency_implicit_index_space_iterator&>(xitr));
923 
924  // Postconditions:
925 
926  ensure(is_basic_query);
927 
928  // Exit:
929 
930  return;
931 }
932 
933 bool
936 {
937  // Preconditions:
938 
939  // Body:
940 
942  dynamic_cast<const i_adjacency_implicit_index_space_iterator*>(&xitr);
943 
944  bool result = (litr != 0) && _iterators.allocated(*litr);
945 
946  // Postconditions:
947 
948  ensure(is_basic_query);
949 
950  // Exit:
951 
952  return result;
953 }
954 
955 // PROTECTED MEMBER FUNCTIONS
956 
957 // PRIVATE MEMBER FUNCTIONS
958 
959 
960 // ===========================================================
961 // ANY FACET
962 // ===========================================================
963 
964 // PUBLIC MEMBER FUNCTIONS
965 
966 bool
968 is_ancestor_of(const any *other) const
969 {
970  // Preconditions:
971 
972  require(other != 0);
973 
974  // Body:
975 
976  // True if other conforms to this
977 
978  bool result = dynamic_cast<const i_adjacency_index_space_interval*>(other) != 0;
979 
980  // Postconditions:
981 
982  // Exit:
983 
984  return result;
985 }
986 
987 bool
989 invariant() const
990 {
991  bool result = true;
992 
993  if(invariant_check())
994  {
995  // Prevent recursive calls to invariant
996 
998 
999  // Must satisfy base class invariant
1000 
1001  invariance(index_space_interval::invariant());
1002 
1003  // Invariances for this class:
1004 
1005  // Finished, turn invariant checking back on.
1006 
1008  }
1009 
1010  // Exit
1011 
1012  return result;
1013 }
1014 
1015 // PROTECTED MEMBER FUNCTIONS
1016 
1017 // PRIVATE MEMBER FUNCTIONS
1018 
1019 
1020 // ===========================================================
1021 // NON-MEMBER FUNCTIONS
1022 // ===========================================================
1023 
1024 size_t
1025 fiber_bundle::
1026 deep_size(const i_adjacency_index_space_interval& xn, bool xinclude_shallow)
1027 {
1028  // Preconditions:
1029 
1030  // Body:
1031 
1032  size_t result = xinclude_shallow ? sizeof(xn) : 0;
1033 
1034  // Add contributions for _handles.
1035 
1036  result += deep_size(xn._handles, false);
1037 
1038  // Add contributions for _iterators.
1039 
1040  result += deep_size(xn._iterators, false);
1041 
1042  // Postconditions:
1043 
1044  ensure(result >= 0);
1045 
1046  // Exit
1047 
1048  return result;
1049 }
pod_type end() const
The ending index of the id spaces.
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.
An implementation of implicit_index_space_iterator for an implicit id space in an i_adjacency_index_s...
pod_type zone_hub_begin() const
The hub id of the beginning of the zone id space.
virtual size_type ct(pod_type xlocal_id) const
The number of members for the id space with id xlocal_id.
virtual index_space_interval & operator=(const index_space_collection &xother)
Assignment operator.
virtual bool invariant() const
Class invariant.
An implementation of index_space_interval for an interval of implicit id spaces for the adjacency of ...
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.
pod_index_type pod_type
The "plain old data" index type for this.
virtual void remove(pod_type xlocal_id)
Remove the id space with id xlocal_id.
virtual void release_id_space(index_space_handle &xid_space) const
Returns the id space handle xid_space to the handle pool.
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...
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.
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 i_adjacency_index_space_interval & operator=(const index_space_collection &xother)
Assignment operator.
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()...
virtual pod_type begin(pod_type xlocal_id) const
Beginning id of this space with id xlocal_id.
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.
list_pool< i_adjacency_implicit_index_space_iterator > _iterators
The iterator pool.
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.
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 i_adjacency_index_space_interval * clone() const
Virtual constructor; create a new instance of the same type at this.
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.
An implementation of class index_space_handle for an forwarding_index_space_state.
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...
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.
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.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
friend SHEAF_DLL_SPEC size_t deep_size(const i_adjacency_index_space_interval &xn, bool xinclude_shallow)
The deep size of i_adjacency_index_space_interval& xn.
virtual pod_type end(pod_type xlocal_id) const
Ending id of this space with id xlocal_id.
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
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.
virtual void release_id_space_iterator(index_space_iterator &xitr) const
Returns the id space iterator xitr to the iterator pool.
static factory< index_space_interval > & id_space_interval_factory()
A factory for making descendants of this class.
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...
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
static const i_adjacency_index_space_interval & new_space(index_space_family &xid_spaces, size_type xub, pod_type xzone_hub_begin, size_type xi_size)
Create a new interval of id spaces for 1D structured block adjacency in the id space family xid_space...
size_type _i_size
The number of zones in the i direction.
virtual bool operator==(const index_space_collection &xother) const
True if this is equivalent to xother.
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
list_pool< forwarding_index_space_handle > _handles
The handle pool.
pod_type _zone_hub_begin
The hub id of the beginning of the zone id space.
virtual void delete_product_structure(pod_type xlocal_id)
Deletes the product structure for the id space with id xlocal_id.
pod_type end() const
Ending space id of this interval in the id space family scope.
virtual const std::string & class_name() const
The name of this class.
virtual bool contains(pod_type xlocal_id, pod_type xid) const
True if the space with id xlocal_id contains id xid.
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).
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...
virtual bool has_product_structure(pod_type xlocal_id) const
True if the id space with id xlocal_id has a product structure.
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
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
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
size_type i_size() const
The number of zones in the i direction.
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.
void adjacent_zones(pod_type xlocal_id, pod_type &xzone_hub_begin, size_type &xi_ct) const
Compute the hub id of the fist adjacent zone and the number of adjacent zones in each direction for i...