21 #include "SheafSystem/structured_block_1d_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/i_adjacency_index_space_interval.h" 34 #include "SheafSystem/i_connectivity_index_space_interval.h" 35 #include "SheafSystem/index_space_iterator.h" 36 #include "SheafSystem/section_space_schema_member.h" 37 #include "SheafSystem/std_iomanip.h" 38 #include "SheafSystem/std_string.h" 39 #include "SheafSystem/std_sstream.h" 40 #include "SheafSystem/structured_block_1d.h" 69 ensure(!is_initialized());
85 _id_spaces->delete_space(_lower_covers_begin);
89 _id_spaces->delete_space(_lower_covers_begin + 1);
93 _id_spaces->delete_space(_lower_covers_begin + 1 + _i_size);
100 _id_spaces->delete_space(_upper_covers_begin);
104 _id_spaces->delete_space(_upper_covers_begin + 1);
108 _id_spaces->delete_space(_upper_covers_begin + 1 + _i_size);
155 require(id_spaces_initialized());
156 require(local_id_space_initialized());
157 require(!zones_initialized());
163 const string& lzone_id_space_name =
164 section_space_schema_member::intersection_id_space_name(xhost.
d_cells(1),
168 offset_index_space_state::new_space(*_id_spaces,
173 _zones_initialized =
true;
177 ensure(zones_initialized());
201 require(id_spaces_initialized());
202 require(local_id_space_initialized());
203 require(!vertices_initialized());
209 const string& lvertex_id_space_name =
210 section_space_schema_member::intersection_id_space_name(xhost.
d_cells(0),
214 offset_index_space_state::new_space(*_id_spaces,
215 lvertex_id_space_name,
217 _i_vertex_size).index();
219 _vertices_initialized =
true;
223 ensure(vertices_initialized());
245 require(contains_member(xmbr_id));
249 static const int ldb[MEMBER_CLASS_END] =
254 int result = ldb[member_class(xmbr_id)];
277 result = _vertices_space_id;
281 result = _zones_space_id;
315 require(!block_vertices_initialized());
316 require(vertices_initialized());
323 list_index_space_state::new_space(*_id_spaces,
324 block_vertices_name(),
327 _block_vertices_space_id = lblock_vertices_id_space.
index();
331 lblock_vertices_id_space.
push_back(_vertex_begin);
332 lblock_vertices_id_space.
push_back(_vertex_begin + _i_size);
336 _block_vertices_initialized =
true;
340 ensure(block_vertices_initialized());
390 result = 1 + lzone_size + lvertex_size;
419 require(id_spaces_initialized());
420 require(local_id_space_initialized());
421 require(!covers_initialized(
LOWER));
430 _lower_covers_begin =
431 explicit_index_space_interval::new_space(*_id_spaces, 1).begin();
433 offset_index_space_state::new_space(*_id_spaces,
435 implicit_cover_name(
LOWER, interval_member()),
448 _connectivity_begin =
449 i_connectivity_index_space_interval::new_space(*_id_spaces, _i_size, _vertex_begin).begin();
455 constant_index_space_interval::new_space(*_id_spaces, _i_vertex_size, BOTTOM_INDEX);
459 _lower_covers_initialized =
true;
463 ensure(covers_initialized(
LOWER));
476 require(id_spaces_initialized());
477 require(local_id_space_initialized());
478 require(!covers_initialized(
UPPER));
486 _upper_covers_begin =
487 explicit_index_space_interval::new_space(*_id_spaces, 1).begin();
489 list_index_space_state::new_space(*_id_spaces,
491 explicit_cover_name(
UPPER, interval_member()),
498 constant_index_space_interval::new_space(*_id_spaces, _i_size, interval_member());
510 i_adjacency_index_space_interval::new_space(*_id_spaces, _i_vertex_size, _zone_begin, _i_size).begin();
514 _upper_covers_initialized =
true;
518 ensure(covers_initialized(
UPPER));
545 result.
reserve(MEMBER_CLASS_END);
546 result.
set_ct(MEMBER_CLASS_END);
549 result[BLOCK] = structured_block_1d::new_row_dof_map(xhost, xi_size,
true).hub_pod();
550 result[ZONE] = base_space_member::new_row_dof_map(xhost,
"segment_complex",
true).hub_pod();
551 result[VERTEX] = base_space_member::new_row_dof_map(xhost,
"point",
true).hub_pod();
615 ensure(xdata.
ct() == implicit_private_data_size());
631 _i_vertex_size = _i_size + 1;
632 _zone_begin = implicit_begin();
633 _vertex_begin = _zone_begin + _i_size;
659 require(dynamic_cast<base_space_poset*>(&xhost) != 0);
668 initialize_zones(lhost);
672 initialize_vertices(lhost);
676 initialize_block_vertices();
684 lhost.insert_interval_in_standard_subposets(*
this);
689 _vertex_begin + _i_vertex_size);
691 homogeneous_block_crg_interval::finalize(xhost);
696 ensure(is_initialized());
718 static const string result(
"structured_block_1d_crg_interval");
727 fiber_bundle::structured_block_1d_crg_interval::
737 interval_factory().insert_prototype(lproto);
787 ensure(is_same_type(result));
800 if(invariant_check())
804 disable_invariant_check();
808 invariance(homogeneous_block_crg_interval::invariant());
812 invariance(dof_tuple_ids_initialized() ?
is_valid(block_dof_tuple_id()) :
true);
813 invariance(dof_tuple_ids_initialized() ?
is_valid(zone_dof_tuple_id()) :
true);
814 invariance(dof_tuple_ids_initialized() ?
is_valid(vertex_dof_tuple_id()) :
true);
818 enable_invariant_check();
virtual void put_implicit_private_data(const block< pod_index_type > &xdata)
Initializes this using private data xdata.
virtual pod_type index() const
Index of this space.
size_type ct() const
The number of items currently in use.
virtual const std::string & class_name() const
The name of this class; provided to satisfy factory template.
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.
void initialize_zones(base_space_poset &xhost)
Initialize the zones id space.
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 get_implicit_private_data(block< pod_index_type > &xdata) const
The private data for this instance.
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.
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.
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.
virtual structured_block_1d_crg_interval * clone() const
Virtual constructor, makes a new instance of the same type as this.
static void get_size(size_type xi_size, size_type &result)
The size for an instance created with parameter xi_size.
size_type i_size() const
The number of zones in the i direction in this block.
Emulator for a interval of implicit base space members representing a 1 dimensional structured block...
void set_ct(size_type xct)
Sets ct() == xct.
void initialize_vertices(base_space_poset &xhost)
Initialize the vertex id space.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
static void get_private_data(size_type xi_size, block< pod_index_type > &result)
The private data for an instance with parameter xi_size.
virtual void initialize_lower_covers()
Initialize the lower covers for this interval.
virtual void finalize(poset_state_handle &xhost)
Finialize the initialization of this crg interval in the host xhost.
const bool UPPER
Selector for upper cover.
structured_block_1d_crg_interval()
Default Constructor.
virtual ~structured_block_1d_crg_interval()
Destructor.
void initialize_block_vertices()
Initialize the block vertices id space.
const bool LOWER
Selector for lower cover.
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 size_type implicit_private_data_size() const
The size of the private data.
int_type pod_index_type
The plain old data index type.
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_...
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.
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.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
virtual bool invariant() const
Class invariant.
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.