21 #include "SheafSystem/structured_block_2d_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/ij_adjacency_index_space_interval.h" 34 #include "SheafSystem/ij_connectivity_index_space_interval.h" 35 #include "SheafSystem/ij_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_2d.h" 70 ensure(!is_initialized());
86 _id_spaces->delete_space(_lower_covers_begin);
90 _id_spaces->delete_space(_lower_covers_begin + 1);
94 _id_spaces->delete_space(_lower_covers_begin + 1 + _zone_size);
101 _id_spaces->delete_space(_upper_covers_begin);
105 _id_spaces->delete_space(_upper_covers_begin + 1);
109 _id_spaces->delete_space(_upper_covers_begin + 1 + _zone_size);
163 require(id_spaces_initialized());
164 require(local_id_space_initialized());
165 require(!zones_initialized());
171 const string& lzone_id_space_name =
172 section_space_schema_member::intersection_id_space_name(xhost.
d_cells(2),
176 offset_index_space_state::new_space(*_id_spaces,
181 _zones_initialized =
true;
186 _id_spaces->new_product_structure(_zones_space_id, lzone_structure);
190 ensure(zones_initialized());
191 ensure(id_spaces().has_product_structure(zones_space_id()));
192 ensure(id_spaces().product_structure_conforms_to<ij_product_structure>(_zones_space_id));
216 require(id_spaces_initialized());
217 require(local_id_space_initialized());
218 require(!vertices_initialized());
224 const string& lvertex_id_space_name =
225 section_space_schema_member::intersection_id_space_name(xhost.
d_cells(0),
229 offset_index_space_state::new_space(*_id_spaces,
230 lvertex_id_space_name,
232 _vertex_size).index();
234 _vertices_initialized =
true;
239 _id_spaces->new_product_structure(_vertices_space_id, lvertex_structure);
243 ensure(vertices_initialized());
244 ensure(id_spaces().has_product_structure(vertices_space_id()));
245 ensure(id_spaces().product_structure_conforms_to<ij_product_structure>(_vertices_space_id));
267 require(contains_member(xmbr_id));
271 static const int ldb[MEMBER_CLASS_END] =
276 int result = ldb[member_class(xmbr_id)];
299 result = _vertices_space_id;
303 result = _zones_space_id;
337 require(!block_vertices_initialized());
338 require(vertices_initialized());
345 list_index_space_state::new_space(*_id_spaces,
346 block_vertices_name(),
349 _block_vertices_space_id = lblock_vertices_id_space.
index();
355 lblock_vertices_id_space.
push_back(_vertex_begin);
356 lblock_vertices_id_space.
push_back(_vertex_begin + (J+1)*I);
357 lblock_vertices_id_space.
push_back(_vertex_begin + (J+1)*I + J);
358 lblock_vertices_id_space.
push_back(_vertex_begin + J);
362 _block_vertices_initialized =
true;
366 ensure(block_vertices_initialized());
414 size_type lvertex_size = (xi_size + 1)*(xj_size + 1);
416 result = 1 + lzone_size + lvertex_size;
445 require(id_spaces_initialized());
446 require(local_id_space_initialized());
447 require(!covers_initialized(
LOWER));
456 _lower_covers_begin =
457 explicit_index_space_interval::new_space(*_id_spaces, 1).begin();
459 offset_index_space_state::new_space(*_id_spaces,
461 implicit_cover_name(
LOWER, interval_member()),
474 _connectivity_begin =
475 ij_connectivity_index_space_interval::new_space(*_id_spaces,
484 constant_index_space_interval::new_space(*_id_spaces,
490 _lower_covers_initialized =
true;
494 ensure(covers_initialized(
LOWER));
507 require(id_spaces_initialized());
508 require(local_id_space_initialized());
509 require(!covers_initialized(
UPPER));
517 _upper_covers_begin =
518 explicit_index_space_interval::new_space(*_id_spaces, 1).begin();
520 list_index_space_state::new_space(*_id_spaces,
522 explicit_cover_name(
UPPER, interval_member()),
529 constant_index_space_interval::new_space(*_id_spaces,
543 ij_adjacency_index_space_interval::new_space(*_id_spaces,
551 _upper_covers_initialized =
true;
555 ensure(covers_initialized(
UPPER));
583 result.
reserve(MEMBER_CLASS_END);
584 result.
set_ct(MEMBER_CLASS_END);
587 result[BLOCK] = structured_block_2d::new_row_dof_map(xhost, xi_size, xj_size,
true).hub_pod();
588 result[ZONE] = base_space_member::new_row_dof_map(xhost,
"quad_nodes",
true).hub_pod();
589 result[VERTEX] = base_space_member::new_row_dof_map(xhost,
"point",
true).hub_pod();
657 ensure(xdata.
ct() == implicit_private_data_size());
675 _i_vertex_size = _i_size + 1;
676 _j_vertex_size = _j_size + 1;
678 _zone_begin = implicit_begin();
679 _zone_size = _i_size*_j_size;
681 _vertex_begin = _zone_begin + _zone_size;
682 _vertex_size = _i_vertex_size*_j_vertex_size;
708 require(dynamic_cast<base_space_poset*>(&xhost) != 0);
717 initialize_zones(lhost);
721 initialize_vertices(lhost);
725 initialize_block_vertices();
733 lhost.insert_interval_in_standard_subposets(*
this);
738 _vertex_begin + _vertex_size);
740 homogeneous_block_crg_interval::finalize(xhost);
745 ensure(is_initialized());
767 static const string result(
"structured_block_2d_crg_interval");
776 fiber_bundle::structured_block_2d_crg_interval::
786 interval_factory().insert_prototype(lproto);
836 ensure(is_same_type(result));
849 if(invariant_check())
853 disable_invariant_check();
857 invariance(homogeneous_block_crg_interval::invariant());
861 invariance(dof_tuple_ids_initialized() ?
is_valid(block_dof_tuple_id()) :
true);
862 invariance(dof_tuple_ids_initialized() ?
is_valid(zone_dof_tuple_id()) :
true);
863 invariance(dof_tuple_ids_initialized() ?
is_valid(vertex_dof_tuple_id()) :
true);
867 enable_invariant_check();
virtual structured_block_2d_crg_interval * clone() const
Virtual constructor, makes a new instance of the same type as this.
size_type j_size() const
The number of zones in the j direction in this block.
virtual pod_type index() const
Index of this space.
size_type ct() const
The number of items currently in use.
size_type i_size() const
The number of zones in the i direction in this block.
virtual void finalize(poset_state_handle &xhost)
Finialize the initialization of this crg interval in the host xhost.
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.
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.
An map implementation of class scattered_insertion_index_space_handle. This representation is intende...
void reserve(index_type xub)
Makes ub() at least xub; if new storage is allocated, it is uninitialized.
virtual const std::string & class_name() const
The name of this class; provided to satisfy factory template.
Emulator for a interval of implicit base space members representing a 2 dimensional structured block...
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 void put_implicit_private_data(const block< pod_index_type > &xdata)
Initializes this using private data xdata.
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...
void push_back(const_reference_type item)
Insert item at the end of the items in the auto_block.
void set_ct(size_type xct)
Sets ct() == xct.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
const bool UPPER
Selector for upper cover.
virtual void initialize_upper_covers()
Initialize the upper cover for this interval.
virtual bool invariant() const
Class invariant.
virtual void initialize_lower_covers()
Initialize the lower covers for this interval.
static void get_private_data(size_type xi_size, size_type xj_size, block< pod_index_type > &result)
The private data for an instance with parameter xi_size.
const bool LOWER
Selector for lower cover.
virtual ~structured_block_2d_crg_interval()
Destructor.
virtual void get_implicit_private_data(block< pod_index_type > &xdata) const
The private data for this instance.
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...
static void get_dof_tuple_ids(poset_state_handle &xhost, size_type xi_size, size_type xj_size, block< pod_index_type > &result)
The dof tuple ids for an instance created with parameter xi_size.
void initialize_zones(base_space_poset &xhost)
Initialize the zones id space.
int_type pod_index_type
The plain old data index type.
A 2D implementation of abstract_product_structure.
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_...
void initialize_block_vertices()
Initialize the block vertices id space.
virtual size_type implicit_private_data_size() const
The size of the private data.
static void get_size(size_type xi_size, size_type xj_size, size_type &result)
The size for an instance created with parameter xi_size.
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
Namespace for the fiber_bundles component of the sheaf system.
void initialize_vertices(base_space_poset &xhost)
Initialize the vertex id space.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
structured_block_2d_crg_interval()
Default Constructor.