21 #include "SheafSystem/ijk_adjacency_implicit_index_space_iterator.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/ijk_adjacency_index_space_interval.h" 25 #include "SheafSystem/index_space_family.h" 45 ensure(!is_attached());
64 ensure((*
this) == xother);
77 require(conforms_to_state(xid_spaces, xindex));
81 attach_to(xid_spaces, xindex);
86 ensure(is_attached());
87 ensure(&id_spaces() == &xid_spaces);
88 ensure(index() == xindex);
97 const std::string& xname)
101 require(conforms_to_state(xid_spaces, xname));
105 attach_to(xid_spaces, xname);
110 ensure(is_attached());
111 ensure(&id_spaces() == &xid_spaces);
112 ensure(name() == xname);
132 _i_ct = xother.
_i_ct;
133 _j_ct = xother.
_j_ct;
134 _k_ct = xother.
_k_ct;
139 (void) implicit_index_space_iterator::operator=(xother);
149 ensure((*
this) == xother);
182 ensure(is_basic_query);
199 ensure(is_basic_query);
216 ensure(is_basic_query);
233 ensure(is_basic_query);
250 ensure(is_basic_query);
267 ensure(is_basic_query);
302 require(is_ancestor_of(&xother));
309 (void) this->
operator=(lother);
314 ensure((*
this) == xother);
327 require(is_ancestor_of(&xother));
332 if(result && is_attached())
337 result = result && (_hub_begin == lother.
_hub_begin);
338 result = result && (_j_size == lother.
_j_size);
339 result = result && (_k_size == lother.
_k_size);
340 result = result && (_i_ct == lother.
_i_ct);
341 result = result && (_j_ct == lother.
_j_ct);
342 result = result && (_k_ct == lother.
_k_ct);
343 result = result && (_i == lother.
_i);
344 result = result && (_j == lother.
_j);
345 result = result && (_k == lother.
_k);
372 ensure(is_same_type(result));
373 ensure(*result == *
this);
397 require(is_attached());
402 define_old_variable(
pod_type old_pod = pod());
403 define_old_variable(
pod_type old_hub_pod = hub_pod());
432 _hub_pod = ((_i * _j_size) + _j)*_k_size + _hub_begin;
440 _hub_pod = ((_i * _j_size) + _j)*_k_size + _hub_begin;
454 ensure(is_done() || pod() != old_pod);
455 ensure(is_done() || hub_pod() != old_hub_pod);
468 require(is_attached());
477 _hub_pod = _hub_begin;
510 require(conforms_to_state(xhost, xlocal_id));
517 _local_id = xlocal_id;
524 lhost->
adjacent_zones(xlocal_id, _hub_begin, _i_ct, _j_ct, _k_ct);
525 _j_size = lhost->
j_size();
526 _k_size = lhost->
k_size();
535 ensure(is_attached());
536 ensure(&host() == &xhost);
557 ensure(is_basic_query);
602 if(invariant_check())
610 disable_invariant_check();
616 enable_invariant_check();
size_type j_size() const
The number of zones in the j direction.
pod_type hub_begin() const
The hub id of the first zone in the adjacency list.
size_type _j_size
The number of zones in the j direction.
size_type k_size() const
The number of zones in the k direction.
virtual void next()
Makes item() the next id in the iteration.
An abstract iterator over the ids of an id space.
virtual void attach_to(const index_space_collection &xhost, pod_type xlocal_id)
Attach to the state with local scope id, xlocal_id in the host id space collection xhost...
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
virtual pod_type family_scope(pod_type xlocal_id) const =0
Id relative to the id space family equivalent to the local 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...
pod_type _k
The current index in the k direction.
virtual ~ijk_adjacency_implicit_index_space_iterator()
Destructor.
size_type j_ct() const
The number of adjacent zones in the j direction.
ijk_adjacency_implicit_index_space_iterator & operator=(const ijk_adjacency_implicit_index_space_iterator &xother)
Assignment operator.
virtual bool invariant() const
Class invariant.
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.
pod_type _i
The current index in the i direction.
size_type _i_ct
The number of adjacent zones in the i direction.
virtual ijk_adjacency_implicit_index_space_iterator * clone() const
Virtual constructor, makes a new instance of the same type as this. If the iterator is attached...
size_type j_size() const
The number of zones in the j direction.
size_type _k_ct
The number of adjacent zones in the k direction.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
size_type i_ct() const
The number of adjacent zones in the i direction.
size_type _j_ct
The number of adjacent zones in the j direction.
ijk_adjacency_implicit_index_space_iterator()
Default constructor.
An implementation of index_space_interval for an interval of implicit id spaces for the adjacency of ...
A collection of id space states. This is a virtual class with provides an interface for accessing the...
virtual bool contains(pod_type xlocal_id) const =0
True if this collection contains the id space with local id xlocal_id.
virtual bool operator==(const index_space_iterator &xother) const
True if this is equivalent to xother.
virtual void reset()
Restarts the iteration.
pod_type _hub_begin
The hub id of the first zone in the adjacency list.
virtual bool conforms_to_state(const index_space_collection &xhost, pod_type xlocal_id) const
True if this conforms to the handle type required by the state with local scope id xlocal_id in the h...
virtual bool invariant() const
Class invariant.
virtual bool is_attached() const
True if this iterator is attached to a state.
pod_type _j
The current index in the j direction.
Factory and container for a family of id spaces.
pod_index_type pod_type
The "plain old data" index type for this.
size_type _k_size
The number of zones in the j direction.
Namespace for the fiber_bundles component of the sheaf system.
virtual bool operator==(const index_space_iterator &xother) const
True if this is equivalent to xother.
size_type k_ct() const
The number of adjacent zones in the k direction.