SheafSystem  0.0.0.0
ijk_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/ijk_connectivity_index_space_interval.h"
22 
23 #include "SheafSystem/abstract_product_structure.h"
24 #include "SheafSystem/assert_contract.h"
25 #include "SheafSystem/ijk_connectivity_implicit_index_space_iterator.h"
26 #include "SheafSystem/ijk_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  size_type xk_size)
48 {
49  // Preconditions:
50 
51  require(xub > 0);
52  require(xid_spaces.hub_id_space().contains(xvertex_hub_begin));
53  require(xj_size > 0);
54  require(xk_size > 0);
55 
56  // Body:
57 
58  define_old_variable(size_type old_id_spaces_end = xid_spaces.end());
59 
61  result_ptr->new_state(xid_spaces, xub);
62 
63  result_ptr->_vertex_hub_begin = xvertex_hub_begin;
64  result_ptr->_j_size = xj_size;
65  result_ptr->_k_size = xk_size;
66 
67  result_ptr->_j_vertex_size = result_ptr->_j_size+1;
68  result_ptr->_k_vertex_size = result_ptr->_k_size+1;
69 
70  result_ptr->_jk_vertex_size = result_ptr->_j_vertex_size * result_ptr->_k_vertex_size;
71 
72  const ijk_connectivity_index_space_interval& result = *result_ptr;
73 
74  // Postconditions:
75 
76  ensure(&result.id_spaces() == &xid_spaces);
77  ensure(result.begin() == old_id_spaces_end);
78  ensure(result.end() == xid_spaces.end());
79  ensure(result.end() == result.begin() + xub);
80 
81  ensure(result.vertex_hub_begin() == xvertex_hub_begin);
82  ensure(result.j_size() == xj_size);
83  ensure(result.k_size() == xk_size);
84 
85  // Exit:
86 
87  return result;
88 }
89 
90 // PROTECTED MEMBER FUNCTIONS
91 
92 // PRIVATE MEMBER FUNCTIONS
93 
94 
95 // ===========================================================
96 // IJK_CONNECTIVITY_INDEX_SPACE_INTERVAL FACET
97 // ===========================================================
98 
99 // PUBLIC MEMBER FUNCTIONS
100 
103 {
104  // Preconditions:
105 
106  // Body:
107 
108  // Nothing to do.
109 
110  // Postconditions:
111 
112  // Exit:
113 
114  return;
115 }
116 
120 {
121  // Preconditions:
122 
123  // Body:
124 
125  // Postconditions:
126 
127  ensure(is_basic_query);
128 
129  // Exit:
130 
131  return _vertex_hub_begin;
132 }
133 
136 vertex_hub_begin(pod_type xlocal_id) const
137 {
138  // Preconditions:
139 
140  // Body:
141 
142  // xlocal_id is the zone id, compute the i, j, k indices.
143 
144  pod_type i, j, k;
145  sheaf::tuple(xlocal_id, _j_size, _k_size, i, j, k);
146 
147  // Compute the vertex id.
148 
149  pod_type result =
150  ordinal(i, j, k, _j_vertex_size, _k_vertex_size) + _vertex_hub_begin;
151 
152  // Postconditions:
153 
154  ensure(is_basic_query);
155 
156  // Exit:
157 
158  return result;
159 }
160 
163 j_size() const
164 {
165  // Preconditions:
166 
167  // Body:
168 
169  // Postconditions:
170 
171  ensure(is_basic_query);
172 
173  // Exit:
174 
175  return _j_size;
176 }
177 
180 k_size() const
181 {
182  // Preconditions:
183 
184  // Body:
185 
186  // Postconditions:
187 
188  ensure(is_basic_query);
189 
190  // Exit:
191 
192  return _k_size;
193 }
194 
198 {
199  // Preconditions:
200 
201  // Body:
202 
203  // Postconditions:
204 
205  ensure(is_basic_query);
206 
207  // Exit:
208 
209  return _j_vertex_size;
210 }
211 
215 {
216  // Preconditions:
217 
218  // Body:
219 
220  // Postconditions:
221 
222  ensure(is_basic_query);
223 
224  // Exit:
225 
226  return _k_vertex_size;
227 }
228 
232 {
233  // Preconditions:
234 
235  // Body:
236 
237  // Postconditions:
238 
239  ensure(is_basic_query);
240 
241  // Exit:
242 
243  return _jk_vertex_size;
244 }
245 
246 // PROTECTED MEMBER FUNCTIONS
247 
251 {
252  // Preconditions:
253 
254  // Body:
255 
256  // Postconditions:
257 
258  ensure(invariant());
259 
260  // Exit:
261 
262  return;
263 }
264 
265 // PRIVATE MEMBER FUNCTIONS
266 
267 
268 // ===========================================================
269 // INDEX_SPACE_INTERVAL FACET
270 // ===========================================================
271 
272 // PUBLIC MEMBER FUNCTIONS
273 
274 // PROTECTED MEMBER FUNCTIONS
275 
276 // PRIVATE MEMBER FUNCTIONS
277 
278 
279 // ===========================================================
280 // FACTORY FACET
281 // ===========================================================
282 
283 // PUBLIC MEMBER FUNCTIONS
284 
285 const std::string&
287 class_name() const
288 {
289  static const string result("ijk_connectivity_index_space_interval");
290  return result;
291 }
292 
295 clone() const
296 {
297  // Preconditions:
298 
299  // Body:
300 
303 
304  // Postconditions:
305 
306  ensure(result != 0);
307  ensure(is_same_type(result));
308 
309  // Exit:
310 
311  return result;
312 }
313 
314 // PROTECTED MEMBER FUNCTIONS
315 
316 // PRIVATE MEMBER FUNCTIONS
317 
318 bool
319 fiber_bundle::ijk_connectivity_index_space_interval::
320 make_prototype()
321 {
322  // Preconditions:
323 
324  // Body:
325 
327 
328  id_space_interval_factory().insert_prototype(lproto);
329 
330  // Postconditions:
331 
332  // Exit:
333 
334  return true;
335 }
336 
337 
338 // ===========================================================
339 // INDEX_SPACE_COLLECTION FACET
340 // ===========================================================
341 
342 // PUBLIC MEMBER FUNCTIONS
343 
344 bool
346 operator==(const index_space_collection& xother) const
347 {
348  // Preconditions:
349 
350  require(is_ancestor_of(&xother));
351 
352  // Body:
353 
355  dynamic_cast<const ijk_connectivity_index_space_interval&>(xother);
356 
357  bool result = index_space_interval::operator==(xother);
358 
359  result = result && (_vertex_hub_begin == lother._vertex_hub_begin);
360  result = result && (_j_size == lother._j_size);
361  result = result && (_k_size == lother._k_size);
362  result = result && (_j_vertex_size == lother._j_vertex_size);
363  result = result && (_k_vertex_size == lother._k_vertex_size);
364  result = result && (_jk_vertex_size == lother._jk_vertex_size);
365 
366  // Postconditions:
367 
368  // Exit
369 
370  return result;
371 }
372 
375 deep_size(bool xinclude_shallow) const
376 {
377  // Preconditions:
378 
379  // Body:
380 
381  size_type result = fiber_bundle::deep_size(*this, xinclude_shallow);
382 
383  // Postconditions:
384 
385  ensure(result >= 0);
386 
387  // Exit:
388 
389  return result;
390 }
391 
392 // PROTECTED MEMBER FUNCTIONS
393 
397 {
398  // Preconditions:
399 
400  require(is_ancestor_of(&xother));
401 
402  // Body:
403 
405  dynamic_cast<const ijk_connectivity_index_space_interval&>(xother);
406 
408  _j_size = lother._j_size;
409  _k_size = lother._k_size;
413 
415 
416  // Postconditions:
417 
418  ensure(invariant());
419  ensure((*this) == xother);
420 
421  // Exit:
422 
423  return *this;
424 }
425 
428 explicit_state(pod_type xlocal_id) const
429 {
430  // Preconditions:
431 
432  // Body:
433 
435 
436  explicit_index_space_state* result = 0;
437 
438  // Postconditions:
439 
440  ensure(is_basic_query);
441 
442  // Exit:
443 
444  return result;
445 }
446 
447 // PRIVATE MEMBER FUNCTIONS
448 
449 
450 // ===========================================================
451 // INDEX SPACE FACET
452 // ===========================================================
453 
454 // PUBLIC MEMBER FUNCTIONS
455 
456 void
458 remove(pod_type xlocal_id)
459 {
460  // Preconditions:
461 
462  // Body:
463 
465 
466  not_implemented();
467 
468  // Postconditions:
469 
470  ensure(!contains(xlocal_id));
471 
472  // Exit:
473 
474  return;
475 }
476 
479 ct(pod_type xlocal_id) const
480 {
481  // Preconditions:
482 
483  require(contains(xlocal_id));
484 
485  // Body:
486 
487  size_type result = 8;
488 
489  // Postconditions:
490 
491  ensure(is_basic_query);
492 
493  // Exit:
494 
495  return result;
496 }
497 
500 begin(pod_type xlocal_id) const
501 {
502  // Preconditions:
503 
504  require(contains(xlocal_id));
505 
506  // Body:
507 
508  pod_type result = 0;
509 
510  // Postconditions:
511 
512  ensure(is_basic_query);
513 
514  // Exit:
515 
516  return result;
517 }
518 
521 end(pod_type xlocal_id) const
522 {
523  // Preconditions:
524 
525  require(contains(xlocal_id));
526 
527  // Body:
528 
529  pod_type result = 8;
530 
531  // Postconditions:
532 
533  ensure(is_basic_query);
534 
535  // Exit:
536 
537  return result;
538 }
539 
540 bool
542 contains(pod_type xlocal_id, pod_type xid) const
543 {
544  // Preconditions:
545 
546  require(contains(xlocal_id));
547 
548  // Body:
549 
550  bool result = (0 <= xid) && (xid < 8);
551 
552  // Postconditions:
553 
554  ensure(is_basic_query);
555 
556  // Exit:
557 
558  return result;
559 }
560 
561 bool
564 {
565  // Preconditions:
566 
567  require(contains(xlocal_id));
568 
569  // Body:
570 
571  bool result;
572  pod_type loffset = xid - vertex_hub_begin(xlocal_id);
573 
574  if(loffset >= _jk_vertex_size)
575  {
576  // i+1.
577 
578  loffset -= _jk_vertex_size;
579  if(loffset >= _k_vertex_size)
580  {
581  // i+1, j+1.
582 
583  loffset -= _k_vertex_size;
584  result = ((0 <= loffset) && (loffset < 2));
585  }
586  else
587  {
588  // i+1, j.
589 
590  result = ((0 <= loffset) && (loffset < 2));
591  }
592  }
593  else
594  {
595  // i.
596 
597  if(loffset >= _k_vertex_size)
598  {
599  // i, j+1.
600 
601  loffset -= _k_vertex_size;
602  result = ((0 <= loffset) && (loffset < 2));
603  }
604  else
605  {
606  // i, j
607 
608  result = ((0 <= loffset) && (loffset < 2));
609  }
610  }
611 
612  // Postconditions:
613 
614  ensure(is_basic_query);
615 
616  // Exit:
617 
618  return result;
619 }
620 
621 bool
623 contains(pod_type xlocal_id, pod_type xid, pod_type xhub_id) const
624 {
625  // Preconditions:
626 
627  require(contains(xlocal_id));
628 
629  // Body:
630 
631  bool result = is_valid(xhub_id) && (hub_pod(xlocal_id, xid) == xhub_id);
632 
633  // Postconditions:
634 
635  ensure(is_basic_query);
636 
637  // Exit:
638 
639  return result;
640 }
641 
644 pod(pod_type xlocal_id, pod_type xid) const
645 {
646  // Preconditions:
647 
648  require(contains(xlocal_id));
649 
650  // Body:
651 
652  pod_type result;
653  pod_type loffset = xid - vertex_hub_begin(xlocal_id);
654 
655  if(loffset >= _jk_vertex_size)
656  {
657  // i+1.
658 
659  loffset -= _jk_vertex_size;
660  if(loffset >= _k_vertex_size)
661  {
662  // i+1, j+1.
663 
664  loffset -= _k_vertex_size;
665  if(loffset == 0)
666  {
667  // Vertex (i+1, j+1, k)
668 
669  result = 2;
670  }
671  else if(loffset == 1)
672  {
673  // Vertex (i+1, j+1, k+1)
674 
675  result = 6;
676  }
677  else
678  {
679  // Not a valid range id.
680 
681  result = invalid_pod_index();
682  }
683  }
684  else
685  {
686  // i+1, j.
687 
688  if(loffset == 0)
689  {
690  // Vertex (i+1, j, k)
691 
692  result = 1;
693  }
694  else if(loffset == 1)
695  {
696  // Vertex (i+1, j, k+1)
697 
698  result = 5;
699  }
700  else
701  {
702  // Not a valid range id.
703 
704  result = invalid_pod_index();
705  }
706  }
707  }
708  else
709  {
710  // i.
711 
712  if(loffset >= _k_vertex_size)
713  {
714  // i, j+1.
715 
716  loffset -= _k_vertex_size;
717  if(loffset == 0)
718  {
719  // Vertex (i, j+1, k)
720 
721  result = 3;
722  }
723  else if(loffset == 1)
724  {
725  // Vertex (i, j+1, k+1)
726 
727  result = 7;
728  }
729  else
730  {
731  // Not a valid range id.
732 
733  result = invalid_pod_index();
734  }
735  }
736  else
737  {
738  // i, j
739 
740  if(loffset == 0)
741  {
742  // Vertex (i, j, k)
743 
744  result = 0;
745  }
746  else if(loffset == 1)
747  {
748  // Vertex (i, j, k+1)
749 
750  result = 4;
751  }
752  else
753  {
754  // Not a valid range id.
755 
756  result = invalid_pod_index();
757  }
758  }
759  }
760 
761  // Postconditions:
762 
763  ensure(!is_valid(result) || contains(xlocal_id, result));
764 
765  // Exit:
766 
767  return result;
768 }
769 
772 unglued_hub_pod(pod_type xlocal_id, pod_type xid) const
773 {
774  // Preconditions:
775 
776  require(contains(xlocal_id));
777 
778  // Body:
779 
780  pod_type result = vertex_hub_begin(xlocal_id);
781 
782  switch(xid)
783  {
784  case 0:
785  {
786  // vertex (0, 0, 0)
787 
788  break;
789  }
790  case 1:
791  {
792  // vertex (1, 0, 0)
793 
794  result += _jk_vertex_size;
795  break;
796  }
797  case 2:
798  {
799  // vertex(1, 1, 0)
800 
801  result += _jk_vertex_size + _k_vertex_size;
802  break;
803  }
804  case 3:
805  {
806  // vertex(0, 1, 0)
807 
808  result += _k_vertex_size;
809  break;
810  }
811  case 4:
812  {
813  // vertex(0, 0, 1)
814 
815  result += 1;
816  break;
817  }
818  case 5:
819  {
820  // vertex(1, 0, 1)
821 
822  result += _jk_vertex_size + 1;
823  break;
824  }
825  case 6:
826  {
827  // vertex(1, 1, 1)
828 
829  result += _jk_vertex_size + _k_vertex_size + 1;
830  break;
831  }
832  case 7:
833  {
834  // vertex(0, 1, 1)
835 
836  result += _k_vertex_size + 1;
837  break;
838  }
839  default:
840  {
841  result = invalid_pod_index();
842  break;
843  }
844  }
845 
846  // Postconditions:
847 
848  ensure(!is_valid(result) || contains_unglued_hub(xlocal_id, result));
849 
850  // Exit:
851 
852  return result;
853 }
854 
855 bool
857 is_persistent(pod_type xlocal_id) const
858 {
859  // Preconditions:
860 
861  require(contains(xlocal_id));
862 
863  // Body:
864 
865  bool result = false;
866 
867  // Postconditions:
868 
869  ensure(is_basic_query);
870 
871  // Exit:
872 
873  return result;
874 }
875 
876 // PROTECTED MEMBER FUNCTIONS
877 
878 // PRIVATE MEMBER FUNCTIONS
879 
880 
881 // ===========================================================
882 // PRODUCT STRUCTURE FACET
883 // ===========================================================
884 
885 // PUBLIC MEMBER FUNCTIONS
886 
887 void
890  const abstract_product_structure& xproduct)
891 {
892  // Preconditions:
893 
894  require(contains(xlocal_id));
895 
896  // Body:
897 
899 
900  not_implemented();
901 
902  // Postconditions:
903 
904  ensure(has_product_structure(xlocal_id));
905 
906  // Exit:
907 
908  return;
909 }
910 
911 void
914 {
915  // Preconditions:
916 
917  require(contains(xlocal_id));
918 
919  // Body:
920 
922 
923  not_implemented();
924 
925  // Postconditions:
926 
927  ensure(!has_product_structure(xlocal_id));
928 
929  // Exit:
930 
931  return;
932 }
933 
936 product_structure(pod_type xlocal_id) const
937 {
938  // Preconditions:
939 
940  require(contains(xlocal_id));
941  require(has_product_structure(xlocal_id));
942 
943  // Body:
944 
946 
947  const abstract_product_structure* result = 0; // Just to silence compiler warnings.
948 
949  not_implemented();
950 
951  // Postconditions:
952 
953  ensure(is_basic_query);
954 
955  // Exit:
956 
957  return *result;
958 }
959 
963 {
964  // Preconditions:
965 
966  require(contains(xlocal_id));
967  require(has_product_structure(xlocal_id));
968 
969  // Body:
970 
972 
973  abstract_product_structure* result = 0; // Just to silence compiler warnings.
974 
975  not_implemented();
976 
977  // Postconditions:
978 
979  ensure(is_basic_query);
980 
981  // Exit:
982 
983  return *result;
984 }
985 
986 bool
989 {
990  // Preconditions:
991 
992  require(contains(xlocal_id));
993 
994  // Body:
995 
997 
998  bool result = false; // Just to silence compiler warnings.
999 
1000  not_implemented();
1001 
1002  // Postconditions:
1003 
1004  ensure(is_basic_query);
1005 
1006  // Exit:
1007 
1008  return result;
1009 }
1010 
1011 // PROTECTED MEMBER FUNCTIONS
1012 
1013 // PRIVATE MEMBER FUNCTIONS
1014 
1015 
1016 // ===========================================================
1017 // HANDLE POOL FACET
1018 // ===========================================================
1019 
1020 // PUBLIC MEMBER FUNCTIONS
1021 
1024 get_id_space(pod_type xlocal_id) const
1025 {
1026  // Preconditions:
1027 
1028  require(contains(xlocal_id));
1029 
1030  // Body:
1031 
1032  index_space_handle& result = _handles.get();
1033  result.attach_to(*this, xlocal_id);
1034 
1035  // Postconditions:
1036 
1037  ensure(result.is_attached());
1038 
1039  // Exit:
1040 
1041  return result;
1042 }
1043 
1044 void
1047 {
1048  // Preconditions:
1049 
1050  require(allocated_id_space(xid_space));
1051 
1052  // Body:
1053 
1054  // Detach the handle.
1055 
1056  xid_space.detach();
1057 
1058  // Release the handle to the pool.
1059 
1060  _handles.release(reinterpret_cast<forwarding_index_space_handle&>(xid_space));
1061 
1062  // Postconditions:
1063 
1064  ensure(is_basic_query);
1065 
1066  // Exit:
1067 
1068  return;
1069 }
1070 
1071 bool
1074 {
1075  // Preconditions:
1076 
1077  // Body:
1078 
1079  const forwarding_index_space_handle* lid_space =
1080  dynamic_cast<const forwarding_index_space_handle*>(&xid_space);
1081 
1082  bool result = (lid_space != 0) && _handles.allocated(*lid_space);
1083 
1084  // Postconditions:
1085 
1086  ensure(is_basic_query);
1087 
1088  // Exit:
1089 
1090  return result;
1091 }
1092 
1093 // PROTECTED MEMBER FUNCTIONS
1094 
1095 // PRIVATE MEMBER FUNCTIONS
1096 
1097 
1098 // ===========================================================
1099 // ITERATOR POOL FACET
1100 // ===========================================================
1101 
1102 // PUBLIC MEMBER FUNCTIONS
1103 
1107 {
1108  // Preconditions:
1109 
1110  require(contains(xlocal_id));
1111 
1112  // Body:
1113 
1114  index_space_iterator& result = _iterators.get();
1115  result.attach_to(*this, xlocal_id);
1116 
1117  // Postconditions:
1118 
1119  ensure(result.is_attached());
1120 
1121  // Exit:
1122 
1123  return result;
1124 }
1125 
1126 void
1129 {
1130  // Preconditions:
1131 
1132  require(allocated_id_space_iterator(xitr));
1133 
1134  // Body:
1135 
1136  // Detach the iterator.
1137 
1138  xitr.detach();
1139 
1140  // Release the iterator to the pool.
1141 
1142  _iterators.release(reinterpret_cast<ijk_connectivity_implicit_index_space_iterator&>(xitr));
1143 
1144  // Postconditions:
1145 
1146  ensure(is_basic_query);
1147 
1148  // Exit:
1149 
1150  return;
1151 }
1152 
1153 bool
1156 {
1157  // Preconditions:
1158 
1159  // Body:
1160 
1162  dynamic_cast<const ijk_connectivity_implicit_index_space_iterator*>(&xitr);
1163 
1164  bool result = (litr != 0) && _iterators.allocated(*litr);
1165 
1166  // Postconditions:
1167 
1168  ensure(is_basic_query);
1169 
1170  // Exit:
1171 
1172  return result;
1173 }
1174 
1175 // PROTECTED MEMBER FUNCTIONS
1176 
1177 // PRIVATE MEMBER FUNCTIONS
1178 
1179 
1180 // ===========================================================
1181 // ANY FACET
1182 // ===========================================================
1183 
1184 // PUBLIC MEMBER FUNCTIONS
1185 
1186 bool
1188 is_ancestor_of(const any *other) const
1189 {
1190  // Preconditions:
1191 
1192  require(other != 0);
1193 
1194  // Body:
1195 
1196  // True if other conforms to this
1197 
1198  bool result = dynamic_cast<const ijk_connectivity_index_space_interval*>(other) != 0;
1199 
1200  // Postconditions:
1201 
1202  // Exit:
1203 
1204  return result;
1205 }
1206 
1207 bool
1209 invariant() const
1210 {
1211  bool result = true;
1212 
1213  if(invariant_check())
1214  {
1215  // Prevent recursive calls to invariant
1216 
1218 
1219  // Must satisfy base class invariant
1220 
1221  invariance(index_space_interval::invariant());
1222 
1223  // Invariances for this class:
1224 
1225  // Finished, turn invariant checking back on.
1226 
1228  }
1229 
1230  // Exit
1231 
1232  return result;
1233 }
1234 
1235 // PROTECTED MEMBER FUNCTIONS
1236 
1237 // PRIVATE MEMBER FUNCTIONS
1238 
1239 
1240 // ===========================================================
1241 // NON-MEMBER FUNCTIONS
1242 // ===========================================================
1243 
1244 size_t
1245 fiber_bundle::
1246 deep_size(const ijk_connectivity_index_space_interval& xn, bool xinclude_shallow)
1247 {
1248  // Preconditions:
1249 
1250  // Body:
1251 
1252  size_t result = xinclude_shallow ? sizeof(xn) : 0;
1253 
1254  // Add contributions for _handles.
1255 
1256  result += deep_size(xn._handles, false);
1257 
1258  // Add contributions for _iterators.
1259 
1260  result += deep_size(xn._iterators, false);
1261 
1262  // Postconditions:
1263 
1264  ensure(result >= 0);
1265 
1266  // Exit
1267 
1268  return result;
1269 }
virtual bool is_persistent(pod_type xlocal_id) const
True if the id space with id xlocal_id should be written to disk.
pod_type end() const
The ending index of the id spaces.
list_pool< forwarding_index_space_handle > _handles
The handle pool.
An abstract class that defines the product structure for an id space.
virtual void release_id_space_iterator(index_space_iterator &xitr) const
Returns the id space iterator xitr to the iterator pool.
virtual bool has_product_structure(pod_type xlocal_id) const
True if the id space with id xlocal_id has a product structure.
virtual const index_space_family & id_spaces() const
The id space family for this (const version).
size_type k_vertex_size() const
The number of vertices in the k direction.
An abstract iterator over the ids of an id space.
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.
static const ijk_connectivity_index_space_interval & new_space(index_space_family &xid_spaces, size_type xub, pod_type xvertex_hub_begin, size_type xj_size, size_type xk_size)
Create a new interval of id spaces for 2D structured block connectivity in the id space family xid_sp...
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 pod_type end(pod_type xlocal_id) const
Ending id of this space with id xlocal_id.
virtual bool invariant() const
Class invariant.
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...
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...
STL namespace.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
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_type _vertex_hub_begin
The hub id of the beginning of the vertex id space.
pod_index_type pod_type
The "plain old data" index type for this.
virtual ijk_connectivity_index_space_interval * clone() const
Virtual constructor; create a new instance of the same type at 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.
virtual size_type ct(pod_type xlocal_id) const
The number of members for the id space with id xlocal_id.
An implementation of index_space_interval for an interval of implicit id spaces for the connectivity ...
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 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.
size_type _k_vertex_size
The number of vertices in the k 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...
friend SHEAF_DLL_SPEC size_t deep_size(const ijk_connectivity_index_space_interval &xn, bool xinclude_shallow)
The deep size of ijk_connectivity_index_space_interval& xn.
virtual pod_type begin(pod_type xlocal_id) const
Beginning id of this space with id xlocal_id.
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.
size_type jk_vertex_size() const
The number of vertices in the j*k direction.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
size_type _j_vertex_size
The number of vertices in the j direction.
virtual bool contains(pod_type xlocal_id, pod_type xid) const
True if the space with id xlocal_id contains id xid.
An implementation of implicit_index_space_iterator for an implicit id space in an ijk_connectivity_in...
list_pool< ijk_connectivity_implicit_index_space_iterator > _iterators
The iterator pool.
virtual const std::string & class_name() const
The name of this class.
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.
static factory< index_space_interval > & id_space_interval_factory()
A factory for making descendants of this class.
virtual bool operator==(const index_space_collection &xother) const
True if this is equivalent to xother.
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
pod_type vertex_hub_begin() const
The hub id of the beginning of the vertex id space.
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...
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).
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 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.
size_type _k_size
The number of zones in the k direction.
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 _jk_vertex_size
The number of vertices in the j*k direction.
pod_type end() const
Ending space id of this interval in the id space family scope.
virtual void release_id_space(index_space_handle &xid_space) const
Returns the id space handle xid_space to the handle pool.
void tuple(pod_index_type x, size_type xj_ub, pod_index_type &xi, pod_index_type &xj)
Ordinal to 2-tuple conversion.
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 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...
size_type _j_size
The number of zones in the j direction.
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
size_type j_vertex_size() const
The number of vertices in the j direction.
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 ijk_connectivity_index_space_interval & operator=(const index_space_collection &xother)
Assignment operator.
size_type j_size() const
The number of zones in the j 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.
size_type k_size() const
The number of zones in the k direction.
virtual void delete_product_structure(pod_type xlocal_id)
Deletes the product structure for the id space with id xlocal_id.