SheafSystem  0.0.0.0
fiber_bundle::section_eval_iterator Class Reference

Iterates over the evaluation members of a section space schema anchor; gathers the dof ids for each evaluation member. More...

#include <section_eval_iterator.h>

Inheritance diagram for fiber_bundle::section_eval_iterator:
sheaf::any

Public Member Functions

 section_eval_iterator (const section_space_schema_member &xanchor)
 Creates a new instance anchored at xanchor. More...
 
virtual section_eval_iteratoroperator= (const section_eval_iterator &xother)
 Assignment operator. More...
 
 section_eval_iterator (const section_eval_iterator &xother)
 Copy constructor; attaches this to the same anchor as xother. More...
 
 section_eval_iterator ()
 Default constructor; creates an unattached iterator. More...
 
virtual ~section_eval_iterator ()
 Destructor. More...
 
virtual bool is_ancestor_of (const any *xother) const
 True if other conforms to this. More...
 
virtual section_eval_iteratorclone () const
 Make a new instance of the same type as this. More...
 
bool invariant () const
 The class invariant. More...
 
bool is_initialized () const
 True if this has been initialized for iteration with respect to a specific anchor. More...
 
section_space_schema_memberanchor ()
 The schema member whose downset is being iterated over; the top member of the domain of iteration (mutable version). More...
 
const section_space_schema_memberanchor () const
 The schema member whose downset is being iterated over; the top member of the domain of iteration (const version). More...
 
virtual bool anchor_is_ancestor_of (const section_space_schema_member &xmbr) const
 True if xmbr conforms to the type of item of this. More...
 
virtual void reset (bool xreset_markers=RESET)
 Restarts the iteration over the down set of anchor() If xreset_markers, set !has_visited for all members. More...
 
virtual void reset (pod_index_type xhub_id, bool xreset_markers=RESET)
 Sets anchor to member with hub id xhub_id and restarts the iteration If xreset_markers, set !has_visited for all members. More...
 
void reset (const scoped_index &xid, bool xreset_markers=RESET)
 Sets anchor to member with id xid and restarts the iteration If xreset_markers, set !has_visited for all members. More...
 
virtual void reset (const section_space_schema_member &xanchor)
 Restarts iteration in schema xanchor. More...
 
virtual void reset_components ()
 Restarts iteration at first component of current evaluator. More...
 
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. More...
 
virtual bool has_visited (pod_index_type xhub_id) const
 True if this has already visited hub id xhub_id. More...
 
bool has_visited (const scoped_index &xid) const
 True if this has already visited id xid. More...
 
virtual bool has_visited (const section_space_schema_member &xmbr) const
 True if this has already visited xmbr. More...
 
virtual void put_has_visited (pod_index_type xhub_id, bool xvalue)
 Set the visited marker for hub id xhub_id to xvalue. Intended for use reseting iterator without having to reset entire collection of markers. More...
 
void put_has_visited (const scoped_index &xid, bool xvalue)
 Set the visited marker for id xid to xvalue. Intended for use reseting iterator without having to reset entire collection of markers. More...
 
const scoped_indexevaluator_id () const
 The id of the current evaluation member. More...
 
section_evaluatorevaluator ()
 The evaluator (local section) associated with the current evaluation member (mutable version). More...
 
const section_evaluatorevaluator () const
 The evaluator (local section) associated with the current evaluation member (const version). More...
 
bool evaluators_done () const
 True if iteration over the evaluation set is finished. More...
 
virtual void next_evaluator ()
 Makes the next member of the evaluation set the current evaluation member. More...
 
bool components_done () const
 True if iteration over fiber components is finished. More...
 
virtual void next_component ()
 Makes the next fiber component the current fiber component. More...
 
block< scoped_index > & discretization_members ()
 The ids of the discretization members in the down set of the current evaluation member (mutable version). More...
 
const block< scoped_index > & discretization_members () const
 The ids of the discretization members in the down set of the current evaluation member (const version). More...
 
const scoped_indexfiber_id () const
 The id of the fiber schema member associated with the current component. More...
 
void gather_dofs (const sec_vd &xsec, block< sec_vd::dof_type > &xdofs)
 Gathers the dofs for the current evalaution member from section xsec and appends them to the back of xdofs. More...
 
void scatter_dofs (sec_vd &xsec, const block< sec_vd::dof_type > &xdofs, size_type xindex)
 Scatters the dofs for the current evalaution member from the location xindex and following of xdofs into section xsec. More...
 
- Public Member Functions inherited from sheaf::any
bool is_same_type (const any *other) const
 True if other is the same type as this. More...
 
virtual ~any ()
 Destructor. More...
 
bool invariant_check () const
 True if invariant checking is enabled. More...
 
void enable_invariant_check () const
 Enable invariant checking. More...
 
void disable_invariant_check () const
 Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing invariant checking during multi-phase initialization. More...
 
int disable_invariance_check_request_depth () const
 Number of times disable_invariant_check has been called without matching call to enable_invariant_check. More...
 

Protected Member Functions

void reset_anchor (const section_space_schema_member &xanchor)
 Creates anchor if needed and attaches it to xanchor. More...
 
- Protected Member Functions inherited from sheaf::any
 any ()
 default constructor More...
 

Protected Attributes

section_space_schema_member_anchor
 The schema member whose downset is being iterated over; the top member of the domain of iteration. More...
 
postorder_iterator _fiber_schema_itr
 The iterator for the fiber schema component. More...
 
eval_iterator _evaluation_itr
 The iterator for the base space component. More...
 

Detailed Description

Iterates over the evaluation members of a section space schema anchor; gathers the dof ids for each evaluation member.

Definition at line 58 of file section_eval_iterator.h.

Constructor & Destructor Documentation

◆ section_eval_iterator() [1/3]

fiber_bundle::section_eval_iterator::section_eval_iterator ( const section_space_schema_member xanchor)

Creates a new instance anchored at xanchor.

Precondition
  • xanchor.state_is_read_accessible()
  • xanchor.host()->is_schematized(false)
Todo:
The initial setting of the anchor is a bit strange. It works around preconditions in reset_anchor that require that any new anchor be related to the old anchor. Examine this in more detail and see whether there's a less awkward way to set the anchor.
Postcondition

Definition at line 878 of file section_eval_iterator.cc.

References _anchor, anchor(), fiber_bundle::section_space_schema_member::clone(), fiber_bundle::section_space_schema_member::host(), invariant(), is_initialized(), sheaf::any::is_same_type(), fiber_bundle::section_space_schema_poset::is_schematized(), reset(), reset_components(), and sheaf::read_write_monitor_handle::state_is_read_accessible().

◆ section_eval_iterator() [2/3]

fiber_bundle::section_eval_iterator::section_eval_iterator ( const section_eval_iterator xother)

Copy constructor; attaches this to the same anchor as xother.

Postcondition

Definition at line 824 of file section_eval_iterator.cc.

References _fiber_schema_itr, anchor(), invariant(), is_initialized(), and reset_anchor().

◆ section_eval_iterator() [3/3]

fiber_bundle::section_eval_iterator::section_eval_iterator ( )

Default constructor; creates an unattached iterator.

Postcondition
  • !is_initialized()

Definition at line 719 of file section_eval_iterator.cc.

References gather_dofs(), invariant(), and is_initialized().

Referenced by fiber_id(), reset_anchor(), and scatter_dofs().

◆ ~section_eval_iterator()

fiber_bundle::section_eval_iterator::~section_eval_iterator ( )
virtual

Destructor.

Definition at line 79 of file section_eval_iterator.cc.

References is_ancestor_of().

Referenced by operator=().

Member Function Documentation

◆ anchor() [1/2]

fiber_bundle::section_space_schema_member & fiber_bundle::section_eval_iterator::anchor ( )

The schema member whose downset is being iterated over; the top member of the domain of iteration (mutable version).

Precondition

Definition at line 173 of file section_eval_iterator.cc.

Referenced by is_initialized(), operator=(), reset_anchor(), and section_eval_iterator().

◆ anchor() [2/2]

const fiber_bundle::section_space_schema_member & fiber_bundle::section_eval_iterator::anchor ( ) const

The schema member whose downset is being iterated over; the top member of the domain of iteration (const version).

Precondition

Definition at line 192 of file section_eval_iterator.cc.

References anchor_is_ancestor_of().

◆ anchor_is_ancestor_of()

bool fiber_bundle::section_eval_iterator::anchor_is_ancestor_of ( const section_space_schema_member xmbr) const
virtual

True if xmbr conforms to the type of item of this.

Precondition

Definition at line 211 of file section_eval_iterator.cc.

References reset().

Referenced by anchor(), and reset_anchor().

◆ clone()

fiber_bundle::section_eval_iterator * fiber_bundle::section_eval_iterator::clone ( ) const
virtual

Make a new instance of the same type as this.

Not Implemented.

Postcondition
  • result != 0
  • is_same_type(result)

Reimplemented from sheaf::any.

Definition at line 931 of file section_eval_iterator.cc.

References sheaf::any::is_same_type().

Referenced by reset_components().

◆ components_done()

bool fiber_bundle::section_eval_iterator::components_done ( ) const

True if iteration over fiber components is finished.

Precondition

Definition at line 606 of file section_eval_iterator.cc.

References next_component().

Referenced by next_evaluator(), and operator=().

◆ ct()

int fiber_bundle::section_eval_iterator::ct ( bool  xreset = false)
virtual

The number of members of the iteration set, from the current member to the end, inclusive. If xreset, reset before computing the count.

Precondition
  • xreset ? anchor().state_is_read_accessible(): true
Postcondition
  • result >= 0

Definition at line 362 of file section_eval_iterator.cc.

References has_visited().

Referenced by reset().

◆ discretization_members() [1/2]

sheaf::block< sheaf::scoped_index > & fiber_bundle::section_eval_iterator::discretization_members ( )

The ids of the discretization members in the down set of the current evaluation member (mutable version).

Precondition
  • !evaluators_done()

Definition at line 655 of file section_eval_iterator.cc.

Referenced by gather_dofs(), next_component(), and scatter_dofs().

◆ discretization_members() [2/2]

const sheaf::block< sheaf::scoped_index > & fiber_bundle::section_eval_iterator::discretization_members ( ) const

The ids of the discretization members in the down set of the current evaluation member (const version).

Precondition
  • !evaluators_done()

Definition at line 675 of file section_eval_iterator.cc.

References fiber_id().

◆ evaluator() [1/2]

fiber_bundle::section_evaluator & fiber_bundle::section_eval_iterator::evaluator ( )

The evaluator (local section) associated with the current evaluation member (mutable version).

Precondition
  • !evaluators_done()

Definition at line 518 of file section_eval_iterator.cc.

Referenced by evaluator_id().

◆ evaluator() [2/2]

const fiber_bundle::section_evaluator & fiber_bundle::section_eval_iterator::evaluator ( ) const

The evaluator (local section) associated with the current evaluation member (const version).

Precondition
  • !evaluators_done()

Definition at line 540 of file section_eval_iterator.cc.

References evaluators_done().

◆ evaluator_id()

const sheaf::scoped_index & fiber_bundle::section_eval_iterator::evaluator_id ( ) const

The id of the current evaluation member.

Precondition
  • !evaluators_done()

Definition at line 497 of file section_eval_iterator.cc.

References evaluator().

Referenced by put_has_visited().

◆ evaluators_done()

bool fiber_bundle::section_eval_iterator::evaluators_done ( ) const

True if iteration over the evaluation set is finished.

Precondition

Definition at line 561 of file section_eval_iterator.cc.

References next_evaluator().

Referenced by evaluator(), gather_dofs(), operator=(), and scatter_dofs().

◆ fiber_id()

const sheaf::scoped_index & fiber_bundle::section_eval_iterator::fiber_id ( ) const

The id of the fiber schema member associated with the current component.

Precondition
  • !components_done()

Definition at line 695 of file section_eval_iterator.cc.

References section_eval_iterator().

Referenced by discretization_members().

◆ gather_dofs()

void fiber_bundle::section_eval_iterator::gather_dofs ( const sec_vd xsec,
block< sec_vd::dof_type > &  xdofs 
)

◆ has_visited() [1/3]

bool fiber_bundle::section_eval_iterator::has_visited ( pod_index_type  xhub_id) const
virtual

True if this has already visited hub id xhub_id.

Precondition
  • anchor().host()->contains_member(xhub_id)

Definition at line 387 of file section_eval_iterator.cc.

Referenced by ct(), and has_visited().

◆ has_visited() [2/3]

bool fiber_bundle::section_eval_iterator::has_visited ( const scoped_index xid) const

True if this has already visited id xid.

Precondition

Definition at line 410 of file section_eval_iterator.cc.

References has_visited(), and sheaf::scoped_index::hub_pod().

◆ has_visited() [3/3]

bool fiber_bundle::section_eval_iterator::has_visited ( const section_space_schema_member xmbr) const
virtual

True if this has already visited xmbr.

Precondition
  • xmbr.is_attached()
  • anchor().host()->is_same_state(xmbr.host())

Definition at line 425 of file section_eval_iterator.cc.

References fiber_bundle::section_space_schema_member::base_space_id(), fiber_bundle::section_space_schema_member::fiber_schema_id(), fiber_bundle::section_space_schema_member::host(), sheaf::poset_component::is_attached(), and put_has_visited().

◆ invariant()

bool fiber_bundle::section_eval_iterator::invariant ( ) const
virtual

The class invariant.

Invariant

Reimplemented from sheaf::any.

Definition at line 120 of file section_eval_iterator.cc.

References is_initialized().

Referenced by is_ancestor_of(), reset_components(), and section_eval_iterator().

◆ is_ancestor_of()

bool fiber_bundle::section_eval_iterator::is_ancestor_of ( const any xother) const
virtual

True if other conforms to this.

Reimplemented from sheaf::any.

Definition at line 102 of file section_eval_iterator.cc.

References invariant().

Referenced by ~section_eval_iterator().

◆ is_initialized()

bool fiber_bundle::section_eval_iterator::is_initialized ( ) const

True if this has been initialized for iteration with respect to a specific anchor.

Definition at line 156 of file section_eval_iterator.cc.

References anchor().

Referenced by invariant(), operator=(), reset_anchor(), reset_components(), and section_eval_iterator().

◆ next_component()

void fiber_bundle::section_eval_iterator::next_component ( )
virtual

Makes the next fiber component the current fiber component.

Precondition
  • !components_done()
Postcondition

Definition at line 627 of file section_eval_iterator.cc.

References discretization_members().

Referenced by components_done().

◆ next_evaluator()

void fiber_bundle::section_eval_iterator::next_evaluator ( )
virtual

Makes the next member of the evaluation set the current evaluation member.

Precondition
  • !evaluators_done()
Postcondition

Definition at line 582 of file section_eval_iterator.cc.

References components_done().

Referenced by evaluators_done().

◆ operator=()

fiber_bundle::section_eval_iterator & fiber_bundle::section_eval_iterator::operator= ( const section_eval_iterator xother)
virtual

Assignment operator.

Precondition
  • is_ancestor_of(&xother)
  • xother.components_done()
  • xother.evaluators_done()
Postcondition

Definition at line 35 of file section_eval_iterator.cc.

References _anchor, anchor(), fiber_bundle::section_space_schema_member::attach_to_state(), fiber_bundle::section_space_schema_member::clone(), components_done(), evaluators_done(), is_initialized(), and ~section_eval_iterator().

◆ put_has_visited() [1/2]

void fiber_bundle::section_eval_iterator::put_has_visited ( pod_index_type  xhub_id,
bool  xvalue 
)
virtual

Set the visited marker for hub id xhub_id to xvalue. Intended for use reseting iterator without having to reset entire collection of markers.

Precondition
  • anchor().host()->contains_member(xhub_id)
Postcondition
  • has_visited(xhub_id) == xvalue

Definition at line 448 of file section_eval_iterator.cc.

Referenced by has_visited().

◆ put_has_visited() [2/2]

void fiber_bundle::section_eval_iterator::put_has_visited ( const scoped_index xid,
bool  xvalue 
)

Set the visited marker for id xid to xvalue. Intended for use reseting iterator without having to reset entire collection of markers.

Precondition
Postcondition
  • has_visited(xid) == xvalue

Definition at line 473 of file section_eval_iterator.cc.

References evaluator_id(), and sheaf::scoped_index::hub_pod().

◆ reset() [1/4]

void fiber_bundle::section_eval_iterator::reset ( bool  xreset_markers = RESET)
virtual

Restarts the iteration over the down set of anchor() If xreset_markers, set !has_visited for all members.

Precondition
Postcondition

Definition at line 234 of file section_eval_iterator.cc.

Referenced by anchor_is_ancestor_of(), reset(), and section_eval_iterator().

◆ reset() [2/4]

void fiber_bundle::section_eval_iterator::reset ( pod_index_type  xhub_id,
bool  xreset_markers = RESET 
)
virtual

Sets anchor to member with hub id xhub_id and restarts the iteration If xreset_markers, set !has_visited for all members.

Precondition
  • anchor().host()->contains_member(xanchor_index)
Postcondition

Definition at line 258 of file section_eval_iterator.cc.

References reset().

◆ reset() [3/4]

void fiber_bundle::section_eval_iterator::reset ( const scoped_index xid,
bool  xreset_markers = RESET 
)

Sets anchor to member with id xid and restarts the iteration If xreset_markers, set !has_visited for all members.

Precondition
  • anchor().host()->contains_member(xanchor_index)
Postcondition

Definition at line 296 of file section_eval_iterator.cc.

References sheaf::scoped_index::hub_pod(), and reset().

◆ reset() [4/4]

void fiber_bundle::section_eval_iterator::reset ( const section_space_schema_member xanchor)
virtual

Restarts iteration in schema xanchor.

Precondition
  • xanchor.state_is_read_accessible()
  • xanchor.host()->is_schematized(false)
Postcondition

Definition at line 321 of file section_eval_iterator.cc.

References ct(), fiber_bundle::section_space_schema_member::fiber_schema(), fiber_bundle::section_space_schema_member::host(), fiber_bundle::section_space_schema_poset::is_schematized(), and sheaf::read_write_monitor_handle::state_is_read_accessible().

◆ reset_anchor()

void fiber_bundle::section_eval_iterator::reset_anchor ( const section_space_schema_member xanchor)
protected

Creates anchor if needed and attaches it to xanchor.

Precondition
  • xanchor.state_is_read_accessible()
Postcondition

Definition at line 846 of file section_eval_iterator.cc.

References _anchor, anchor(), anchor_is_ancestor_of(), fiber_bundle::section_space_schema_member::attach_to_state(), fiber_bundle::section_space_schema_member::clone(), is_initialized(), sheaf::any::is_same_type(), section_eval_iterator(), and sheaf::read_write_monitor_handle::state_is_read_accessible().

Referenced by section_eval_iterator().

◆ reset_components()

void fiber_bundle::section_eval_iterator::reset_components ( )
virtual

Restarts iteration at first component of current evaluator.

Precondition
Postcondition

Definition at line 912 of file section_eval_iterator.cc.

References _fiber_schema_itr, clone(), invariant(), is_initialized(), and sheaf::depth_first_iterator::reset().

Referenced by section_eval_iterator().

◆ scatter_dofs()

void fiber_bundle::section_eval_iterator::scatter_dofs ( sec_vd xsec,
const block< sec_vd::dof_type > &  xdofs,
size_type  xindex 
)

Scatters the dofs for the current evalaution member from the location xindex and following of xdofs into section xsec.

Precondition
  • !evaluators_done()
  • xsec.state_is_read_write_accessible()
  • xdofs.ub() >= xhub_id + xsec.schema().df()*discretization_members().ct()

Definition at line 782 of file section_eval_iterator.cc.

References sheaf::auto_block< T, S >::ct(), fiber_bundle::section_space_schema_member::df(), discretization_members(), evaluators_done(), fiber_bundle::sec_vd::put_fiber(), fiber_bundle::sec_rep_space_member::schema(), section_eval_iterator(), sheaf::read_write_monitor_handle::state_is_read_write_accessible(), and sheaf::auto_block< T, un_block_initialization_policy< T > >::ub().

Referenced by gather_dofs().

Member Data Documentation

◆ _anchor

section_space_schema_member* fiber_bundle::section_eval_iterator::_anchor
protected

The schema member whose downset is being iterated over; the top member of the domain of iteration.

Definition at line 279 of file section_eval_iterator.h.

Referenced by operator=(), reset_anchor(), and section_eval_iterator().

◆ _evaluation_itr

eval_iterator fiber_bundle::section_eval_iterator::_evaluation_itr
protected

The iterator for the base space component.

Definition at line 289 of file section_eval_iterator.h.

◆ _fiber_schema_itr

postorder_iterator fiber_bundle::section_eval_iterator::_fiber_schema_itr
protected

The iterator for the fiber schema component.

Definition at line 284 of file section_eval_iterator.h.

Referenced by reset_components(), and section_eval_iterator().


The documentation for this class was generated from the following files: