SheafSystem  0.0.0.0
zone_nodes_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/zone_nodes_block_crg_interval.h"
22 
23 #include "SheafSystem/array_implicit_index_space_iterator.h"
24 #include "SheafSystem/array_index_space_interval.h"
25 #include "SheafSystem/assert_contract.h"
26 #include "SheafSystem/block_connectivity.h"
27 #include "SheafSystem/constant_index_space_interval.h"
28 #include "SheafSystem/error_message.h"
29 #include "SheafSystem/explicit_index_space_interval.h"
30 #include "SheafSystem/factory.h"
31 #include "SheafSystem/offset_index_space_handle.h"
32 #include "SheafSystem/offset_index_space_state.h"
33 #include "SheafSystem/list_index_space_handle.h"
34 #include "SheafSystem/list_index_space_state.h"
35 #include "SheafSystem/hash_index_space_handle.h"
36 #include "SheafSystem/hash_index_space_state.h"
37 #include "SheafSystem/homogeneous_block.h"
38 #include "SheafSystem/index_space_iterator.h"
39 #include "SheafSystem/ragged_array_index_space_interval.h"
40 #include "SheafSystem/section_space_schema_member.h"
41 #include "SheafSystem/std_iomanip.h"
42 #include "SheafSystem/std_string.h"
43 #include "SheafSystem/std_sstream.h"
44 
45 using namespace std;
46 using namespace fiber_bundle; // Workaround for MS C++ bug.
47 
48 // #define DIAGNOSTIC_OUTPUT
49 // #undef DIAGNOSTIC_OUTPUT
50 
51 namespace
52 {
53  const sheaf::size_type NODE_IDS_BEGIN = 4;
54  const sheaf::size_type EXPLICIT_PRIVATE_DATA_SIZE = 2;
55 }
56 
57 
58 // ===========================================================
59 // ZONE_NODES_BLOCK_CRG_INTERVAL FACET
60 // ===========================================================
61 
62 // PUBLIC DATA MEMBERS
63 
66 {
67  // Preconditions:
68 
69  // Body:
70 
71  _nodes_per_zone = 0;
72  _zone_db = -1;
73  _vertex_client_id_space_initialized = false;
74  _vertex_client_space_id = invalid_pod_index();
75 
76  _zone_begin = 0;
77  _zone_size = 0;
78 
79  _vertex_begin = 0;
80  _vertex_size = 0;
81 
82  // Postconditions:
83 
84  ensure(invariant());
85  ensure(!is_initialized());
86 
87  return;
88 }
89 
90 
93 {
94  // Preconditions:
95 
96  // Body:
97 
98  if(is_valid(_lower_covers_begin))
99  {
100  // Delete the block interval.
101 
102  _id_spaces->delete_space(_lower_covers_begin);
103 
104  // Delete the zones interval.
105 
106  _id_spaces->delete_space(_lower_covers_begin + 1);
107 
108  // Delete the vertices interval.
109 
110  _id_spaces->delete_space(_lower_covers_begin + 1 + _zone_size);
111  }
112 
113  if(is_valid(_upper_covers_begin))
114  {
115  // Delete the block interval.
116 
117  _id_spaces->delete_space(_upper_covers_begin);
118 
119  // Delete the zones interval.
120 
121  _id_spaces->delete_space(_upper_covers_begin + 1);
122 
123  // Delete the vertices interval.
124 
125  _id_spaces->delete_space(_upper_covers_begin + 1 + _zone_size);
126  }
127 
128  if(is_valid(_vertex_client_space_id))
129  {
130  _id_spaces->delete_space(_vertex_client_space_id);
131  }
132 
133  // Postconditions:
134 
135  // Exit:
136 
137  return;
138 }
139 
140 // PROTECTED DATA MEMBERS
141 
142 const std::string&
143 fiber_bundle::zone_nodes_block_crg_interval::
144 zone_prototype_name(const block_connectivity& xconn)
145 {
146  // Preconditions:
147 
148 
149  // Body:
150 
151  static const string prototype_names[block_connectivity::CELL_TYPE_END] =
152  {
153  "point",
154  "segment_complex",
155  "quad_nodes",
156  "triangle_nodes",
157  "hex_nodes",
158  "tetra_nodes"
159  };
160 
161  const string& result = prototype_names[xconn.element_type()];
162 
163  // Postconditions:
164 
165  ensure(!result.empty());
166 
167  // Exit:
168 
169  return result;
170 }
171 
172 
173 int
174 fiber_bundle::zone_nodes_block_crg_interval::
175 zone_db(const block_connectivity& xconn)
176 {
177  // Preconditions:
178 
179  // Body:
180 
181  static const int ldb[block_connectivity::CELL_TYPE_END] =
182  {
183  0, 1, 2, 2, 3, 3
184  };
185 
186  int result = ldb[xconn.element_type()];
187 
188  // Postconditions:
189 
190  ensure(result >= 0);
191 
192  // Exit:
193 
194  return result;
195 }
196 
197 // PRIVATE DATA MEMBERS
198 
199 
200 // ===========================================================
201 // VERTEX CLIENT ID SPACE FACET
202 // ===========================================================
203 
204 // PUBLIC DATA MEMBERS
205 
206 bool
209 {
210  // Preconditions:
211 
212  // Body:
213 
214  bool result = _vertex_client_id_space_initialized;
215 
216  // Postconditions:
217 
218  ensure(is_basic_query);
219 
220  // Exit:
221 
222  return result;
223 }
224 
228 {
229  // Preconditions:
230 
231  require(vertex_client_id_space_initialized());
232 
233  // Body:
234 
235  pod_index_type result = _vertex_client_space_id;
236 
237  // Postconditions:
238 
239  ensure(is_basic_query);
240 
241  // Exit:
242 
243  return result;
244 }
245 
246 // PROTECTED DATA MEMBERS
247 
248 std::string
251 {
252  // Preconditions:
253 
254  // Body:
255 
256  string result(poset_path::make_reserved_name("", interval_member(), "_vertex_client_ids"));
257 
258  // Postconditions:
259 
260  ensure(!result.empty());
261 
262  // Exit:
263 
264  return result;
265 }
266 
267 void
270 {
271  // Preconditions:
272 
273  require(id_spaces_initialized());
274  require(local_id_space_initialized());
275 
276  // Body:
277 
278  pod_index_type lzone_begin = implicit_begin();
279 
280  string lname = vertex_client_id_space_name();
281 
282  // Create the id space.
283 
284  scattered_insertion_index_space_handle lclient_id_space =
285  hash_index_space_state::new_space(*_id_spaces,
286  lname,
287  false,
288  xadjacency.node_ct());
289 
290  // Populate the id space.
291 
292  pod_index_type lhub_vertex_id = lzone_begin + xadjacency.zone_ct();
293  typedef block_adjacency::const_node_iterator_type node_itr_type;
294 
295  for(node_itr_type v = xadjacency.begin(); v != xadjacency.end(); ++v)
296  {
297  lclient_id_space.insert(v->first, lhub_vertex_id);
298  ++lhub_vertex_id;
299  }
300 
301  assertion(lhub_vertex_id == lzone_begin + xadjacency.zone_ct() + xadjacency.node_ct());
302 
303  _vertex_client_space_id = lclient_id_space.index();
304  _vertex_client_id_space_initialized = true;
305 
306  // Postconditions:
307 
308  ensure(vertex_client_id_space_initialized());
309  ensure(id_spaces().ct(vertex_client_space_id()) == _vertex_size);
310 
311  // Exit:
312 
313  return;
314 }
315 
316 // PRIVATE DATA MEMBERS
317 
318 
319 // ===========================================================
320 // HOMOGENEOUS_BLOCK_CRG_INTERVAL FACET
321 // ===========================================================
322 
323 // PUBLIC DATA MEMBERS
324 
325 // PROTECTED DATA MEMBERS
326 
327 // PRIVATE DATA MEMBERS
328 
329 
330 // ===========================================================
331 // ZONES FACET
332 // ===========================================================
333 
334 // PUBLIC DATA MEMBERS
335 
336 // PROTECTED DATA MEMBERS
337 
338 void
341 {
342  // Preconditions:
343 
344  require(id_spaces_initialized());
345  require(local_id_space_initialized());
346  require(!zones_initialized());
347 
348  // Body:
349 
350  // Construct the zone id space.
351 
352  const string& lzone_id_space_name =
353  section_space_schema_member::intersection_id_space_name(xhost.d_cells(_zone_db), interval_member());
354 
355  _zones_space_id =
356  offset_index_space_state::new_space(*_id_spaces,
357  lzone_id_space_name,
358  _zone_begin,
359  _zone_size).index();
360 
361  _zones_initialized = true;
362 
363  // Postconditions:
364 
365  ensure(zones_initialized());
366 
367  // Exit:
368 
369  return;
370 }
371 
372 // PRIVATE DATA MEMBERS
373 
374 
375 // ===========================================================
376 // VERTICES FACET
377 // ===========================================================
378 
379 // PUBLIC DATA MEMBERS
380 
381 // PROTECTED DATA MEMBERS
382 
383 void
386 {
387  // Preconditions:
388 
389  require(id_spaces_initialized());
390  require(local_id_space_initialized());
391  require(!vertices_initialized());
392 
393  // Body:
394 
395  // Construct the vertex id space.
396 
397  const string& lvertex_id_space_name =
398  section_space_schema_member::intersection_id_space_name(xhost.d_cells(0),
399  interval_member());
400 
401  _vertices_space_id =
402  offset_index_space_state::new_space(*_id_spaces,
403  lvertex_id_space_name,
404  _vertex_begin,
405  _vertex_size).index();
406 
407  _vertices_initialized = true;
408 
409  // Postconditions:
410 
411  ensure(vertices_initialized());
412 
413  // Exit:
414 
415  return;
416 }
417 
418 // PRIVATE DATA MEMBERS
419 
420 
421 // ===========================================================
422 // BASE_SPACE_CRG_INTERVAL FACET
423 // ===========================================================
424 
425 int
427 db(pod_index_type xmbr_id) const
428 {
429  // Preconditions:
430 
431  require(contains_member(xmbr_id));
432 
433  // Body:
434 
435  int result = (member_class(xmbr_id) == VERTEX) ? 0 : _zone_db;
436 
437  // Postconditions:
438 
439  ensure(result >= 0);
440 
441  // Exit:
442 
443  return result;
444 }
445 
448 d_cells_space_id(int xd) const
449 {
450  // Preconditions:
451 
452  // Body:
453 
454  pod_index_type result;
455 
456  if(xd == 0)
457  {
458  result = _vertices_space_id;
459  }
460  else if(xd == _zone_db)
461  {
462  result = _zones_space_id;
463  }
464  else
465  {
466  result = invalid_pod_index();
467  }
468 
469  // Postconditions:
470 
471  // Exit:
472 
473  return result;
474 }
475 
476 // PROTECTED DATA MEMBERS
477 
478 // PRIVATE DATA MEMBERS
479 
480 
481 // ===========================================================
482 // BLOCK VERTICES FACET
483 // ===========================================================
484 
485 // PUBLIC DATA MEMBERS
486 
487 // PROTECTED DATA MEMBERS
488 
489 void
492 {
493  // Preconditions:
494 
495  require(!block_vertices_initialized());
496  require(vertices_initialized());
497 
498  // Body:
499 
500  _block_vertices_space_id =
501  list_index_space_state::new_space(*_id_spaces,
502  block_vertices_name(),
503  false).index();
504 
505  // Block vertices id space is empty.
506 
507  _block_vertices_initialized = true;
508 
509  // Postconditions:
510 
511  ensure(block_vertices_initialized());
512 
513  // Exit:
514 
515  return;
516 }
517 
518 // PRIVATE DATA MEMBERS
519 
520 
521 // ===========================================================
522 // INTERVAL FACET
523 // ===========================================================
524 
525 // PUBLIC DATA MEMBERS
526 
527 void
529 get_size(const block_connectivity& xconn, size_type& result)
530 {
531  // Preconditions:
532 
533 
534  // Body:
535 
536  // Size is number of zones + number of nodes + 1.
537 
538  result = xconn.element_ct() + xconn.node_ct() + 1;
539 
540  // Postconditions:
541 
542 
543  // Exit:
544 
545  return;
546 }
547 
548 // PROTECTED DATA MEMBERS
549 
550 // PRIVATE DATA MEMBERS
551 
552 
553 // ===========================================================
554 // COVER SET FACET
555 // ===========================================================
556 
557 // PUBLIC DATA MEMBERS
558 
559 // PROTECTED DATA MEMBERS
560 
561 void
564 {
565  // Preconditions:
566 
567  require(id_spaces_initialized());
568  require(local_id_space_initialized());
569  require(!covers_initialized(LOWER));
570 
571  // Body:
572 
573  // Construct the lower cover of the block.
574  //
575  // The lower cover of the block is initialized to an id space that contains
576  // all the zones. The initial value is the same as the zone id.
577 
578  _lower_covers_begin =
579  explicit_index_space_interval::new_space(*_id_spaces, 1).begin();
580 
581  offset_index_space_state::new_space(*_id_spaces,
582  _lower_covers_begin,
583  implicit_cover_name(LOWER, interval_member()),
584  _zone_begin,
585  _zone_size);
586 
587  // Construct the lower cover of the zones.
588  //
589  // The lower cover of the zones is initialized to the nodal connectivity.
590  // The user may change the lower cover of the zones by using the explicit
591  // overrides in crg_range. However, the underlineing connectivity id space
592  // interval will remain in the id space family. For that reason, we can
593  // set use the interval created below as the connectivity id space interval.
594 
595  _connectivity_begin =
596  array_index_space_interval::new_space(*_id_spaces,
597  _zone_size,
598  _connectivity,
599  _nodes_per_zone,
600  false).begin();
601 
602  // Construct the lower cover of the vertices.
603  //
604  // The lower cover of the vertices is initialized to bottom.
605 
606  constant_index_space_interval::new_space(*_id_spaces,
607  _vertex_size,
608  BOTTOM_INDEX);
609 
610  // The lower cover is initialized.
611 
612  _lower_covers_initialized = true;
613 
614  // Posconditions:
615 
616  ensure(covers_initialized(LOWER));
617 
618  // Exit:
619 
620  return;
621 }
622 
623 void
626 {
627  // Preconditions:
628 
629  require(id_spaces_initialized());
630  require(local_id_space_initialized());
631  require(!covers_initialized(UPPER));
632 
633  // Body:
634 
635  // Construct the upper cover of the block
636  //
637  // The upper cover of block is initialized to an empty explicit id space.
638 
639  _upper_covers_begin =
640  explicit_index_space_interval::new_space(*_id_spaces, 1).begin();
641 
642  list_index_space_state::new_space(*_id_spaces,
643  _upper_covers_begin,
644  explicit_cover_name(UPPER, interval_member()),
645  false);
646 
647  // Construct the upper cover of the zones.
648  //
649  // The upper cover of the zones is initialized to the block.
650 
651  constant_index_space_interval::new_space(*_id_spaces,
652  _zone_size,
653  interval_member());
654 
655  // Construct the upper cover of the vertices.
656  //
657  // The upper cover of the vertices is initialized to the zonal adjacency.
658  // The user may change the upper cover of the vertices by using the explicit
659  // overrides in crg_range. However, the underlineing adjacency id space
660  // interval will remain in the id space family. For that reason, we can
661  // the interval created below as the adjacency interval.
662 
663  _adjacency_begin =
664  ragged_array_index_space_interval::new_space(*_id_spaces,
665  _vertex_size,
666  _adjacency,
667  false).begin();
668 
669  // The upper cover is initialized.
670 
671  _upper_covers_initialized = true;
672 
673  // Posconditions:
674 
675  ensure(covers_initialized(UPPER));
676 
677  // Exit:
678 
679  return;
680 }
681 
682 // PRIVATE DATA MEMBERS
683 
684 
685 // ===========================================================
686 // DOF_TUPLE_ID FACET
687 // ===========================================================
688 
689 // PUBLIC DATA MEMBERS
690 
691 void
694  const block_connectivity& xconn,
695  block<pod_index_type>& result)
696 {
697  // Preconditions:
698 
699 
700  // Body:
701 
702  result.reserve(MEMBER_CLASS_END);
703  result.set_ct(MEMBER_CLASS_END);
704 
705  string lname = zone_prototype_name(xconn);
706  size_type lzone_ct = xconn.element_ct();
707 
708  result[BLOCK] =
709  homogeneous_block::new_row_dof_map(xhost, "unstructured_block", lname, lzone_ct, true).hub_pod();
710  result[ZONE] = base_space_member::new_row_dof_map(xhost, lname, true).hub_pod();
711  result[VERTEX] = base_space_member::new_row_dof_map(xhost, "point", true).hub_pod();
712 
713  // Postconditions:
714 
715 
716  // Exit:
717 
718  return;
719 }
720 
721 // PROTECTED DATA MEMBERS
722 
723 // PRIVATE DATA MEMBERS
724 
725 
726 // ===========================================================
727 // PRIVATE_DATA FACET
728 // ===========================================================
729 
730 // PUBLIC DATA MEMBERS
731 
732 void
735  block<pod_index_type>& xdata)
736 {
737  // Preconditions:
738 
739  // Body:
740 
741  size_type lnode_ids_ct = xconn.node_id_ct();
742 
743  size_type lpd_size = lnode_ids_ct + NODE_IDS_BEGIN + EXPLICIT_PRIVATE_DATA_SIZE;
744  xdata.reserve(lpd_size);
745  xdata.set_ct(lpd_size);
746 
747  size_type j=0;
748  xdata[j++] = zone_db(xconn); // xdata[0]
749  xdata[j++] = xconn.element_ct(); // xdata[1]
750  xdata[j++] = xconn.nodes_per_element(); // xdata[2]
751  xdata[j++] = lnode_ids_ct; // xdata[3]
752 
753  const pod_index_type* lnode_ids = xconn.node_ids();
754 
755  for(size_type i = 0; i < lnode_ids_ct; ++i)
756  {
757  xdata[j++] = lnode_ids[i];
758  }
759 
760  // No explicit covers.
761 
762  xdata[j++] = 0;
763  xdata[j++] = 0;
764 
765  // Since xconn values are client ids,
766  // above call puts client ids in xdata.
767 
768  // Postconditions:
769 
770  ensure(unexecutable("node ids are clients ids"));
771 
772  // Exit:
773 
774  return;
775 }
776 
777 // PROTECTED DATA MEMBERS
778 
782 {
783  return _zone_size*_nodes_per_zone + NODE_IDS_BEGIN;
784 }
785 
786 void
789 {
790  // Preconditions:
791 
792  // Body:
793 
794  size_type lconn_size = _zone_size*_nodes_per_zone;
795 
796  size_type lpd_size = lconn_size + NODE_IDS_BEGIN;
797  xdata.set_ct(lpd_size);
798 
799  size_type j=0;
800  xdata[j++] = _zone_db; // xdata[0]
801  xdata[j++] = _zone_size; // xdata[1]
802  xdata[j++] = _nodes_per_zone; // xdata[2]
803  xdata[j++] = lconn_size; // xdata[3]
804 
805  scattered_insertion_index_space_handle& lclient_id_space =
806  _id_spaces->get_id_space<scattered_insertion_index_space_handle>(_vertex_client_space_id);
807 
808  for(pod_index_type i = 0; i < lconn_size; ++i)
809  {
810  xdata[j++] = lclient_id_space.pod(_connectivity[i]);
811  }
812 
813  // Postconditions:
814 
815  ensure(xdata.ct() == implicit_private_data_size());
816  ensure(unexecutable("node ids are clients ids"));
817 
818  // Exit:
819 
820  return;
821 }
822 
823 void
826 {
827  // Preconditions:
828 
829  require(xdata[3] == xdata[1]*xdata[2]);
830  require(xdata.ct() > NODE_IDS_BEGIN);
831  require(xdata.ct() >= xdata[3] + NODE_IDS_BEGIN);
832 
833  // Body:
834 
835  pod_index_type j=0;
836 
837  _zone_db = xdata[j++];
838  _zone_size = xdata[j++];
839  _nodes_per_zone = xdata[j++];
840 
841  size_type lconn_ct = xdata[j++];
842 
843  // Initialize the zone and vertex offsets into the hub id space.
844 
845  _zone_begin = implicit_begin();
846  _vertex_begin = _zone_begin + _zone_size;
847 
848  // Construct a block adjacency object.
849 
850  block_adjacency ladjacency(_zone_size, _nodes_per_zone,
851  lconn_ct, &xdata[j]);
852 
853  // Initialize the number of vertices.
854 
855  _vertex_size = ladjacency.node_ct();
856 
857  // Initialize the vertex client id space.
858 
859  initialize_vertex_client_id_space(ladjacency);
860 
861  // Initialize the connectivity array. This array is passed to
862  // the array interval when constructing the lower cover of the
863  // zones.
864 
865  scattered_insertion_index_space_handle& lclient_id_space =
866  _id_spaces->get_id_space<scattered_insertion_index_space_handle>(_vertex_client_space_id);
867 
868  _connectivity.reserve(lconn_ct);
869  _connectivity.set_ct(lconn_ct);
870 
871  for(pod_index_type i = 0; i < lconn_ct; i++)
872  {
873  _connectivity[i] = lclient_id_space.hub_pod(xdata[j++]);
874  }
875 
876  _id_spaces->release_id_space(lclient_id_space);
877 
878  // Initialize the adjacency array. This array is passed to
879  // the ragged array interval when constructing the upper cover
880  // of the vertices.
881 
882  typedef block_adjacency::const_node_iterator_type node_itr_type;
883  typedef block_adjacency::const_zone_iterator_type zone_itr_type;
884 
885  node_itr_type v = ladjacency.begin();
886 
887  while(v != ladjacency.end())
888  {
889  for(zone_itr_type z = v->second.begin(); z != v->second.end(); ++z)
890  {
891  _adjacency.push_back((*z) + _zone_begin);
892  }
893 
894  // Increment to the next vertex
895 
896  ++v;
897 
898  if(v != ladjacency.end())
899  {
900  _adjacency.new_back_row();
901  }
902  }
903 
904  // Postconditions:
905 
906  ensure(invariant());
907 
908  // Exit:
909 
910  return;
911 }
912 
913 // PRIVATE DATA MEMBERS
914 
915 
916 // ===========================================================
917 // FINIALIZE FACET
918 // ===========================================================
919 
920 // PUBLIC DATA MEMBERS
921 
922 void
925 {
926  // Preconditions:
927 
928  require(dynamic_cast<base_space_poset*>(&xhost) != 0);
929  require(xhost.state_is_read_accessible());
930 
931  // Body:
932 
933  base_space_poset& lhost = dynamic_cast<base_space_poset&>(xhost);
934 
935  // Initialize the zone id space.
936 
937  initialize_zones(lhost);
938 
939  // Initialize the vertex id space.
940 
941  initialize_vertices(lhost);
942 
943  // Initialize the block vertices id space.
944 
945  initialize_block_vertices();
946 
947  // Initialize the cover id spaces.
948 
949  initialize_covers();
950 
951  // Now this can be inserted in the standard subposets (d-cells, etc).
952 
953  lhost.insert_interval_in_standard_subposets(*this);
954 
955  // Insert the vertices into the upper cover of bottom.
956 
957  xhost.append_upper_cover_of_bottom(_vertex_begin,
958  _vertex_begin + _vertex_size);
959 
960  homogeneous_block_crg_interval::finalize(xhost);
961 
962  // Postconditions:
963 
964  ensure(invariant());
965  ensure(is_initialized());
966 
967  // Exit:
968 
969  return;
970 }
971 
972 // PROTECTED DATA MEMBERS
973 
974 // PRIVATE DATA MEMBERS
975 
976 
977 // ===========================================================
978 // FACTORY FACET
979 // ===========================================================
980 
981 // PUBLIC DATA MEMBERS
982 
983 const std::string&
985 class_name() const
986 {
987  static const string result("zone_nodes_block_crg_interval");
988  return result;
989 }
990 
991 bool
994 {
995  bool result =
996  homogeneous_block_crg_interval::is_initialized() &&
997  _vertex_client_id_space_initialized;
998 
999  return result;
1000 }
1001 
1002 // PROTECTED DATA MEMBERS
1003 
1004 // PRIVATE DATA MEMBERS
1005 
1006 bool
1007 fiber_bundle::zone_nodes_block_crg_interval::
1008 make_prototype()
1009 {
1010  // Preconditions:
1011 
1012 
1013  // Body:
1014 
1016 
1017  interval_factory().insert_prototype(lproto);
1018 
1019  // Postconditions:
1020 
1021 
1022  // Exit:
1023 
1024  return true;
1025 }
1026 
1027 
1028 // ===========================================================
1029 // ANY FACET
1030 // ===========================================================
1031 
1032 // PUBLIC DATA MEMBERS
1033 
1034 bool
1036 is_ancestor_of(const any* other) const
1037 {
1038 
1039  // Preconditions:
1040 
1041  require(other != 0);
1042 
1043  // Body:
1044 
1045  // True if other conforms to this
1046 
1047  bool result = dynamic_cast<const zone_nodes_block_crg_interval*>(other) != 0;
1048 
1049  // Postconditions:
1050 
1051  return result;
1052 }
1053 
1056 clone() const
1057 {
1058  // Preconditions:
1059 
1060  // Body:
1061 
1063 
1064  // Postconditions:
1065 
1066  ensure(result != 0);
1067  ensure(is_same_type(result));
1068 
1069  // Exit:
1070 
1071  return result;
1072 }
1073 
1074 bool
1076 invariant() const
1077 {
1078  bool result = true;
1079 
1080  if(invariant_check())
1081  {
1082  // Prevent recursive calls to invariant
1083 
1084  disable_invariant_check();
1085 
1086  // Must satisfy base class invariant
1087 
1088  invariance(homogeneous_block_crg_interval::invariant());
1089 
1090  // Invariances for this class:
1091 
1092  invariance(dof_tuple_ids_initialized() ? is_valid(block_dof_tuple_id()) : true);
1093  invariance(dof_tuple_ids_initialized() ? is_valid(zone_dof_tuple_id()) : true);
1094  invariance(dof_tuple_ids_initialized() ? is_valid(vertex_dof_tuple_id()) : true);
1095 
1096  // Finished, turn invariant checking back on.
1097 
1098  enable_invariant_check();
1099  }
1100 
1101  // Exit
1102 
1103  return result;
1104 }
1105 
1106 // PROTECTED DATA MEMBERS
1107 
1108 // PRIVATE DATA MEMBERS
1109 
1110 
1111 // ===========================================================
1112 // NON-MEMBER FUNCTIONS
1113 // ===========================================================
1114 
void initialize_block_vertices()
Initialize the block vertices id space.
void initialize_zones(base_space_poset &xhost)
Initialize the zones id space.
virtual pod_type index() const
Index of this space.
pod_index_type vertex_client_space_id() const
The index of the vertex client id space.
size_type ct() const
The number of items currently in use.
node_iterator_type begin()
Beginning of adjacency relation.
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.
virtual void initialize_lower_covers()
Initialize the lower covers 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).
virtual void put_implicit_private_data(const block< pod_index_type > &xdata)
Initializes this using private data xdata.
virtual zone_nodes_block_crg_interval * clone() const
Virtual constructor, makes a new instance of the same type as this.
A client handle for a general, abstract partially order set.
size_type node_id_ct() const
The number of entries in node_ids().
size_type zone_ct() const
The number of distinct zones.
STL namespace.
void reserve(index_type xub)
Makes ub() at least xub; if new storage is allocated, it is uninitialized.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
Zone to node connectivity relation for a block of zones of a given type.
virtual void finalize(poset_state_handle &xhost)
Finialize the initialization of this crg interval in the host xhost.
virtual const std::string & class_name() const
The name of this class; provided to satisfy factory template.
static void get_size(const block_connectivity &xconn, size_type &result)
The size of the interval for block connectivity xconn.
size_type node_ct() const
The number of distinct nodes.
static void get_private_data(const block_connectivity &xconn, block< pod_index_type > &result)
The private data for an instance with connectivity xconn.
pod_index_type * node_ids()
The nodal connectivity array.
virtual pod_type pod(pod_type xid) const
The pod index in this space equivalent to xid in the hub 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...
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...
adj_type::const_iterator const_node_iterator_type
Type of const iterator for nodes.
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...
virtual size_type implicit_private_data_size() const
The size of the private data.
size_type nodes_per_element() const
The number of nodes per element.
virtual cell_type element_type() const =0
The element (zone) type.
virtual index_space_handle & get_id_space() const
Allocates an id space handle from the handle pool.
void set_ct(size_type xct)
Sets ct() == xct.
void initialize_vertex_client_id_space(block_adjacency &xadjacency)
Initializes the vertex client id space.
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
void reserve(size_type xcapacity)
Reserve enough memory for xcapacity number of ids.
void insert(pod_type xid, const scoped_index &xhub_id)
Make id xid in this id space equivalent to xhub_id in the hub id space. synonym for insert(xid...
static void get_dof_tuple_ids(poset_state_handle &xhost, const block_connectivity &xconn, block< pod_index_type > &result)
The dof tuple ids for an instance created with parameter xi_size.
void initialize_vertices(base_space_poset &xhost)
Initialize the vertex id space.
virtual void initialize_upper_covers()
Initialize the upper cover for this interval.
Node to zone adjacency relation for a block of zones of a given type.
Emulator for a interval of implicit base space members representing an unstructured block...
const bool LOWER
Selector for lower cover.
Definition: sheaf.h:67
pod_type hub_pod(pod_type xid) const
The pod index in the unglued hub id space equivalent to xid in this id space; synonym for unglued_hub...
size_type node_ct() const
The number of distinct nodes.
size_type element_ct() const
The number of elements.
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
A handle for a scattered_insertion_index_space_state.
adj_type::mapped_type::const_iterator const_zone_iterator_type
Type of const iterator for zones.
virtual void get_implicit_private_data(block< pod_index_type > &xdata) const
Initializes this using private data xdata.
std::string vertex_client_id_space_name()
The reserved name for the vertex client id space of this interval.
node_iterator_type end()
End of adjacency relation.
bool vertex_client_id_space_initialized() const
True if and only if the vertex client id space has been initialized.
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.
virtual bool is_initialized() const
True if fully initialized.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
Definition: pod_types.cc:31