21 #include "SheafSystem/body_builder.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/base_space_member.h" 25 #include "SheafSystem/base_space_poset.h" 26 #include "SheafSystem/block.impl.h" 27 #include "SheafSystem/index_space_iterator.h" 28 #include "SheafSystem/section_eval_iterator.h" 29 #include "SheafSystem/section_evaluator.h" 30 #include "SheafSystem/subposet.h" 31 #include "SheafSystem/tern.h" 32 #include "SheafSystem/field_vd.h" 94 require(xfield.
dp() == 1);
95 require(xlower < xupper);
100 build_pa(xfield, xlower, xupper, *result);
122 require(xfield.
dp() == 1);
123 require(xlower < xupper);
137 select_evaluation_members(xfield, xlower, xupper, lselected);
151 if(lselected.contains_member(i))
156 find_contiguous_neighborhood(*lbase_space, lselected, i, lnbrhd);
160 lbody.new_jrm_state(lnbrhd.
base(), lnbrhd.
ct(), tern::NEITHER,
false);
168 lselected.delete_state();
169 lbody.detach_from_state();
183 fields::body_builder::
184 select_evaluation_members(
const field_vd& xfield,
192 require(xlower < xupper);
202 while(!litr.evaluators_done())
206 if(interval_contains_field(litr.evaluator(), ldofs, xlower, xupper))
214 litr.next_evaluator();
226 fields::body_builder::
236 require(xdofs.
ct() == xeval.
dof_ct());
237 require(xlower < xupper);
242 (xlower <= xeval.
min(xdofs.
base(), xdofs.
ct())) &&
243 (xeval.
max(xdofs.
base(), xdofs.
ct()) <= xupper);
254 fields::body_builder::
273 while(lnext < xresult.
ct())
332 ensure(xresult.
ct() > 0);
353 require(xother != 0);
359 bool result =
dynamic_cast<const body_builder*
>(xother) != 0;
381 ensure(is_same_type(result));
395 if(invariant_check())
399 disable_invariant_check();
403 invariance(any::invariant());
409 enable_invariant_check();
A client handle for a subposet.
size_type ct() const
The number of items currently in use.
An abstract iterator over the ids of an id space.
index_space_iterator & get_cover_id_space_iterator(bool xlower, pod_index_type xmbr_hub_id) const
Allocates an iterator for the lower (xlower true) or upper (xlower false) cover id space of the membe...
void build_pa(field_vd &xfield, value_type xlower, value_type xupper, block< scoped_index > &xresult)
Builds the bodies defined by threshholds xlower and xupper in field xfield; pre_allocated.
virtual bool is_ancestor_of(const any *xother) const
Conformance test; true if other conforms to this.
Namespace for fields component of sheaf system.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
virtual bool contains_member(pod_index_type xmbr_hub_id) const
True if this poset contains poset member with hub id xmbr_hub_id.
virtual void next()=0
Makes id() the next id in the iteration.
A client handle for a member of a base space poset.
sec_vd_value_type value_type
The type of component in the value; the scalar type in the fiber space.
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...
virtual ~body_builder()
Destructor.
void push_back(const_reference_type item)
Insert item at the end of the items in the auto_block.
bool is_done() const
True if iteration is finished.
virtual dof_type max(const dof_type xdofs[], size_type xdofs_ub) const
The maximum value of the scalar or component section defined by xdofs.
bool state_is_read_write_accessible() const
True if this is attached and if the state is accessible for read and write or access control is disab...
virtual size_type dof_ct() const =0
The number of dofs required for each component of the dependent variable.
poset * host() const
The poset which this is a handle to a member of.
pointer_type base() const
The underlying storage array.
void set_ct(size_type xct)
Sets ct() == xct.
An index within the external ("client") scope of a given id space.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
virtual void insert_member(pod_index_type xmbr_hub_id)
Inserts the member of host() with hub id xmbr_hub_id.
A vd-valued property as a function of global coordinates.
sec_vd & property() const
The dependent variable of this field.
const bool UPPER
Selector for upper cover.
base_space_member & base_space() const
The base space of this field.
An abstract local section evaluator; a map from {local coordinates x dofs} to section value...
const hub_index_space_handle & member_hub_id_space(bool xauto_access) const
The member hub id space.
body_builder()
Default constructor.
Iterates over the evaluation members of a section space schema anchor; gathers the dof ids for each e...
const bool LOWER
Selector for lower cover.
virtual dof_type min(const dof_type xdofs[], size_type xdofs_ub) const
The minimum value of the scalar or component section defined by xdofs.
virtual section_space_schema_member & schema()
The restricted schema for this (mutable version).
virtual void remove_member(pod_index_type xmbr_hub_id)
Removes the member of host() with hub id xmbr_hub_id.
virtual body_builder * clone() const
Virtual constructor, makes a new instance of the same type as this.
virtual scoped_index member_index_ub() const
The upper bound on the member_index;.
bool state_is_read_accessible() const
True if this is attached and if the coordinates and property are accessible for read or access contro...
int dp() const
The dimension of the property (dependent variable) space.
block< scoped_index > * build(field_vd &xfield, value_type xlower, value_type xupper)
Builds the bodies defined by threshholds xlower and xupper in field xfield; auto_allocated.
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 ...
void release_cover_id_space_iterator(index_space_iterator &xcover_itr) const
Returns xcover_itr to the pool of id space iterators.
virtual bool invariant() const
Class invariant.
A simple body builder; creates base space members equivalent to subsets defined by a field classifica...
pod_type hub_pod() const
The current unglued hub id in the iteration. synonym for unglued_hub_pod().
virtual const scoped_index & member_id(bool xauto_access) const
An id in the member hub id space; intended for copying to initialize ids to the member id space...