21 #include "SheafSystem/structured_block_3d_crg_interval.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/base_space_poset.h" 25 #include "SheafSystem/constant_index_space_interval.h" 26 #include "SheafSystem/error_message.h" 27 #include "SheafSystem/explicit_index_space_interval.h" 28 #include "SheafSystem/factory.h" 29 #include "SheafSystem/offset_index_space_handle.h" 30 #include "SheafSystem/offset_index_space_state.h" 31 #include "SheafSystem/list_index_space_handle.h" 32 #include "SheafSystem/list_index_space_state.h" 33 #include "SheafSystem/ijk_adjacency_index_space_interval.h" 34 #include "SheafSystem/ijk_connectivity_index_space_interval.h" 35 #include "SheafSystem/ijk_product_structure.h" 36 #include "SheafSystem/index_space_iterator.h" 37 #include "SheafSystem/section_space_schema_member.h" 38 #include "SheafSystem/std_iomanip.h" 39 #include "SheafSystem/std_string.h" 40 #include "SheafSystem/std_sstream.h" 41 #include "SheafSystem/structured_block_3d.h" 74 ensure(!is_initialized());
90 _id_spaces->delete_space(_lower_covers_begin);
94 _id_spaces->delete_space(_lower_covers_begin + 1);
98 _id_spaces->delete_space(_lower_covers_begin + 1 + _zone_size);
105 _id_spaces->delete_space(_upper_covers_begin);
109 _id_spaces->delete_space(_upper_covers_begin + 1);
113 _id_spaces->delete_space(_upper_covers_begin + 1 + _zone_size);
153 require((0 <= xi) && (xi <= i_size()));
154 require((0 <= xj) && (xj <= j_size()));
155 require((0 <= xk) && (xk <= k_size()));
160 (xi*_j_vertex_size + xj)*_k_vertex_size + xk + _vertex_begin;
164 ensure(contains_member(result));
199 require(id_spaces_initialized());
200 require(local_id_space_initialized());
201 require(!zones_initialized());
207 const string& lzone_id_space_name =
208 section_space_schema_member::intersection_id_space_name(xhost.
d_cells(3),
212 offset_index_space_state::new_space(*_id_spaces,
217 _zones_initialized =
true;
222 _id_spaces->new_product_structure(_zones_space_id, lzone_structure);
226 ensure(zones_initialized());
227 ensure(id_spaces().has_product_structure(zones_space_id()));
228 ensure(id_spaces().product_structure_conforms_to<ijk_product_structure>(_zones_space_id));
252 require(id_spaces_initialized());
253 require(local_id_space_initialized());
254 require(!vertices_initialized());
260 const string& lvertex_id_space_name =
261 section_space_schema_member::intersection_id_space_name(xhost.
d_cells(0),
265 offset_index_space_state::new_space(*_id_spaces,
266 lvertex_id_space_name,
268 _vertex_size).index();
270 _vertices_initialized =
true;
275 _id_spaces->new_product_structure(_vertices_space_id, lvertex_structure);
279 ensure(vertices_initialized());
280 ensure(id_spaces().has_product_structure(vertices_space_id()));
281 ensure(id_spaces().product_structure_conforms_to<ijk_product_structure>(_vertices_space_id));
303 require(contains_member(xmbr_id));
307 static const int ldb[MEMBER_CLASS_END] =
312 int result = ldb[member_class(xmbr_id)];
335 result = _vertices_space_id;
339 result = _zones_space_id;
373 require(!block_vertices_initialized());
374 require(vertices_initialized());
381 list_index_space_state::new_space(*_id_spaces,
382 block_vertices_name(),
385 _block_vertices_space_id = lblock_vertices_id_space.
index();
395 lblock_vertices_id_space.
push_back(_vertex_begin);
399 lblock_vertices_id_space.
push_back(vertex_id(I, 0, 0));
403 lblock_vertices_id_space.
push_back(vertex_id(I, J, 0));
407 lblock_vertices_id_space.
push_back(vertex_id(0, J, 0));
411 lblock_vertices_id_space.
push_back(vertex_id(0, 0, K));
415 lblock_vertices_id_space.
push_back(vertex_id(I, 0, K));
419 lblock_vertices_id_space.
push_back(vertex_id(I, J, K));
423 lblock_vertices_id_space.
push_back(vertex_id(0, J, K));
427 _block_vertices_initialized =
true;
431 ensure(block_vertices_initialized());
478 size_type lzone_size = xi_size*xj_size*xk_size;
479 size_type lvertex_size = (xi_size + 1)*(xj_size + 1)*(xk_size + 1);
481 result = 1 + lzone_size + lvertex_size;
510 require(id_spaces_initialized());
511 require(local_id_space_initialized());
512 require(!covers_initialized(
LOWER));
521 _lower_covers_begin =
522 explicit_index_space_interval::new_space(*_id_spaces, 1).begin();
524 offset_index_space_state::new_space(*_id_spaces,
526 implicit_cover_name(
LOWER, interval_member()),
539 _connectivity_begin =
540 ijk_connectivity_index_space_interval::new_space(*_id_spaces,
550 constant_index_space_interval::new_space(*_id_spaces,
556 _lower_covers_initialized =
true;
560 ensure(covers_initialized(
LOWER));
573 require(id_spaces_initialized());
574 require(local_id_space_initialized());
575 require(!covers_initialized(
UPPER));
583 _upper_covers_begin =
584 explicit_index_space_interval::new_space(*_id_spaces, 1).begin();
586 list_index_space_state::new_space(*_id_spaces,
588 explicit_cover_name(
UPPER, interval_member()),
595 constant_index_space_interval::new_space(*_id_spaces,
609 ijk_adjacency_index_space_interval::new_space(*_id_spaces,
618 _upper_covers_initialized =
true;
622 ensure(covers_initialized(
UPPER));
651 result.
reserve(MEMBER_CLASS_END);
652 result.
set_ct(MEMBER_CLASS_END);
655 result[BLOCK] = structured_block_3d::new_row_dof_map(xhost, xi_size, xj_size, xk_size,
true).hub_pod();
656 result[ZONE] = base_space_member::new_row_dof_map(xhost,
"hex_nodes",
true).hub_pod();
657 result[VERTEX] = base_space_member::new_row_dof_map(xhost,
"point",
true).hub_pod();
728 ensure(xdata.
ct() == implicit_private_data_size());
747 _jk_size = _j_size*_k_size;
749 _i_vertex_size = _i_size + 1;
750 _j_vertex_size = _j_size + 1;
751 _k_vertex_size = _k_size + 1;
752 _jk_vertex_size = _j_vertex_size*_k_vertex_size;
754 _zone_begin = implicit_begin();
755 _zone_size = _i_size*_j_size*_k_size;
757 _vertex_begin = _zone_begin + _zone_size;
758 _vertex_size = _i_vertex_size*_jk_vertex_size;
784 require(dynamic_cast<base_space_poset*>(&xhost) != 0);
793 initialize_zones(lhost);
797 initialize_vertices(lhost);
801 initialize_block_vertices();
809 lhost.insert_interval_in_standard_subposets(*
this);
814 _vertex_begin + _vertex_size);
816 homogeneous_block_crg_interval::finalize(xhost);
821 ensure(is_initialized());
843 static const string result(
"structured_block_3d_crg_interval");
852 fiber_bundle::structured_block_3d_crg_interval::
862 interval_factory().insert_prototype(lproto);
911 ensure(is_same_type(result));
924 if(invariant_check())
928 disable_invariant_check();
932 invariance(homogeneous_block_crg_interval::invariant());
936 invariance(dof_tuple_ids_initialized() ?
is_valid(block_dof_tuple_id()) :
true);
937 invariance(dof_tuple_ids_initialized() ?
is_valid(zone_dof_tuple_id()) :
true);
938 invariance(dof_tuple_ids_initialized() ?
is_valid(vertex_dof_tuple_id()) :
true);
942 enable_invariant_check();
void initialize_zones(base_space_poset &xhost)
Initialize the zones id space.
virtual ~structured_block_3d_crg_interval()
Destructor.
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 void finalize(poset_state_handle &xhost)
Finialize the initialization of this crg interval in the host xhost.
A 3D implementation of abstract_product_structure.
virtual pod_type index() const
Index of this space.
size_type ct() const
The number of items currently in use.
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.
A client handle for a general, abstract partially order set.
An map implementation of class scattered_insertion_index_space_handle. This representation is intende...
virtual structured_block_3d_crg_interval * clone() const
Virtual constructor, makes a new instance of the same type as this.
void reserve(index_type xub)
Makes ub() at least xub; if new storage is allocated, it is uninitialized.
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.
structured_block_3d_crg_interval()
Default Constructor.
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...
size_type i_size() const
The number of zones in the i direction in this block.
Abstract base class with useful features for all objects.
The lattice of closed cells of a cellular space; a lattice representation of a computational mesh...
virtual bool invariant() const
Class invariant.
static void get_private_data(size_type xi_size, size_type xj_size, size_type xk_size, block< pod_index_type > &result)
The private data for an instance with parameter xi_size.
void push_back(const_reference_type item)
Insert item at the end of the items in the auto_block.
void initialize_block_vertices()
Initialize the block vertices id space.
void set_ct(size_type xct)
Sets ct() == xct.
static void get_dof_tuple_ids(poset_state_handle &xhost, size_type xi_size, size_type xj_size, size_type xk_size, block< pod_index_type > &result)
The dof tuple ids for an instance created with parameter xi_size.
pod_index_type vertex_id(pod_index_type xi, pod_index_type xj, pod_index_type xk) const
The index of the vertex identified by tuple (xi, xj, xk).
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
const bool UPPER
Selector for upper cover.
size_type k_size() const
The number of zones in the k direction in this block.
virtual size_type implicit_private_data_size() const
The size of the private data.
const bool LOWER
Selector for lower cover.
size_type j_size() const
The number of zones in the j direction in this block.
virtual const std::string & class_name() const
The name of this class; provided to satisfy factory template.
virtual void initialize_upper_covers()
Initialize the upper cover for this interval.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
int_type pod_index_type
The plain old data index type.
void initialize_vertices(base_space_poset &xhost)
Initialize the vertex id space.
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_...
virtual void get_implicit_private_data(block< pod_index_type > &xdata) const
The private data for this instance.
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
Emulator for a interval of implicit base space members representing a 3 dimensional structured block...
Namespace for the fiber_bundles component of the sheaf system.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
static void get_size(size_type xi_size, size_type xj_size, size_type xk_size, size_type &result)
The size for an instance created with parameter xi_size.