21 #include "SheafSystem/ijk_adjacency_index_space_interval.h" 23 #include "SheafSystem/abstract_product_structure.h" 24 #include "SheafSystem/assert_contract.h" 25 #include "SheafSystem/ijk_adjacency_implicit_index_space_iterator.h" 26 #include "SheafSystem/ijk_product_structure.h" 27 #include "SheafSystem/forwarding_index_space_handle.h" 28 #include "SheafSystem/explicit_index_space_state.h" 29 #include "SheafSystem/hub_index_space_handle.h" 30 #include "SheafSystem/index_space_family.h" 60 define_old_variable(
size_type old_id_spaces_end = xid_spaces.
end());
63 result_ptr->new_state(xid_spaces, xub);
65 result_ptr->_zone_hub_begin = xzone_hub_begin;
66 result_ptr->_i_size = xi_size;
67 result_ptr->_j_size = xj_size;
68 result_ptr->_k_size = xk_size;
70 result_ptr->_i_vertex_size = result_ptr->_i_size+1;
71 result_ptr->_j_vertex_size = result_ptr->_j_size+1;
72 result_ptr->_k_vertex_size = result_ptr->_k_size+1;
78 ensure(&result.
id_spaces() == &xid_spaces);
79 ensure(result.
begin() == old_id_spaces_end);
80 ensure(result.
end() == xid_spaces.
end());
81 ensure(result.
end() == result.
begin() + xub);
84 ensure(result.
i_size() == xi_size);
85 ensure(result.
j_size() == xj_size);
86 ensure(result.
k_size() == xk_size);
130 ensure(is_basic_query);
134 return _zone_hub_begin;
148 sheaf::tuple(xlocal_id, _j_vertex_size, _k_vertex_size, i, j, k);
152 pod_type result =
ordinal(i, j, k, _j_size, _k_size) + _zone_hub_begin;
156 result -= _j_size*_k_size;
171 ensure(result >= zone_hub_begin());
188 require(contains(xlocal_id));
195 sheaf::tuple(xlocal_id, _j_vertex_size, _k_vertex_size, i, j, k);
203 xzone_hub_begin =
ordinal(i, j, k, _j_size, _k_size) + _zone_hub_begin;
208 xzone_hub_begin -= _j_size*_k_size;
219 xzone_hub_begin -= _k_size;
240 ensure(xzone_hub_begin >= zone_hub_begin());
241 ensure((0 < xi_ct) && (xi_ct <= 2));
242 ensure((0 < xj_ct) && (xj_ct <= 2));
243 ensure((0 < xk_ct) && (xk_ct <= 2));
260 ensure(is_basic_query);
277 ensure(is_basic_query);
294 ensure(is_basic_query);
311 ensure(is_basic_query);
315 return _i_vertex_size;
328 ensure(is_basic_query);
332 return _j_vertex_size;
345 ensure(is_basic_query);
349 return _k_vertex_size;
395 static const string result(
"ijk_adjacency_index_space_interval");
425 fiber_bundle::ijk_adjacency_index_space_interval::
527 ensure((*
this) == xother);
548 ensure(is_basic_query);
636 ensure(is_basic_query);
657 ensure(is_basic_query);
678 ensure(is_basic_query);
695 bool result = (0 <= xid) && (xid <
end(xlocal_id));
699 ensure(is_basic_query);
729 bool result = ((0 <= i) && (i < li_ct) &&
730 (0 <= j) && (j < lj_ct) &&
731 (0 <= k) && (k < lk_ct));
735 ensure(is_basic_query);
752 bool result =
is_valid(xhub_id) && (
hub_pod(xlocal_id, xid) == xhub_id);
756 ensure(is_basic_query);
790 if((0 <= i) && (i < li_ct) &&
791 (0 <= j) && (j < lj_ct) &&
792 (0 <= k) && (k < lk_ct))
794 result =
ordinal(i, j, k, lj_ct, lk_ct);
836 if((0 <= i) && (i < li_ct) &&
837 (0 <= j) && (j < lj_ct) &&
838 (0 <= k) && (k < lk_ct))
870 ensure(is_basic_query);
954 ensure(is_basic_query);
980 ensure(is_basic_query);
1005 ensure(is_basic_query);
1061 _handles.release(reinterpret_cast<forwarding_index_space_handle&>(xid_space));
1065 ensure(is_basic_query);
1083 bool result = (lid_space != 0) &&
_handles.allocated(*lid_space);
1087 ensure(is_basic_query);
1143 _iterators.release(reinterpret_cast<ijk_adjacency_implicit_index_space_iterator&>(xitr));
1147 ensure(is_basic_query);
1165 bool result = (litr != 0) &&
_iterators.allocated(*litr);
1169 ensure(is_basic_query);
1193 require(other != 0);
1253 size_t result = xinclude_shallow ?
sizeof(xn) : 0;
1265 ensure(result >= 0);
size_type j_size() const
The number of zones in the j direction.
virtual ijk_adjacency_index_space_interval * clone() const
Virtual constructor; create a new instance of the same type at this.
virtual bool contains(pod_type xlocal_id, pod_type xid) const
True if the space with id xlocal_id contains id xid.
virtual explicit_index_space_state * explicit_state(pod_type xlocal_id) const
The explicit id space state for id xlocal_id. Returns null if there is no explicit id space for xloca...
pod_type end() const
The ending index of the id spaces.
size_type _j_size
The number of zones in the j direction.
An abstract class that defines the product structure for an id space.
virtual const std::string & class_name() const
The name of this class.
virtual const index_space_family & id_spaces() const
The id space family for this (const version).
An abstract iterator over the ids of an id space.
size_type _i_size
The number of zones in the i direction.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
size_type j_vertex_size() const
The number of vertices in the j direction.
pod_index_type ordinal(pod_index_type xi, pod_index_type xj, size_type xj_ub)
2-tuple to ordinal conversion.
virtual index_space_interval & operator=(const index_space_collection &xother)
Assignment operator.
virtual bool invariant() const
Class invariant.
friend SHEAF_DLL_SPEC size_t deep_size(const ijk_adjacency_index_space_interval &xn, bool xinclude_shallow)
The deep size of ijk_adjacency_index_space_interval& xn.
virtual pod_type begin(pod_type xlocal_id) const
Beginning id of this space with id xlocal_id.
void adjacent_zones(pod_type xlocal_id, pod_type &xzone_hub_begin, size_type &xi_ct, size_type &xj_ct, size_type &xk_ct) const
Compute the hub id of the fist adjacent zone and the number of adjacent zones in each direction for i...
virtual bool contains_unglued_hub(pod_type xlocal_id, pod_type xid) const
True if the space with id xlocal_id contains an id equivalent to xid in the unglued hub id space...
virtual void detach()=0
Detach this handle form its state, if any.
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
virtual bool operator==(const index_space_collection &xother) const
True if this is equivalent to xother.
pod_index_type pod_type
The "plain old data" index type for this.
static const ijk_adjacency_index_space_interval & new_space(index_space_family &xid_spaces, size_type xub, pod_type xzone_hub_begin, size_type xi_size, size_type xj_size, size_type xk_size)
Create a new interval of id spaces for 3D structured block adjacency in the id space family xid_space...
virtual size_type ct(pod_type xlocal_id) const
The number of members for the id space with id xlocal_id.
virtual bool is_attached() const =0
True if this handle is attached to a state.
virtual void detach()=0
Detach this handle form its state, if any.
virtual void release_id_space_iterator(index_space_iterator &xitr) const
Returns the id space iterator xitr to the iterator pool.
size_type _i_vertex_size
The number of vertices in the i direction.
virtual void new_product_structure(pod_type xlocal_id, const abstract_product_structure &xproduct)
Creates a new product structure for the id space with id xlocal_id by cloning the product structure...
virtual index_space_handle & get_id_space(pod_type xlocal_id) const
Allocates an id space handle from the handle pool attached to state with id xlocal_id.
An implementation of implicit_index_space_iterator for an implicit id space in an ijk_adjacency_index...
size_type k_size() const
The number of zones in the k direction.
Abstract base class with useful features for all objects.
virtual ijk_adjacency_index_space_interval & operator=(const index_space_collection &xother)
Assignment operator.
An implemenation of index_space_collection that adds an interface for the interval [begin()...
size_type _k_vertex_size
The number of vertices in the k direction.
An immutable abstract state for a space of alternate integer identifiers (aliases) for a subset of th...
size_type k_vertex_size() const
The number of vertices in the k direction.
size_type _k_size
The number of zones in the k direction.
list_pool< forwarding_index_space_handle > _handles
The handle pool.
pod_type zone_hub_begin() const
The hub id of the beginning of the zone id space.
virtual void remove(pod_type xlocal_id)
Remove the id space with id xlocal_id.
An implementation of class index_space_handle for an forwarding_index_space_state.
virtual const abstract_product_structure & product_structure(pod_type xlocal_id) const
The product structure for the id space with id xlocal_id (const version).
void attach_to(const index_space_family &xid_spaces, pod_type xindex)
Attach to the state with index xindex in the id space family xid_spaces.
virtual bool allocated_id_space_iterator(const index_space_iterator &xitr) const
True if and only if id space iterator xitr was allocated by the iterator pool.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
ijk_adjacency_index_space_interval()
Default constructor.
An implementation of index_space_interval for an interval of implicit id spaces for the adjacency of ...
virtual void release_id_space(index_space_handle &xid_space) const
Returns the id space handle xid_space to the handle pool.
virtual pod_type end(pod_type xlocal_id) const
Ending id of this space with id xlocal_id.
size_type i_vertex_size() const
The number of vertices in the i direction.
A collection of id space states. This is a virtual class with provides an interface for accessing the...
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
void attach_to(const index_space_family &xid_spaces, pod_type xindex)
Attach to the state with index xindex in the id space family xid_spaces.
static factory< index_space_interval > & id_space_interval_factory()
A factory for making descendants of this class.
virtual ~ijk_adjacency_index_space_interval()
Destructor.
SHEAF_DLL_SPEC size_t deep_size(const sec_vd &x0, bool xinclude_shallow=true)
The deep size of the referenced object of type sec_vd. if xinclude_shallow, add the sizeof x0 to the ...
virtual bool allocated_id_space(const index_space_handle &xid_space) const
True if and only if id space handle xid_space was allocated by the handle pool.
virtual bool invariant() const
Class invariant.
size_type i_size() const
The number of zones in the i direction.
virtual pod_type pod(pod_type xlocal_id, pod_type xid) const
The pod index in the space with id xlocal_id equivalent to xid in the hub id space.
virtual bool is_attached() const =0
True if this iterator is attached to a state.
bool invariant_check() const
True if invariant checking is enabled.
pod_type _zone_hub_begin
The hub id of the beginning of the zone id space.
size_type _j_vertex_size
The number of vertices in the j direction.
pod_type end() const
Ending space id of this interval in the id space family scope.
void tuple(pod_index_type x, size_type xj_ub, pod_index_type &xi, pod_index_type &xj)
Ordinal to 2-tuple conversion.
virtual void delete_product_structure(pod_type xlocal_id)
Deletes the product structure for the id space with id xlocal_id.
virtual pod_type unglued_hub_pod(pod_type xlocal_id, pod_type xid) const
The pod index in the unglued_hub id space equivalent to xid in the id space with id xlocal_id...
Factory and container for a family of id spaces.
pod_type hub_pod(pod_type xlocal_id, pod_type xid) const
The pod index in the glued hub id space equivalent to xid in the id space with id xlocal_id...
virtual bool operator==(const index_space_collection &xother) const
True if this is equivalent to xother.
virtual bool is_persistent(pod_type xlocal_id) const
True if the id space with id xlocal_id should be written to disk.
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.
pod_type begin() const
Beginning space id of this interval in the id space family scope.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
bool is_same_type(const any *other) const
True if other is the same type as this.
void enable_invariant_check() const
Enable invariant checking.
virtual bool has_product_structure(pod_type xlocal_id) const
True if the id space with id xlocal_id has a product structure.
const hub_index_space_handle & hub_id_space() const
The hub id space of this family.
virtual bool contains(pod_type xid) const
True if this space contains id xid.
list_pool< ijk_adjacency_implicit_index_space_iterator > _iterators
The iterator pool.
virtual index_space_iterator & get_id_space_iterator(pod_type xlocal_id) const
Allocates an id space iterator from the iterator pool attached to state with id xlocal_id.