22 #include "SheafSystem/property_disc_iterator_1_3.h" 24 #include "SheafSystem/assert_contract.h" 25 #include "SheafSystem/base_space_member.h" 26 #include "SheafSystem/binary_section_space_schema_member.h" 27 #include "SheafSystem/eval_family.h" 28 #include "SheafSystem/sec_rep_descriptor.h" 29 #include "SheafSystem/section_evaluator.h" 30 #include "SheafSystem/section_space_schema_member.h" 31 #include "SheafSystem/sec_ed_invertible.h" 32 #include "SheafSystem/sec_vd.h" 33 #include "SheafSystem/std_limits.h" 34 #include "SheafSystem/structured_block_1d.h" 35 #include "SheafSystem/structured_block_2d.h" 36 #include "SheafSystem/structured_block_3d.h" 37 #include "SheafSystem/subposet_member_iterator.h" 38 #include "SheafSystem/uniform_eval_family.h" 39 #include "SheafSystem/field_vd.h" 53 fields::property_disc_iterator_1_3::
54 property_disc_iterator_1_3(
const field_vd& xfield)
66 initialize_iteration(xfield, BIORDER);
71 ensure(is_initialized());
75 ensure(property_schema().is_same_state(&xfield.
property().
schema()));
76 ensure(property_schema().is_same_type(&xfield.
property().
schema()));
80 ensure(unexecutable(!is_done() implies
this is first member));
85 fields::property_disc_iterator_1_3::
86 property_disc_iterator_1_3(
101 initialize_iteration(xcoordinates_schema, xproperty_schema, BIORDER);
106 ensure(is_initialized());
107 ensure(coordinates_schema().is_same_state(&xcoordinates_schema));
108 ensure(coordinates_schema().is_same_type(&xcoordinates_schema));
109 ensure(coordinates_schema().version() == xcoordinates_schema.
version());
110 ensure(property_schema().is_same_state(&xproperty_schema));
111 ensure(property_schema().is_same_type(&xproperty_schema));
112 ensure(property_schema().version() == xproperty_schema.
version());
113 ensure(descending());
115 ensure(unexecutable(!is_done() implies
this is first member));
145 require(dynamic_cast<const binary_section_space_schema_member*>
155 require(property_discretization_members().ct() == 1);
159 _coord_state.gather_dofs(xsec);
161 int ldf = _coord_state.df;
175 const int MAX_DB = 3;
201 fields::property_disc_iterator_1_3::
202 coord_eval_previsit_action()
206 require(_at.coord_eval);
210 _above.coord_eval =
false;
212 _coord_state.set_evaluation_member(_index);
213 _coord_state.initialize_order_correction();
214 _coord_state.discretization_members.set_ct(0);
215 _coord_state.down_set.set_ct(0);
217 _prop_state.set_evaluation_member(_index);
228 fields::property_disc_iterator_1_3::
229 prop_disc_previsit_action()
233 require(_at.prop_disc);
237 _above.prop_disc =
false;
239 _prop_state.discretization_members.set_ct(0);
240 _prop_state.gather_discretization_member(_index);
251 fields::property_disc_iterator_1_3::
252 coord_disc_previsit_action()
256 require(_at.coord_disc);
260 _above.coord_disc =
false;
262 _coord_state.gather_discretization_member(_index, greater_index());
263 _coord_state.local_id++;
274 fields::property_disc_iterator_1_3::
275 coord_eval_postvisit_action()
279 require(_at.coord_eval);
287 put_has_visited(ldown_set[i],
false);
291 _above.coord_eval =
true;
318 bool ltruncate = xtruncate;
324 property_disc_iterator::next(ltruncate);
328 if(action() == PREVISIT_ACTION)
330 if(!_above.coord_eval)
332 _coord_state.down_set.push_back(_index);
339 _at.coord_eval = _coord_state.eval_sp.contains_member(_index);
340 _at.coord_disc = _coord_state.disc_sp.contains_member(_index);
341 _at.prop_disc = _prop_state.disc_sp.contains_member(_index);
345 coord_eval_previsit_action();
350 prop_disc_previsit_action();
355 coord_disc_previsit_action();
359 else if(action() == POSTVISIT_ACTION)
361 _at.coord_eval = _coord_state.eval_sp.contains_member(_index);
365 coord_eval_postvisit_action();
378 post_fatal_error_message(
"unrecognized action");
381 property_disc_iterator::next(ltruncate);
387 ensure(!is_done() ? action() == POSTVISIT_ACTION :
true);
450 if(invariant_check())
452 invariance(property_disc_iterator::invariant());
454 disable_invariant_check();
456 invariance(order() == BIORDER);
457 invariance(property_schema().evaluation().is_same_state(&coordinates_schema().evaluation()));
458 invariance(!property_schema().rep().eval_is_above_disc());
463 require(!is_done() ? property_discretization_members().ct() <= 1 :
true);
467 enable_invariant_check();
double chart_point_coord_type
The type of local coordinate in the base space; the scalar type for the local coordinate vector space...
A context for discretization members. Intended for implementing various iterators, especially concurrent iterations over multiple sections.
int version(bool xunalias=true) const
The (possibly aliased) version of this component. The version of the host used when evaluating proper...
size_type ct() const
The number of items currently in use.
Namespace for fields component of sheaf system.
bool conforms_to(const schema_poset_member &xother) const
True if the dofs defined by this agree in type and in order with the dofs defined by xother...
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
subposet & evaluation()
The evaluation subposet for section spaces on this schema (mutable version).
virtual bool is_ancestor_of(const any *xother) const
True if other conforms to this.
virtual void get_prop_disc_values(const sec_vd &xsec)
The gets the values of xsec at the property discretization points.
bool is_same_state(const poset_state_handle *xhost, pod_index_type xhub_id) const
True is this is attached to state with hub id xhub_id in host xhost.
virtual dof_type value_at_coord(const dof_type xdofs[], size_type xdofs_ub, const dof_type xlocal_coords[], size_type xlocal_coords_ub) const
Value at a specified local_coordinate. Single component version.
Abstract base class with useful features for all objects.
bool invariant() const
The class invariant.
bool eval_is_above_disc() const
True is the evaluation subposet is strictly above the discretization subposet.
int local_id
The local index of the disc member with respect to the eval member.
pointer_type base() const
The underlying storage array.
void set_ct(size_type xct)
Sets ct() == xct.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
A vd-valued property as a function of global coordinates.
sec_vd & property() const
The dependent variable of this field.
void next()
Makes this the next member of the subset.
sec_vd_value_type values[values_ub]
The values of another section (typically the global coordinates) at this disc point.
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...
A section of a fiber bundle with a d-dimensional vector space fiber.
total_poset_member & base_space()
The base space component of this (mutable version).
virtual section_space_schema_member & schema()
The restricted schema for this (mutable version).
A client handle for a poset member which has been prepared for use as a schema for a section space...
sec_ed_invertible & coordinates() const
The independent variable of this field.
bool state_is_read_accessible() const
True if this is attached and if the coordinates and property are accessible for read or access contro...
A property discretization iterator for a property section with the same evaluation subposet as the co...
int df() const
The dimension of the fiber space component.
virtual void local_coordinates(pod_index_type xindex, coord_type xresult[], size_type xresult_ub) const =0
The local coordinates of the dof with local index xindex.
sec_rep_descriptor & rep()
The representation for section spaces on this schema (mutable version).
virtual schema_poset_member & schema()
The schema for this member (mutable version).
virtual property_disc_iterator_1_3 * clone() const
Make a new instance of the same type as this.
~property_disc_iterator_1_3()
Destructor.