20 #include "SheafSystem/section_dof_iterator.h" 22 #include "SheafSystem/poset_state_handle.h" 23 #include "SheafSystem/section_space_schema_member.h" 24 #include "SheafSystem/section_space_schema_poset.h" 25 #include "SheafSystem/assert_contract.h" 26 #include "SheafSystem/discretization_iterator.h" 27 #include "SheafSystem/postorder_iterator.h" 39 require(is_ancestor_of(&xother));
44 poset_dof_iterator::operator=(xother);
57 _discretization_itr = 0;
64 ensure(is_initialized() ? anchor().is_same_state(&xother.
anchor()) :
true);
65 ensure(is_initialized() ? anchor().version() == xother.
anchor().
version() :
true);
66 ensure(is_initialized() ? item().is_same_type(&xother.
item()) :
true);
81 require(is_ancestor_of(&xother));
109 delete _discretization_itr;
148 invariance( poset_dof_iterator::invariant() );
150 if(invariant_check())
152 disable_invariant_check();
156 enable_invariant_check();
178 result = poset_dof_iterator::is_initialized();
179 result = result && (_discretization_itr != 0);
180 result = result && _discretization_itr->is_initialized();
195 require(is_initialized());
215 require(is_initialized());
235 require(xanchor != 0);
236 require(item_is_ancestor_of(*xanchor));
248 _anchor = xanchor->
clone();
258 _anchor->put_version(xversion,
true);
285 string ldof_sp_name = schema_poset_member::dof_subposet_name(
"top", _is_table_dof);
287 _itr.put_filter(ldof_sp_name);
300 ensure(is_initialized());
302 ensure(anchor().is_same_state(xanchor));
303 ensure(anchor().is_same_type(xanchor));
318 require(is_initialized());
322 result = _discretization_itr->is_done();
337 require(is_initialized());
352 _discretization_itr->force_is_done();
353 poset_dof_iterator::force_is_done();
370 require(is_initialized());
382 _discretization_itr->next();
384 if(!_discretization_itr->is_done())
398 ensure(!is_done() == item().is_attached());
399 ensure(unexecutable(postorder - have visited all of the members of the strict down
set 413 require(is_initialized());
414 require(anchor().state_is_read_accessible());
416 define_old_variable(
int old_anchor_version = anchor().version());
420 _itr.reset(xreset_markers);
424 _discretization_itr->force_is_done();
428 _discretization_itr->reset(xreset_markers);
430 if(_discretization_itr->is_done())
431 _itr.force_is_done();
439 ensure(is_initialized());
440 ensure(item().is_attached() == !is_done());
441 ensure(anchor().version() == old_anchor_version);
456 require(is_initialized());
457 require(xreset ? anchor().state_is_read_accessible():
true);
461 result = _discretization_itr->ct(xreset)*_itr.ct(xreset);
482 require(is_initialized());
483 require(anchor().state_is_read_accessible());
484 require(anchor().host()->contains_member(xhub_id));
488 result = _discretization_itr->has_visited(anchor().host()->get_base_space_id_from_index(xhub_id)) &&
489 _itr.has_visited(anchor().host()->get_fiber_schema_id_from_index(xhub_id)) ;
506 require(is_initialized());
507 require(anchor().state_is_read_accessible());
508 require(item_is_ancestor_of(xmbr));
510 require(anchor().host()->is_same_state(xmbr.
host()));
516 result = _discretization_itr->has_visited(lmbr.
base_space_id()) &&
533 require(is_initialized());
534 require(anchor().state_is_read_accessible());
535 require(anchor().host()->contains_member(xhub_id));
539 _discretization_itr->put_has_visited(anchor().host()->get_base_space_id_from_index(xhub_id), xvalue);
540 _itr.put_has_visited(anchor().host()->get_fiber_schema_id_from_index(xhub_id), xvalue) ;
544 ensure(has_visited(xhub_id) == xvalue);
559 require(is_initialized());
579 require(is_initialized());
poset_state_handle * host() const
The poset which this is a handle to a component of.
virtual bool has_visited(pod_index_type xhub_id) const
True if this has already visited hub id xhub_id.
int unaliased_version(int xversion) const
The actual version associated with (possibly aliased) version xversion in this.
section_space_schema_poset * host() const
The poset which this is a handle to a component of.
int version(bool xunalias=true) const
The (possibly aliased) version of this component. The version of the host used when evaluating proper...
virtual bool invariant() const
The class invariant.
schema_poset_member & fiber_schema()
The fiber schema component of this (mutable version).
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
schema_poset_member & item()
The current member of the iteration (mutable version).
virtual bool is_initialized() const
True if this has been initialized for iteration with respect to a specific anchor.
Iterates in postorder over dofs of a schema member anchor. Attaches an a handle of type section_space...
virtual void reset(bool xreset_markers=RESET)
Restarts the iteration over the down set of anchor() If xreset_markers, set !has_visited for all memb...
void put_schema_anchor(const section_space_schema_member &xschema_anchor)
Set schema_anchor() to the same state as xschema_anchor.
virtual bool is_done() const
True if iteration finished.
section_dof_iterator()
Default constructor; creates an unattached iterator. Protected because this class is abstract...
abstract_poset_member & bottom()
The bottom member of the poset (mutable version)
Dperecated. Use postorder_itr. Specialization of the filtered depth-first iterator which exposes the ...
virtual section_dof_iterator & operator=(const poset_dof_iterator &xother)
Assignment operator.
virtual ~section_dof_iterator()
Destructor.
virtual void put_anchor(const schema_poset_member *xanchor, int xversion)
Set anchor() to xversion of *xanchor.
schema_poset_member * clone(bool xnew_state, bool xauto_access=true) const
Make a new handle instance of current. Attach the new instance to a new state if xnew_state is true...
virtual int ct(bool xreset=false)
The number of members of the iteration set, from the current member to the end, inclusive. If xreset, reset before computing the count.
Abstract base class with useful features for all objects.
pod_index_type fiber_schema_id() const
The member id of the fiber schema component of this.
virtual bool is_attached() const
True if this handle is attached to a non-void state.
virtual bool is_done() const
True if iteration finished.
Iterator over the discretization subposet associated with a section_space_schema_member anchor...
virtual bool is_initialized() const
True if this has been initialized for iteration with respect to a specific anchor.
virtual bool is_ancestor_of(const any *other) const
True if other conforms to this.
bool is_table_dof() const
True if iterating over table dofs.
schema_poset_member & anchor()
The schema member whose downset is being iterated over; the top member of the domain of iteration (mu...
virtual void put_has_visited(pod_index_type xhub_id, bool xvalue)
Set the visisted marker for hub id xhub_id to xvalue. Intended for use reseting iterator without havi...
virtual bool is_schematized(bool xauto_access) const
True if this poset has been prepared for use as a schema, that is, if the top member has been schemat...
Iterates in postorder over dofs of a schema member anchor. Attaches a handle of type schema_poset_mem...
postorder_iterator _itr
The index iterator used to implement the iteration.
depth_first_iterator * _discretization_itr
The discretization iterator.
int_type pod_index_type
The plain old data index type.
A client handle for a poset member which has been prepared for use as a schema for a section space...
section_space_schema_member & item()
The current member of the iteration (mutable version).
virtual bool item_is_ancestor_of(const schema_poset_member &xmbr) const
True if xmbr conforms to the type of item of this.
virtual void put_anchor(const abstract_poset_member *xanchor)
Set anchor() to xanchor.
virtual void force_is_done()
Force the iterator to be done.
virtual void next()
Makes this the next member of the subset.
void attach_to_state(const namespace_poset *xns, const poset_path &xpath, bool xauto_access=true)
Attach to the state specified by path xpath in the namespace xns.
virtual depth_first_iterator * clone() const
Make a new instance of the same type as this.
Namespace for the fiber_bundles component of the sheaf system.
section_space_schema_member & anchor()
The schema member whose downset is being iterated over; the top member of the domain of iteration (mu...
bool is_same_type(const any *other) const
True if other is the same type as this.
A client handle for a poset member which has been prepared for use as a schema.
bool has_version(int xversion) const
True if xversion is a valid version for this.
base_space_poset & base_space()
The base space for section spaces on this schema.
pod_index_type base_space_id() const
The member id of the base space component of this.