22 #include "SheafSystem/property_disc_iterator_4_2.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_4_2::
54 property_disc_iterator_4_2(
const field_vd& xfield)
72 initialize_iteration(xfield, BIORDER);
77 ensure(is_initialized());
81 ensure(property_schema().is_same_state(&xfield.
property().
schema()));
82 ensure(property_schema().is_same_type(&xfield.
property().
schema()));
86 ensure(unexecutable(!is_done() implies
this is first member));
92 fields::property_disc_iterator_4_2::
93 property_disc_iterator_4_2(
115 initialize_iteration(xcoordinates_schema, xproperty_schema, BIORDER);
120 ensure(is_initialized());
121 ensure(coordinates_schema().is_same_state(&xcoordinates_schema));
122 ensure(coordinates_schema().is_same_type(&xcoordinates_schema));
123 ensure(coordinates_schema().version() == xcoordinates_schema.
version());
124 ensure(property_schema().is_same_state(&xproperty_schema));
125 ensure(property_schema().is_same_type(&xproperty_schema));
126 ensure(property_schema().version() == xproperty_schema.
version());
127 ensure(descending());
129 ensure(unexecutable(!is_done() implies
this is first member));
160 require(dynamic_cast<const binary_section_space_schema_member*>
170 require(coordinate_discretization_members().ct() == 1);
174 if(_coord_state.dofs.ct() == 0)
178 _coord_state.gather_dofs(xsec);
181 int ldf = _coord_state.df;
206 _coord_state.eval_mbr->unrefine_point_pa(ldisc_pt, ldisc_pt);
243 bool ltruncate = xtruncate;
249 property_disc_iterator::next(ltruncate);
253 if(action() == PREVISIT_ACTION)
258 if(_coord_state.eval_sp.contains_member(_index))
260 _coord_state.set_and_attach_evaluation_member(_index);
261 _coord_state.discretization_members.set_ct(0);
262 _coord_state.gather_discretization_member(_index, greater_index());
263 _coord_state.local_id++;
264 _coord_state.dofs.set_ct(0);
267 if(_prop_state.eval_sp.contains_member(_index))
269 _above.prop_eval =
false;
270 put_visit_once(
false);
272 _prop_state.set_evaluation_member(_index);
273 _prop_state.initialize_order_correction();
274 _prop_state.discretization_members.set_ct(0);
277 if(_prop_state.disc_sp.contains_member(_index))
282 if(!(_above.prop_eval || _prop_state.visited[_index.pod()]))
284 _prop_state.gather_discretization_member(_index);
286 _prop_state.visited.put(_index.pod(),
true);
288 _prop_state.local_id++;
293 else if(action() == POSTVISIT_ACTION)
295 if(_prop_state.eval_sp.contains_member(_index))
297 put_visit_once(
true);
298 _above.prop_eval =
true;
312 post_fatal_error_message(
"unrecognized action");
315 property_disc_iterator::next(ltruncate);
321 ensure(!is_done() ? action() == POSTVISIT_ACTION :
true);
339 _prop_state.visited.make_false();
345 property_disc_iterator::reset(xreset_markers);
411 if(invariant_check())
413 invariance(property_disc_iterator::invariant());
415 disable_invariant_check();
417 invariance(order() == BIORDER);
419 invariance(coordinates_schema().evaluator_family_name() ==
"uniform");
424 invariance(property_schema().base_space().is_same_state(&coordinates_schema().base_space()));
426 invariance(property_schema().rep().eval_is_above_disc());
431 require(!is_done() ? coordinate_discretization_members().ct() <= 1 :
true);
435 enable_invariant_check();
scoped_index eval_id
The eval member the disc member is contained in.
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.
bool invariant() const
The class invariant.
A point in a 3D chart space.
A property discretization iterator for a field with uniform coordinates section and a property sectio...
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...
virtual property_disc_iterator_4_2 * clone() const
Make a new instance of the same type as this.
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.
void put_chart_id(pod_index_type xchart)
Sets chart_id() to xchart_id.
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 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.
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.
virtual bool is_ancestor_of(const any *xother) const
True if other conforms to this.
virtual void reset(bool xreset_markers=true)
Restarts the iteration.
void next()
Makes this the next member of the subset.
~property_disc_iterator_4_2()
Destructor.
std::string evaluator_family_name() const
The name of the evaluator family for section spaces on schemae hosted by this.
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...
coord_type * local_coords()
The array of local coordinates.
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...
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 void get_prop_disc_values(const sec_vd &xsec)
The gets the values of xsec at the property discretization points.