24 #include "SheafSystem/field_refiner.h" 26 #include "SheafSystem/assert_contract.h" 27 #include "SheafSystem/base_space_member.h" 28 #include "SheafSystem/base_space_poset.h" 29 #include "SheafSystem/depth_bound_refinement_policy.h" 30 #include "SheafSystem/error_message.h" 31 #include "SheafSystem/factory.h" 32 #include "SheafSystem/field_eval_iterator.h" 33 #include "SheafSystem/field_refinement_buffer.h" 34 #include "SheafSystem/field_refinement_policy.h" 35 #include "SheafSystem/local_field_refiner.h" 36 #include "SheafSystem/field_refiner_family.h" 37 #include "SheafSystem/section_evaluator.h" 38 #include "SheafSystem/sec_ed_invertible.h" 39 #include "SheafSystem/sec_vd.h" 40 #include "SheafSystem/variance_bound_refinement_policy.h" 41 #include "SheafSystem/field_vd.h" 42 #include "SheafSystem/zone_centered_error_bound_refinement_policy.h" 138 const std::string& xrefiner_family_name,
139 const std::string& xrefinement_policy_name,
165 _refiners->
initialize(dynamic_cast<const base_space_poset&>(xbase_space),
176 ensure(
refiners().is_initialized());
177 ensure(
refiners().class_name() == xrefiner_family_name);
214 #ifdef DIAGNOSTIC_OUTPUT 215 post_information_message(
"Entering refine(field_vd&, bool)");
223 define_old_variable(
int old_xtarget_access_request_depth =
260 assertion(lrefiner != 0);
266 lbuffer.zone_id = litr.
index();
269 lbuffer.depth = ldepth;
273 lbuffer.gather_coordinate_dofs();
280 lbuffer.refine_prop_dofs(lrefiner);
285 lbuffer.gather_property_dofs();
293 lrefiner->
refine(lbuffer);
297 lbuffer.save_parent();
340 #ifdef DIAGNOSTIC_OUTPUT 341 post_information_message(
"Entering refine(sec_ed&, sec_vd&, bool");
346 require(precondition_of(
refine(
field_vd(xcoordinates, xproperty, xauto_access), xauto_access)));
350 field_vd ltarget(xcoordinates, xproperty, xauto_access);
352 refine(ltarget, xauto_access);
356 ensure(postcondition_of(
refine(
field_vd(xcoordinates, xproperty, xauto_access), xauto_access)));
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...
static factory< field_refinement_policy > & policy_factory()
A factory for making policy objects.
static field_refiner_family * new_family(const std::string &xname)
Creates an instance of the refiner family associated with name xname.
virtual bool invariant() const
Class invariant.
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.
static factory< field_refiner_family > & family_factory()
A factory for making field_refiner_family objects.
section_evaluator & property_evaluator() const
The property field evaluator associated with the current evaluation member.
static field_refinement_policy * new_policy(const std::string &xname)
Creates an instance of the policy with class name xname.
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...
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.
field_refinement_policy & policy() const
The refinement policy for this family.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
pod_index_type type_id() const
The type id of the current member.
An iterator which concurrently traverses the schema of both the coordinates and property sections of ...
size_type refinement_depth_ub() const
The upper bound on the refinement depth of a cell. A cell will not be refined if its refinement depth...
size_type refinement_depth() const
The refinement depth; the number of evaluation members the current evaluation member is contained in...
virtual ~field_refiner()
Destructor.
void refine(field_refinement_buffer &xbuffer)
Refines the zone specified by xbuffer.zone_id one level and evaluates the coordinates section on the ...
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.
A section of a fiber bundle with a d-dimensional Euclidean vector space fiber.
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.
local_field_refiner * member(pod_index_type xtype_id) const
The evaluator associated with cell type xtype_id. Note that the result may be void.
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.
virtual void initialize(const base_space_poset &xbase_space, const field_refinement_policy &xpolicy)=0
Initializes this to contain members for base space xbase_space and using policy xpolicy.
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.
field_refiner()
Default constructor; disabled.
A section of a fiber bundle with a d-dimensional vector space fiber.
bool is_done() const
True if iteration finished.
field_refinement_policy & policy() const
The refinement policy of the refiners.
bool same_evaluation() const
True if the coordinates and property sections both use the same evaluation subposet.
field_refiner_family & refiners()
The family of refiners for the range.
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.
virtual section_space_schema_member & schema()
The restricted schema for this (mutable version).
sec_ed_invertible & coordinates() const
The independent variable of this field.
virtual void end_jim_edit_mode(bool xensure_lattice_invariant=true, bool xauto_access=true)
Prevent editing of jims and jim order relation.
virtual void get_read_access() const
Get read access to the state associated with this.
Refines a given field and its base space using a given refinement policy and refiner family...
void refine(field_vd &xtarget, bool xauto_access)
Refines field xtarget.
void enable_invariant_check() const
Enable invariant checking.
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.