21 #include "SheafSystem/point_block_crg_interval.h" 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" 71 ensure(!is_initialized());
89 _id_spaces->delete_space(_lower_covers_begin);
93 _id_spaces->delete_space(_lower_covers_begin + 1);
100 _id_spaces->delete_space(_upper_covers_begin);
104 _id_spaces->delete_space(_upper_covers_begin + 1);
111 _id_spaces->delete_space(_connectivity_begin);
177 require(id_spaces_initialized());
178 require(local_id_space_initialized());
179 require(!vertices_initialized());
180 require(!zones_initialized());
186 const string& lvertex_id_space_name =
187 section_space_schema_member::intersection_id_space_name(xhost.
d_cells(0),
191 offset_index_space_state::new_space(*_id_spaces,
192 lvertex_id_space_name,
194 _vertex_size).index();
196 _vertices_initialized =
true;
200 _zones_space_id = _vertices_space_id;
202 _zones_initialized =
true;
206 ensure(vertices_initialized());
207 ensure(zones_initialized());
229 require(contains_member(xmbr_id));
256 result = _vertices_space_id;
290 require(id_spaces_initialized());
291 require(!block_vertices_initialized());
298 list_index_space_state::new_space(*_id_spaces,
299 block_vertices_name(),
302 _block_vertices_space_id = lblock_vertices_id_space.
index();
308 for(
size_type lbv=0; lbv<lbv_size; ++lbv)
310 lblock_vertices_id_space.
push_back(_local_id_space.hub_pod(xdata[v++]));
315 _block_vertices_initialized =
true;
319 ensure(block_vertices_initialized());
374 result = 1 + lvertex_ct;
401 result = 1 + lvertex_ct;
423 size_type lvertex_ct = xi_size*xj_size*xk_size;
428 result = 1 + lvertex_ct;
457 require(id_spaces_initialized());
458 require(local_id_space_initialized());
459 require(!covers_initialized(
LOWER));
468 _lower_covers_begin =
469 explicit_index_space_interval::new_space(*_id_spaces, 1).begin();
471 offset_index_space_state::new_space(*_id_spaces,
473 implicit_cover_name(
LOWER, interval_member()),
481 constant_index_space_interval::new_space(*_id_spaces, _vertex_size, BOTTOM_INDEX);
490 _connectivity_begin =
491 singleton_index_space_interval::new_space(*_id_spaces, _vertex_size, implicit_begin()).begin();
493 _adjacency_begin = _connectivity_begin;
497 _lower_covers_initialized =
true;
501 ensure(covers_initialized(
LOWER));
514 require(id_spaces_initialized());
515 require(local_id_space_initialized());
516 require(!covers_initialized(
UPPER));
524 _upper_covers_begin =
525 explicit_index_space_interval::new_space(*_id_spaces, 1).begin();
527 list_index_space_state::new_space(*_id_spaces,
529 explicit_cover_name(
UPPER, interval_member()),
536 constant_index_space_interval::new_space(*_id_spaces, _vertex_size, interval_member());
542 _upper_covers_initialized =
true;
546 ensure(covers_initialized(
UPPER));
573 result.
reserve(MEMBER_CLASS_END);
574 result.
set_ct(MEMBER_CLASS_END);
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();
601 result.
reserve(MEMBER_CLASS_END);
602 result.
set_ct(MEMBER_CLASS_END);
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();
630 result.
reserve(MEMBER_CLASS_END);
631 result.
set_ct(MEMBER_CLASS_END);
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();
663 require(xi_size > 0);
668 size_type lpd_size = lblock_vertices_size + BLOCK_VERTICES_BEGIN + EXPLICIT_PRIVATE_DATA_SIZE;
679 result[v++] = lvertex_i_size;
680 result[v++] = lblock_vertices_size;
689 result[v++] = xi_size;
711 require(xi_size > 0);
712 require(xj_size > 0);
717 size_type lpd_size = lblock_vertices_size + BLOCK_VERTICES_BEGIN + EXPLICIT_PRIVATE_DATA_SIZE;
729 result[v++] = lvertex_i_size*lvertex_j_size;
730 result[v++] = lblock_vertices_size;
764 require(xi_size > 0);
765 require(xj_size > 0);
766 require(xk_size > 0);
771 size_type lpd_size = lblock_vertices_size + BLOCK_VERTICES_BEGIN + EXPLICIT_PRIVATE_DATA_SIZE;
784 result[v++] = lvertex_i_size*lvertex_j_size*lvertex_k_size;
785 result[v++] = lblock_vertices_size;
823 require(block_vertices_initialized());
828 BLOCK_VERTICES_BEGIN + _id_spaces->ct(_block_vertices_space_id);
832 ensure(is_basic_query);
845 require(block_vertices_initialized());
849 size_type lbv_size = _id_spaces->ct(_block_vertices_space_id);
851 size_type lpd_size = lbv_size + BLOCK_VERTICES_BEGIN;
856 xdata[v++] = _vertex_size;
857 xdata[v++] = lbv_size;
862 xdata[v++] = _local_id_space.pod(litr.
hub_pod());
866 _id_spaces->release_id_space_iterator(litr);
870 ensure(xdata.
ct() == implicit_private_data_size());
883 require(!block_vertices_initialized());
890 _vertex_size = xdata[v++];
892 initialize_block_vertices(&xdata[v]);
897 ensure(block_vertices_initialized());
919 require(dynamic_cast<base_space_poset*>(&xhost) != 0);
933 initialize_vertices(lhost);
941 lhost.insert_interval_in_standard_subposets(*
this);
947 homogeneous_block_crg_interval::finalize(xhost);
952 ensure(is_initialized());
974 static const string result(
"point_block_crg_interval");
983 fiber_bundle::point_block_crg_interval::
993 interval_factory().insert_prototype(lproto);
1017 require(other != 0);
1042 ensure(result != 0);
1043 ensure(is_same_type(result));
1056 if(invariant_check())
1060 disable_invariant_check();
1064 invariance(homogeneous_block_crg_interval::invariant());
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);
1074 enable_invariant_check();
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.
virtual ~point_block_crg_interval()
Destructor.
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...
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.
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.
const bool UPPER
Selector for upper cover.
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.
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.
point_block_crg_interval()
Default Constructor.
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.
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.
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().