SheafSystem  0.0.0.0
point_block_crg_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/point_block_crg_interval.h"
22 
23 #include "SheafSystem/assert_contract.h"
24 #include "SheafSystem/base_space_poset.h"
25 #include "SheafSystem/binary_index_space.h"
26 #include "SheafSystem/constant_index_space_interval.h"
27 #include "SheafSystem/error_message.h"
28 #include "SheafSystem/explicit_index_space_interval.h"
29 #include "SheafSystem/factory.h"
30 #include "SheafSystem/index_space_iterator.h"
31 #include "SheafSystem/list_index_space_handle.h"
32 #include "SheafSystem/list_index_space_state.h"
33 #include "SheafSystem/offset_index_space_handle.h"
34 #include "SheafSystem/offset_index_space_state.h"
35 #include "SheafSystem/point_block_1d.h"
36 #include "SheafSystem/point_block_2d.h"
37 #include "SheafSystem/point_block_3d.h"
38 #include "SheafSystem/section_space_schema_member.h"
39 #include "SheafSystem/singleton_index_space_interval.h"
40 #include "SheafSystem/std_iomanip.h"
41 #include "SheafSystem/std_string.h"
42 #include "SheafSystem/std_sstream.h"
43 #include "SheafSystem/ternary_index_space.h"
44 
45 using namespace std;
46 using namespace fiber_bundle; // Workaround for MS C++ bug.
47 
48 namespace
49 {
50 const sheaf::size_type BLOCK_VERTICES_BEGIN = 2;
51 const sheaf::size_type EXPLICIT_PRIVATE_DATA_SIZE = 2;
52 }
53 
54 
55 // ===========================================================
56 // POINT_BLOCK_CRG_INTERVAL FACET
57 // ===========================================================
58 
59 // PUBLIC DATA MEMBERS
60 
63 {
64  // Preconditions:
65 
66  // Body:
67 
68  // Postconditions:
69 
70  ensure(invariant());
71  ensure(!is_initialized());
72 
73  // Exit:
74 
75  return;
76 }
77 
80 {
81  // Preconditions:
82 
83  // Body:
84 
85  if(is_valid(_lower_covers_begin))
86  {
87  // Delete the block interval.
88 
89  _id_spaces->delete_space(_lower_covers_begin);
90 
91  // Delete the vertices interval.
92 
93  _id_spaces->delete_space(_lower_covers_begin + 1);
94  }
95 
96  if(is_valid(_upper_covers_begin))
97  {
98  // Delete the block interval.
99 
100  _id_spaces->delete_space(_upper_covers_begin);
101 
102  // Delete the vertices interval.
103 
104  _id_spaces->delete_space(_upper_covers_begin + 1);
105  }
106 
107  if(is_valid(_connectivity_begin))
108  {
109  // Delete the connectivity interval.
110 
111  _id_spaces->delete_space(_connectivity_begin);
112  }
113 
114  // For efficiency, the connectivity and adjacency id space interval
115  // are the same interval. Deleting the connectivity interval also
116  // deletes the adjacency interval.
117 
118  // Postconditions:
119 
120  // Exit:
121 
122  return;
123 }
124 
125 // PROTECTED DATA MEMBERS
126 
127 // PRIVATE DATA MEMBERS
128 
129 
130 // ===========================================================
131 // HOMOGENEOUS_BLOCK_CRG_INTERVAL FACET
132 // ===========================================================
133 
134 // PUBLIC DATA MEMBERS
135 
136 // PROTECTED DATA MEMBERS
137 
138 // PRIVATE DATA MEMBERS
139 
140 
141 // ===========================================================
142 // ZONES FACET
143 // ===========================================================
144 
145 // PUBLIC DATA MEMBERS
146 
147 // PROTECTED DATA MEMBERS
148 
149 // PRIVATE DATA MEMBERS
150 
151 
152 // ===========================================================
153 // ZONES FACET
154 // ===========================================================
155 
156 // PUBLIC DATA MEMBERS
157 
158 // PROTECTED DATA MEMBERS
159 
160 // PRIVATE DATA MEMBERS
161 
162 
163 // ===========================================================
164 // VERTICES FACET
165 // ===========================================================
166 
167 // PUBLIC DATA MEMBERS
168 
169 // PROTECTED DATA MEMBERS
170 
171 void
174 {
175  // Preconditions:
176 
177  require(id_spaces_initialized());
178  require(local_id_space_initialized());
179  require(!vertices_initialized());
180  require(!zones_initialized());
181 
182  // Body:
183 
184  // Construct the vertex id space.
185 
186  const string& lvertex_id_space_name =
187  section_space_schema_member::intersection_id_space_name(xhost.d_cells(0),
188  interval_member());
189 
190  _vertices_space_id =
191  offset_index_space_state::new_space(*_id_spaces,
192  lvertex_id_space_name,
193  implicit_begin(),
194  _vertex_size).index();
195 
196  _vertices_initialized = true;
197 
198  // Zones and vertices are the same id space.
199 
200  _zones_space_id = _vertices_space_id;
201 
202  _zones_initialized = true;
203 
204  // Postconditions:
205 
206  ensure(vertices_initialized());
207  ensure(zones_initialized());
208 
209  // Exit:
210 
211  return;
212 }
213 
214 // PRIVATE DATA MEMBERS
215 
216 
217 // ===========================================================
218 // BASE_SPACE_CRG_INTERVAL FACET
219 // ===========================================================
220 
221 // PUBLIC DATA MEMBERS
222 
223 int
225 db(pod_index_type xmbr_id) const
226 {
227  // Preconditions:
228 
229  require(contains_member(xmbr_id));
230 
231  // Body:
232 
233  int result = 0;
234 
235  // Postconditions:
236 
237 
238  // Exit:
239 
240  return result;
241 }
242 
245 d_cells_space_id(int xd) const
246 {
247  // Preconditions:
248 
249  // Body:
250 
251  pod_index_type result;
252 
253  switch(xd)
254  {
255  case 0:
256  result = _vertices_space_id;
257  break;
258 
259  default:
260  result = invalid_pod_index();
261  break;
262  }
263 
264  // Postconditions:
265 
266  // Exit:
267 
268  return result;
269 }
270 
271 // PROTECTED DATA MEMBERS
272 
273 // PRIVATE DATA MEMBERS
274 
275 
276 // ===========================================================
277 // BLOCK VERTICES FACET
278 // ===========================================================
279 
280 // PUBLIC DATA MEMBERS
281 
282 // PROTECTED DATA MEMBERS
283 
284 void
287 {
288  // Preconditions:
289 
290  require(id_spaces_initialized());
291  require(!block_vertices_initialized());
292 
293  // Body:
294 
295  // Construct the block vertices id space.
296 
297  list_index_space_handle lblock_vertices_id_space =
298  list_index_space_state::new_space(*_id_spaces,
299  block_vertices_name(),
300  false);
301 
302  _block_vertices_space_id = lblock_vertices_id_space.index();
303 
304  // Insert the private data into the id space.
305 
306  pod_index_type v = 0;
307  size_type lbv_size = xdata[v++];
308  for(size_type lbv=0; lbv<lbv_size; ++lbv)
309  {
310  lblock_vertices_id_space.push_back(_local_id_space.hub_pod(xdata[v++]));
311  }
312 
313  // The block vertices is initialized.
314 
315  _block_vertices_initialized = true;
316 
317  // Postconditions:
318 
319  ensure(block_vertices_initialized());
320 
321  // Exit:
322 
323  return;
324 }
325 
326 // PRIVATE DATA MEMBERS
327 
328 
329 // ===========================================================
330 // IMPLICIT_CRG_INTERVAL FACET
331 // ===========================================================
332 
333 // PUBLIC DATA MEMBERS
334 
335 // PROTECTED DATA MEMBERS
336 
337 // PRIVATE DATA MEMBERS
338 
339 
340 // ===========================================================
341 // CRG_INTERVAL FACET
342 // ===========================================================
343 
344 // PUBLIC DATA MEMBERS
345 
346 // PROTECTED DATA MEMBERS
347 
348 // PRIVATE DATA MEMBERS
349 
350 
351 // ===========================================================
352 // INTERVAL FACET
353 // ===========================================================
354 
355 // PUBLIC DATA MEMBERS
356 
357 void
359 get_size(size_type xi_size, size_type& result)
360 {
361  // Preconditions:
362 
363 
364  // Body:
365 
366  // xi_size, xj_size, and xk_size are number of "vertices"
367  // in the array that points are arranged in.
368 
369  size_type lvertex_ct = xi_size;
370 
371  // Must be consistent with homogeneous_block::
372  // initialize_cell_intervals(poset_state_handle&, size_type).
373 
374  result = 1 + lvertex_ct;
375 
376  // Postconditions:
377 
378 
379  // Exit:
380 
381  return;
382 }
383 
384 void
386 get_size(size_type xi_size, size_type xj_size, size_type& result)
387 {
388  // Preconditions:
389 
390 
391  // Body:
392 
393  // xi_size, xj_size, and xk_size are number of "vertices"
394  // in the array that points are arranged in.
395 
396  size_type lvertex_ct = xi_size*xj_size;
397 
398  // Must be consistent with homogeneous_block::
399  // initialize_cell_intervals(poset_state_handle&, size_type).
400 
401  result = 1 + lvertex_ct;
402 
403  // Postconditions:
404 
405 
406  // Exit:
407 
408  return;
409 }
410 
411 void
413 get_size(size_type xi_size, size_type xj_size, size_type xk_size, size_type& result)
414 {
415  // Preconditions:
416 
417 
418  // Body:
419 
420  // xi_size, xj_size, and xk_size are number of "vertices"
421  // in the array that points are arranged in.
422 
423  size_type lvertex_ct = xi_size*xj_size*xk_size;
424 
425  // Must be consistent with homogeneous_block::
426  // initialize_cell_intervals(poset_state_handle&, size_type).
427 
428  result = 1 + lvertex_ct;
429 
430  // Postconditions:
431 
432 
433  // Exit:
434 
435  return;
436 }
437 
438 // PROTECTED DATA MEMBERS
439 
440 // PRIVATE DATA MEMBERS
441 
442 
443 // ===========================================================
444 // COVER SET FACET
445 // ===========================================================
446 
447 // PUBLIC DATA MEMBERS
448 
449 // PROTECTED DATA MEMBERS
450 
451 void
454 {
455  // Preconditions:
456 
457  require(id_spaces_initialized());
458  require(local_id_space_initialized());
459  require(!covers_initialized(LOWER));
460 
461  // Body:
462 
463  // Construct the lower cover of the block.
464  //
465  // The lower cover of the block is initialized to an id space that contains
466  // all the points.
467 
468  _lower_covers_begin =
469  explicit_index_space_interval::new_space(*_id_spaces, 1).begin();
470 
471  offset_index_space_state::new_space(*_id_spaces,
472  _lower_covers_begin,
473  implicit_cover_name(LOWER, interval_member()),
474  implicit_begin(),
475  _vertex_size);
476 
477  // Construct the lower cover of the vertices.
478  //
479  // The lower cover of the vertices is initialized to bottom.
480 
481  constant_index_space_interval::new_space(*_id_spaces, _vertex_size, BOTTOM_INDEX);
482 
483  // Construct the connectivity and adjacency id spaces. The connectivity
484  // and adjacency id spaces are identical. Since a point is both a zone
485  // and vertex. The connectivity and adjacency id spaces are id spaces
486  // with a single member that maps to itself. For efficiency, only one
487  // id space interval will be created for both the connectivity and
488  // adjacency id spaces.
489 
490  _connectivity_begin =
491  singleton_index_space_interval::new_space(*_id_spaces, _vertex_size, implicit_begin()).begin();
492 
493  _adjacency_begin = _connectivity_begin;
494 
495  // The lower cover is initialized.
496 
497  _lower_covers_initialized = true;
498 
499  // Posconditions:
500 
501  ensure(covers_initialized(LOWER));
502 
503  // Exit:
504 
505  return;
506 }
507 
508 void
511 {
512  // Preconditions:
513 
514  require(id_spaces_initialized());
515  require(local_id_space_initialized());
516  require(!covers_initialized(UPPER));
517 
518  // Body:
519 
520  // Construct the upper cover of the block
521  //
522  // The upper cover of block is initialized to an empty explicit id space.
523 
524  _upper_covers_begin =
525  explicit_index_space_interval::new_space(*_id_spaces, 1).begin();
526 
527  list_index_space_state::new_space(*_id_spaces,
528  _upper_covers_begin,
529  explicit_cover_name(UPPER, interval_member()),
530  false);
531 
532  // Construct the upper cover of the points.
533  //
534  // The upper cover of the points is initialized to the block.
535 
536  constant_index_space_interval::new_space(*_id_spaces, _vertex_size, interval_member());
537 
538  // The adjacency id spaces are contructed in initialize_lower_covers.
539 
540  // The upper cover is initialized.
541 
542  _upper_covers_initialized = true;
543 
544  // Posconditions:
545 
546  ensure(covers_initialized(UPPER));
547 
548  // Exit:
549 
550  return;
551 }
552 
553 // PRIVATE DATA MEMBERS
554 
555 
556 // ===========================================================
557 // DOF_TUPLE_ID FACET
558 // ===========================================================
559 
560 // PUBLIC DATA MEMBERS
561 
562 void
565  size_type xi_size,
566  block<pod_index_type>& result)
567 {
568  // Preconditions:
569 
570 
571  // Body:
572 
573  result.reserve(MEMBER_CLASS_END);
574  result.set_ct(MEMBER_CLASS_END);
575 
576 
577  result[BLOCK] = point_block_1d::new_row_dof_map(xhost, xi_size, true).hub_pod();
578  result[ZONE] = base_space_member::new_row_dof_map(xhost, "point", true).hub_pod();
579  result[VERTEX] = base_space_member::new_row_dof_map(xhost, "point", true).hub_pod();
580 
581  // Postconditions:
582 
583 
584  // Exit:
585 
586  return;
587 }
588 
589 void
592  size_type xi_size,
593  size_type xj_size,
594  block<pod_index_type>& result)
595 {
596  // Preconditions:
597 
598 
599  // Body:
600 
601  result.reserve(MEMBER_CLASS_END);
602  result.set_ct(MEMBER_CLASS_END);
603 
604 
605  result[BLOCK] = point_block_2d::new_row_dof_map(xhost, xi_size, xj_size, true).hub_pod();
606  result[ZONE] = base_space_member::new_row_dof_map(xhost, "point", true).hub_pod();
607  result[VERTEX] = base_space_member::new_row_dof_map(xhost, "point", true).hub_pod();
608 
609  // Postconditions:
610 
611 
612  // Exit:
613 
614  return;
615 }
616 
617 void
620  size_type xi_size,
621  size_type xj_size,
622  size_type xk_size,
623  block<pod_index_type>& result)
624 {
625  // Preconditions:
626 
627 
628  // Body:
629 
630  result.reserve(MEMBER_CLASS_END);
631  result.set_ct(MEMBER_CLASS_END);
632 
633 
634  result[BLOCK] = point_block_3d::new_row_dof_map(xhost, xi_size, xj_size, xk_size, true).hub_pod();
635  result[ZONE] = base_space_member::new_row_dof_map(xhost, "point", true).hub_pod();
636  result[VERTEX] = base_space_member::new_row_dof_map(xhost, "point", true).hub_pod();
637 
638  // Postconditions:
639 
640 
641  // Exit:
642 
643  return;
644 }
645 
646 // PROTECTED DATA MEMBERS
647 
648 // PRIVATE DATA MEMBERS
649 
650 
651 // ===========================================================
652 // PRIVATE_DATA FACET
653 // ===========================================================
654 
655 // PUBLIC DATA MEMBERS
656 
657 void
660 {
661  // Preconditions:
662 
663  require(xi_size > 0);
664 
665  // Body:
666 
667  size_type lblock_vertices_size = 2;
668  size_type lpd_size = lblock_vertices_size + BLOCK_VERTICES_BEGIN + EXPLICIT_PRIVATE_DATA_SIZE;
669 
670  result.reserve(lpd_size);
671  result.set_ct(lpd_size);
672 
673  // xi_size, xj_size, and xk_size are number of "vertices"
674  // in the array that points are arranged in.
675 
676  size_type lvertex_i_size = xi_size;
677 
678  size_type v = 0;
679  result[v++] = lvertex_i_size;
680  result[v++] = lblock_vertices_size;
681 
682  // Add block vertex ids.
683 
684  // block vertices are local ids;
685  // local vertex ids are in interval [1, #vertices);
686  // so calculate ids using usual array indexing, then add 1.
687 
688  result[v++] = 1;
689  result[v++] = xi_size;
690 
691  // There are no explicit covers.
692 
693  result[v++] = 0;
694  result[v++] = 0;
695 
696  // Postconditions:
697 
698  // Exit:
699 
700  return;
701 }
702 
703 void
706  size_type xj_size,
707  block<pod_index_type>& result)
708 {
709  // Preconditions:
710 
711  require(xi_size > 0);
712  require(xj_size > 0);
713 
714  // Body:
715 
716  size_type lblock_vertices_size = 4;
717  size_type lpd_size = lblock_vertices_size + BLOCK_VERTICES_BEGIN + EXPLICIT_PRIVATE_DATA_SIZE;
718 
719  result.reserve(lpd_size);
720  result.set_ct(lpd_size);
721 
722  // xi_size, xj_size, and xk_size are number of "vertices"
723  // in the array that points are arranged in.
724 
725  size_type lvertex_i_size = xi_size;
726  size_type lvertex_j_size = xj_size;
727 
728  size_type v = 0;
729  result[v++] = lvertex_i_size*lvertex_j_size;
730  result[v++] = lblock_vertices_size;
731 
732  binary_index_space lid_space(lvertex_i_size, lvertex_j_size);
733 
734  // block vertices are local ids;
735  // local vertex ids are in interval [1, #vertices);
736  // so calculate ids using usual array indexing, then add 1.
737 
738  result[v++] = lid_space.to_row_major_offset(0, 0) + 1;
739  result[v++] = lid_space.to_row_major_offset(xi_size-1, 0) + 1;
740  result[v++] = lid_space.to_row_major_offset(xi_size-1, xj_size-1) + 1;
741  result[v++] = lid_space.to_row_major_offset(0, xj_size-1) + 1;
742 
743  // There are no explicit covers.
744 
745  result[v++] = 0;
746  result[v++] = 0;
747 
748  // Postconditions:
749 
750  // Exit:
751 
752  return;
753 }
754 
755 void
758  size_type xj_size,
759  size_type xk_size,
760  block<pod_index_type>& result)
761 {
762  // Preconditions:
763 
764  require(xi_size > 0);
765  require(xj_size > 0);
766  require(xk_size > 0);
767 
768  // Body:
769 
770  size_type lblock_vertices_size = 8;
771  size_type lpd_size = lblock_vertices_size + BLOCK_VERTICES_BEGIN + EXPLICIT_PRIVATE_DATA_SIZE;
772 
773  result.reserve(lpd_size);
774  result.set_ct(lpd_size);
775 
776  // xi_size, xj_size, and xk_size are number of "vertices"
777  // in the array that points are arranged in.
778 
779  size_type lvertex_i_size = xi_size;
780  size_type lvertex_j_size = xj_size;
781  size_type lvertex_k_size = xk_size;
782 
783  size_type v = 0;
784  result[v++] = lvertex_i_size*lvertex_j_size*lvertex_k_size;
785  result[v++] = lblock_vertices_size;
786 
787  ternary_index_space lid_space(lvertex_i_size, lvertex_j_size, lvertex_k_size);
788 
789  // block vertices are local ids;
790  // local vertex ids are in interval [1, #vertices);
791  // so calculate ids using usual array indexing, then add 1.
792 
793  result[v++] = lid_space.to_row_major_offset(0, 0, 0) + 1;
794  result[v++] = lid_space.to_row_major_offset(xi_size-1, 0, 0) + 1;
795  result[v++] = lid_space.to_row_major_offset(xi_size-1, xj_size-1, 0) + 1;
796  result[v++] = lid_space.to_row_major_offset(0, xj_size-1, 0) + 1;
797 
798  result[v++] = lid_space.to_row_major_offset(0, 0, xk_size-1) + 1;
799  result[v++] = lid_space.to_row_major_offset(xi_size-1, 0, xk_size-1) + 1;
800  result[v++] = lid_space.to_row_major_offset(xi_size-1, xj_size-1, xk_size-1) + 1;
801  result[v++] = lid_space.to_row_major_offset(0, xj_size-1, xk_size-1) + 1;
802 
803  // There are no explicit covers.
804 
805  result[v++] = 0;
806  result[v++] = 0;
807 
808  // Postconditions:
809 
810  // Exit:
811 
812  return;
813 }
814 
815 // PROTECTED DATA MEMBERS
816 
820 {
821  // Preconditions:
822 
823  require(block_vertices_initialized());
824 
825  // Body:
826 
827  size_type result =
828  BLOCK_VERTICES_BEGIN + _id_spaces->ct(_block_vertices_space_id);
829 
830  // Postconditions:
831 
832  ensure(is_basic_query);
833 
834  // Exit:
835 
836  return result;
837 }
838 
839 void
842 {
843  // Preconditions:
844 
845  require(block_vertices_initialized());
846 
847  // Body:
848 
849  size_type lbv_size = _id_spaces->ct(_block_vertices_space_id);
850 
851  size_type lpd_size = lbv_size + BLOCK_VERTICES_BEGIN;
852 
853  xdata.set_ct(lpd_size);
854 
855  size_type v = 0;
856  xdata[v++] = _vertex_size;
857  xdata[v++] = lbv_size;
858 
859  index_space_iterator& litr = _id_spaces->get_id_space_iterator(_block_vertices_space_id);
860  while(!litr.is_done())
861  {
862  xdata[v++] = _local_id_space.pod(litr.hub_pod());
863 
864  litr.next();
865  }
866  _id_spaces->release_id_space_iterator(litr);
867 
868  // Postconditions:
869 
870  ensure(xdata.ct() == implicit_private_data_size());
871 
872  // Exit:
873 
874  return;
875 }
876 
877 void
880 {
881  // Preconditions:
882 
883  require(!block_vertices_initialized());
884 
885  // Body:
886 
887  // Initialize private data.
888 
889  size_type v = 0;
890  _vertex_size = xdata[v++];
891 
892  initialize_block_vertices(&xdata[v]);
893 
894  // Postconditions:
895 
896  ensure(invariant());
897  ensure(block_vertices_initialized());
898 
899  // Exit:
900 
901  return;
902 }
903 
904 // PRIVATE DATA MEMBERS
905 
906 
907 // ===========================================================
908 // FINIALIZE FACET
909 // ===========================================================
910 
911 // PUBLIC DATA MEMBERS
912 
913 void
916 {
917  // Preconditions:
918 
919  require(dynamic_cast<base_space_poset*>(&xhost) != 0);
920  require(xhost.state_is_read_accessible());
921 
922  // Body:
923 
924  base_space_poset& lhost = dynamic_cast<base_space_poset&>(xhost);
925 
926  // Compute the top ids for the cell intervals.
927 
928  pod_index_type lvertex_begin = interval_member() + 1;
929  pod_index_type lvertex_end = lvertex_begin + _vertex_size;
930 
931  // Initialize zones and vertex id spaces.
932 
933  initialize_vertices(lhost);
934 
935  // Initialize the cover id spaces.
936 
937  initialize_covers();
938 
939  // Now this can be inserted in the standard subposets (d-cells, etc).
940 
941  lhost.insert_interval_in_standard_subposets(*this);
942 
943  // Insert the vertices into the upper cover of bottom.
944 
945  xhost.append_upper_cover_of_bottom(lvertex_begin, lvertex_end);
946 
947  homogeneous_block_crg_interval::finalize(xhost);
948 
949  // Postconditions:
950 
951  ensure(invariant());
952  ensure(is_initialized());
953 
954  // Exit:
955 
956  return;
957 }
958 
959 // PROTECTED DATA MEMBERS
960 
961 // PRIVATE DATA MEMBERS
962 
963 
964 // ===========================================================
965 // FACTORY FACET
966 // ===========================================================
967 
968 // PUBLIC DATA MEMBERS
969 
970 const std::string&
972 class_name() const
973 {
974  static const string result("point_block_crg_interval");
975  return result;
976 }
977 
978 // PROTECTED DATA MEMBERS
979 
980 // PRIVATE DATA MEMBERS
981 
982 bool
983 fiber_bundle::point_block_crg_interval::
984 make_prototype()
985 {
986  // Preconditions:
987 
988 
989  // Body:
990 
992 
993  interval_factory().insert_prototype(lproto);
994 
995  // Postconditions:
996 
997 
998  // Exit:
999 
1000  return true;
1001 }
1002 
1003 
1004 // ===========================================================
1005 // ANY FACET
1006 // ===========================================================
1007 
1008 // PUBLIC DATA MEMBERS
1009 
1010 bool
1012 is_ancestor_of(const any* other) const
1013 {
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 point_block_crg_interval*>(other) != 0;
1024 
1025  // Postconditions:
1026 
1027  return result;
1028 }
1029 
1032 clone() const
1033 {
1034  // Preconditions:
1035 
1036  // Body:
1037 
1039 
1040  // Postconditions:
1041 
1042  ensure(result != 0);
1043  ensure(is_same_type(result));
1044 
1045  // Exit:
1046 
1047  return result;
1048 }
1049 
1050 bool
1052 invariant() const
1053 {
1054  bool result = true;
1055 
1056  if(invariant_check())
1057  {
1058  // Prevent recursive calls to invariant
1059 
1060  disable_invariant_check();
1061 
1062  // Must satisfy base class invariant
1063 
1064  invariance(homogeneous_block_crg_interval::invariant());
1065 
1066  // Invariances for this class:
1067 
1068  invariance(dof_tuple_ids_initialized() ? is_valid(block_dof_tuple_id()) : true);
1069  invariance(dof_tuple_ids_initialized() ? is_valid(zone_dof_tuple_id()) : true);
1070  invariance(dof_tuple_ids_initialized() ? is_valid(vertex_dof_tuple_id()) : true);
1071 
1072  // Finished, turn invariant checking back on.
1073 
1074  enable_invariant_check();
1075  }
1076 
1077  // Exit
1078 
1079  return result;
1080 }
1081 
1082 // PROTECTED DATA MEMBERS
1083 
1084 // PRIVATE DATA MEMBERS
1085 
1086 
1087 // ===========================================================
1088 // NON-MEMBER FUNCTIONS
1089 // ===========================================================
1090 
1091 
1092 
virtual pod_type index() const
Index of this space.
virtual const std::string & class_name() const
The name of this class; provided to satisfy factory template.
static void get_dof_tuple_ids(poset_state_handle &xhost, size_type xi_size, block< pod_index_type > &result)
The dof tuple ids for an instance created with parameter xi_size.
size_type ct() const
The number of items currently in use.
An abstract iterator over the ids of an id space.
virtual void initialize_upper_covers()
Initialize the upper cover for this interval.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
subposet & d_cells(int xd)
The subposet containing the cells of dimension xd (mutable version).
A client handle for a general, abstract partially order set.
unary_index to_row_major_offset(const ternary_index &xindex) const
Converts xindex to a unary_index using row-major ordering.
An map implementation of class scattered_insertion_index_space_handle. This representation is intende...
STL namespace.
void reserve(index_type xub)
Makes ub() at least xub; if new storage is allocated, it is uninitialized.
virtual void next()=0
Makes id() the next id in the iteration.
virtual size_type implicit_private_data_size() const
The size of the private data.
static void get_private_data(size_type xi_size, block< pod_index_type > &result)
The private data for an instance with parameter xi_size.
void initialize_vertices(base_space_poset &xhost)
Initialize the vertex id space.
void append_upper_cover_of_bottom(pod_index_type xmbr_hub_begin, pod_index_type xmbr_hub_end)
Appends the interval of hub ids [xmbr_hub_begin, xmbr_hub_end) to the upper cover of bottom...
Abstract base class with useful features for all objects.
Definition: any.h:39
The lattice of closed cells of a cellular space; a lattice representation of a computational mesh...
bool is_done() const
True if iteration is finished.
virtual point_block_crg_interval * clone() const
Virtual constructor, makes a new instance of the same type as this.
Emulator for a interval of implicit base space members representing a homogeneous collection of uncon...
void set_ct(size_type xct)
Sets ct() == xct.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
const bool UPPER
Selector for upper cover.
Definition: sheaf.h:72
unary_index to_row_major_offset(const binary_index &xindex) const
Converts xindex to a unary_index using row-major ordering.
A bounded domain for ternary_index objects.
virtual void finalize(poset_state_handle &xhost)
Finialize the initialization of this crg interval in the host xhost.
const bool LOWER
Selector for lower cover.
Definition: sheaf.h:67
virtual int db(pod_index_type xmbr_id) const
The dimension of the member with id xmbr_id. Does not require access to dof tuple.
A bounded domain for binary_index objects.
static void get_size(size_type xi_size, size_type &result)
The size for an instance created with parameters xi_size, xj_size, xk_size.
virtual void put_implicit_private_data(const block< pod_index_type > &xdata)
Initializes this using private data xdata.
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
void initialize_block_vertices(pod_index_type *xdata)
Initialize the block vertices id space from the private data xdata.
void push_back(const scoped_index &xhub_id)
Make the next id in this space equivalent to xhub_id in the hub id space. synonym for push_back(xhub_...
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.
virtual void initialize_lower_covers()
Initialize the lower covers for this interval.
virtual void get_implicit_private_data(block< pod_index_type > &xdata) const
The private data for this instance.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
Definition: pod_types.cc:31
virtual pod_index_type d_cells_space_id(int xd) const
The id space index for the cells of dimension xd. Returns invalid_pod_index() if there is no id space...
virtual bool invariant() const
Class invariant.
pod_type hub_pod() const
The current unglued hub id in the iteration. synonym for unglued_hub_pod().