22 #include "SheafSystem/refining_section_pusher.h" 24 #include "SheafSystem/assert_contract.h" 25 #include "SheafSystem/base_space_member.h" 26 #include "SheafSystem/base_space_poset.h" 27 #include "SheafSystem/depth_bound_refinement_policy.h" 28 #include "SheafSystem/error_message.h" 29 #include "SheafSystem/factory.h" 30 #include "SheafSystem/field_eval_iterator.h" 31 #include "SheafSystem/field_refinement_buffer.h" 32 #include "SheafSystem/field_refinement_policy.h" 33 #include "SheafSystem/local_field_refiner.h" 34 #include "SheafSystem/field_refiner_family.h" 35 #include "SheafSystem/section_evaluator.h" 36 #include "SheafSystem/sec_ed_invertible.h" 37 #include "SheafSystem/sec_vd.h" 38 #include "SheafSystem/variance_bound_refinement_policy.h" 39 #include "SheafSystem/field_vd.h" 40 #include "SheafSystem/zone_centered_error_bound_refinement_policy.h" 55 const std::string& xrefiner_family_name,
56 const std::string& xrefinement_policy_name,
62 require(field_refiner_family::family_factory().contains_prototype(xrefiner_family_name));
63 require(field_refinement_policy::policy_factory().contains_prototype(xrefinement_policy_name));
73 _refiners = field_refiner_family::new_family(xrefiner_family_name);
76 field_refinement_policy::new_policy(xrefinement_policy_name);
81 _refiners->initialize(dynamic_cast<const base_space_poset&>(xbase_space),
92 ensure(refiners().is_initialized());
93 ensure(refiners().class_name() == xrefiner_family_name);
132 #ifdef DIAGNOSTIC_OUTPUT 133 post_information_message(
"Entering push_pa:");
142 define_old_variable(
int old_xsource_access_request_depth =
144 define_old_variable(
int old_xtarget_access_request_depth =
184 policy().refinement_depth_ub());
196 lbuffer.gather_coordinate_dofs();
200 lbuffer.push_prop_dofs();
205 lbuffer.gather_property_dofs();
211 assertion(lrefiner != 0);
219 lrefiner->
refine(lbuffer);
virtual bool invariant() const
Class invariant, intended to be redefined in each descendant. See below for template for invariant in...
virtual void get_read_write_access(bool xbase_access, bool xrelease_read_only_access)
Get read write access to the coordinates and property sections, which implies read access to the base...
void repeat(bool xwas_eval_member)
Repeats the iteration over the down set of index(). If index() refers to a zone that has just been re...
void next()
Makes this the next member of the subset.
section_evaluator & property_evaluator() const
The property field evaluator associated with the current evaluation member.
A family of compatible local_field_refiners, one for each member of some family of cell types; a map ...
bool state_is_read_write_accessible(bool xbase_access=false) const
True if this is attached and if coordinates(), property() and (if xbase access) base_space() are acce...
schema_poset_member & fiber_schema()
The fiber schema component of this (mutable version).
A buffer for data which is used by both a local_field_refiner object and its associated field_refinem...
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 ~refining_section_pusher()
Destructor.
pod_index_type type_id() const
The type id of the current member.
virtual void get_read_access() const
Get read access to the state associated with this.
An iterator which concurrently traverses the schema of both the coordinates and property sections of ...
virtual void initialize_point_locator(bool xauto_access)
Initializes point locater search structure using default values.
bool is_invertible() const
True if this can be inverted.
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 bool invariant() const
Class invariant.
size_type refinement_depth() const
The refinement depth; the number of evaluation members the current evaluation member is contained in...
void refine(field_refinement_buffer &xbuffer)
Refines the zone specified by xbuffer.zone_id one level and evaluates the coordinates section on the ...
bool same_fiber(const sec_vd &x1, const sec_vd &x2) const
True if and only if x1 and x2 have the same fiber type and dimension.
const block< scoped_index > & property_discretization_members() const
The property discretization members in the downset of the current evaluation member.
const field_refinement_policy & policy() const
The refinement policy for this refiner.
field_refinement_policy & policy() const
The refinement policy of the refiners.
scoped_index zone_id
The id of the current zone.
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...
A client handle for a mutable partially ordered set.
poset * host() const
The poset which this is a handle to a member of.
virtual bool should_refine(field_refinement_buffer &xbuffer, size_type xrefinement_depth) const =0
True if the zone specified by xzone_id should be refined.
int access_request_depth() const
The number of times access has been requested and granted without being released. ...
section_evaluator & coordinate_evaluator() const
The coordinate field evaluator associated with the current evaluation member.
An abstract policy that determines the conditions under which a zone should be refined.
A vd-valued property as a function of global coordinates.
sec_vd & property() const
The dependent variable of this field.
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
const block< scoped_index > & coordinate_discretization_members() const
The coordinate discretization members in the downset of the current evaluation member.
void push(const field_vd &xsource, field_vd &xtarget, bool xauto_access)
Pushes field xsource to field xtarget, pre-allocated.
refining_section_pusher()
Default constructor; disabled.
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
base_space_member & base_space() const
The base space of this field.
void force_cache_update()
Forces update of the attribute cache.
A section of a fiber bundle with a d-dimensional vector space fiber.
bool is_done() const
True if iteration finished.
bool same_evaluation() const
True if the coordinates and property sections both use the same evaluation subposet.
An abstract refiner for a field over a local region (primitive cell) in the base space.
bool invariant_check() const
True if invariant checking is enabled.
A refining section push-forward operator. Moves sections from one sec_rep_space to another using exte...
virtual section_space_schema_member & schema()
The restricted schema for this (mutable version).
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...
virtual void end_jim_edit_mode(bool xensure_lattice_invariant=true, bool xauto_access=true)
Prevent editing of jims and jim order relation.
int df() const
The dimension of the fiber space component.
virtual void get_read_access() const
Get read access to the state associated with this.
void enable_invariant_check() const
Enable invariant checking.
field_refiner_family & refiners()
The family of refiners for the range.
const scoped_index & index() const
The index of the current member of the iteration.
virtual void begin_jim_edit_mode(bool xauto_access=true)
Allow editing of jims and jim order relation.