22 #include "SheafSystem/property_disc_iterator_1_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_1_2::
54 property_disc_iterator_1_2(
const field_vd& xfield)
67 initialize_iteration(xfield, BIORDER);
72 ensure(is_initialized());
76 ensure(property_schema().is_same_state(&xfield.
property().
schema()));
77 ensure(property_schema().is_same_type(&xfield.
property().
schema()));
81 ensure(unexecutable(!is_done() implies
this is first member));
87 fields::property_disc_iterator_1_2::
88 property_disc_iterator_1_2(
104 initialize_iteration(xcoordinates_schema, xproperty_schema, BIORDER);
109 ensure(is_initialized());
110 ensure(coordinates_schema().is_same_state(&xcoordinates_schema));
111 ensure(coordinates_schema().is_same_type(&xcoordinates_schema));
112 ensure(coordinates_schema().version() == xcoordinates_schema.
version());
113 ensure(property_schema().is_same_state(&xproperty_schema));
114 ensure(property_schema().is_same_type(&xproperty_schema));
115 ensure(property_schema().version() == xproperty_schema.
version());
116 ensure(descending());
118 ensure(unexecutable(!is_done() implies
this is first member));
149 require(dynamic_cast<const binary_section_space_schema_member*>
158 _coord_state.gather_dofs(xsec);
160 int ldf = _coord_state.df;
172 if(_coord_state.disc_sp.contains_member(ldisc_mbr.
disc_id))
176 size_type ldof_id_begin = lcoord_local_id*ldf;
179 ldisc_mbr.
values[c] = lcoord_dofs[ldof_id_begin+c];
188 const int MAX_DB = 3;
216 fields::property_disc_iterator_1_2::
217 coord_eval_previsit_action()
221 require(_at.coord_eval);
225 _above.coord_eval =
false;
227 _coord_state.set_evaluation_member(_index);
228 _coord_state.initialize_order_correction();
229 _coord_state.discretization_members.set_ct(0);
230 _coord_state.down_set.set_ct(0);
232 _prop_state.set_evaluation_member(_index);
233 _prop_state.initialize_order_correction();
234 _prop_state.discretization_members.set_ct(0);
245 fields::property_disc_iterator_1_2::
246 prop_disc_previsit_action()
250 require(_at.prop_disc);
254 _above.prop_disc =
false;
258 if(!_prop_state.visited[_index.pod()])
262 _prop_state.gather_discretization_member(_index, greater_index());
264 _prop_state.visited.put(_index.pod(),
true);
269 _prop_state.local_id++;
280 fields::property_disc_iterator_1_2::
281 coord_disc_previsit_action()
285 require(_at.coord_disc);
289 _above.coord_disc =
false;
291 _coord_state.gather_discretization_member(_index, greater_index());
292 _coord_state.local_id++;
304 fields::property_disc_iterator_1_2::
305 coord_eval_postvisit_action()
309 require(_at.coord_eval);
317 put_has_visited(ldown_set[i],
false);
321 _above.coord_eval =
true;
348 bool ltruncate = xtruncate;
353 _prop_state.discretization_members.set_ct(0);
359 property_disc_iterator::next(ltruncate);
363 if(action() == PREVISIT_ACTION)
365 if(!_above.coord_eval)
367 _coord_state.down_set.push_back(_index);
374 _at.coord_eval = _coord_state.eval_sp.contains_member(_index);
375 _at.coord_disc = _coord_state.disc_sp.contains_member(_index);
376 _at.prop_disc = _prop_state.disc_sp.contains_member(_index);
380 coord_eval_previsit_action();
385 prop_disc_previsit_action();
390 coord_disc_previsit_action();
394 else if(action() == POSTVISIT_ACTION)
396 _at.coord_eval = _coord_state.eval_sp.contains_member(_index);
400 coord_eval_postvisit_action();
413 post_fatal_error_message(
"unrecognized action");
416 property_disc_iterator::next(ltruncate);
422 ensure(!is_done() ? action() == POSTVISIT_ACTION :
true);
440 _prop_state.visited.make_false();
446 property_disc_iterator::reset(xreset_markers);
512 if(invariant_check())
514 invariance(property_disc_iterator::invariant());
516 disable_invariant_check();
518 invariance(order() == BIORDER);
519 invariance(property_schema().evaluation().is_same_state(&coordinates_schema().evaluation()));
520 invariance(property_schema().rep().eval_is_above_disc());
524 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.
scoped_index disc_id
The global index of the disc member.
A property discretization iterator for a proerty section with the same evaluation subposet as the coo...
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.
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).
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.
virtual bool is_ancestor_of(const any *xother) const
True if other conforms to this.
Abstract base class with useful features for all objects.
virtual void reset(bool xreset_markers=true)
Restarts the iteration.
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.
bool le(pod_index_type xother_index) const
True if this is less than or equal to the member with index xother_index.
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.
virtual void get_prop_disc_values(const sec_vd &xsec)
The gets the values of xsec at the property discretization points.
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).
virtual property_disc_iterator_1_2 * clone() const
Make a new instance of the same type as this.
~property_disc_iterator_1_2()
Destructor.
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).