21 #include "SheafSystem/variance_bound_refinement_policy.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/factory.h" 25 #include "SheafSystem/field_refinement_buffer.h" 26 #include "SheafSystem/std_cmath.h" 27 #include "SheafSystem/field_vd.h" 42 _variance_ub(xvariance_ub)
132 fields::variance_bound_refinement_policy::
133 _has_prototype = make_prototype();
136 fields::variance_bound_refinement_policy::
180 #ifdef DIAGNOSTIC_OUTPUT 182 cout <<
" zone_id: " << xbuffer.
zone_id 183 <<
" refinement_depth: " << xrefinement_depth;
203 assertion(k < ldofs_ub);
232 if(lprop_norm != 0.0)
234 result = (lvariance_norm > (ldp*lprop_norm*
_variance_ub));
241 #ifdef DIAGNOSTIC_OUTPUT 243 <<
" prop norm: " << lprop_norm
244 <<
" variance norm: " << lvariance_norm;
249 #ifdef DIAGNOSTIC_OUTPUT 250 cout <<
" result: " << boolalpha << result << noboolalpha << endl;
291 static const string result(
"variance_bound_refinement_policy");
virtual bool invariant() const
Class invariant, intended to be redefined in each descendant. See below for template for invariant in...
static factory< field_refinement_policy > & policy_factory()
A factory for making policy objects.
size_type _refinement_depth_ub
The upper bound and the refinement level of a cell.
size_type ct() const
The number of items currently in use.
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.
variance_bound_refinement_policy(size_type xrefinement_level_ub=2, sec_vd_value_type xvariance_ub=1.0e-10)
Creates an instance with refinement bound xrefinement_ub and variance bound xvariance_ub.
const block< scoped_index > & prop_disc_ids
A buffer for gathering the property discretization members for the current zone.
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...
virtual variance_bound_refinement_policy & operator=(const field_refinement_policy &xother)
Assignment operator.
A policy that determines a zone should be refined if the variance using the L1 norm of any discretiza...
Abstract base class with useful features for all objects.
sec_vd_value_type variance_ub() const
The upper bound on the variance of the dofs of a cell.
static const std::string & static_class_name()
The class name of this class.
void assign(const_reference_type xitem)
Sets the values of all items to xitem.
scoped_index zone_id
The id of the current zone.
void set_ct(size_type xct)
Sets ct() == xct.
virtual variance_bound_refinement_policy * clone() const
Virtual constructor, makes a new instance of the same type as this.
void put_variance_ub(sec_vd_value_type xub)
Sets variance_ub to xub.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
An abstract policy that determines the conditions under which a zone should be refined.
virtual bool invariant() const
Class invariant.
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
field_vd & target
The field being refined.
block< sec_vd_value_type > prop_value
A buffer for computing target property at a point.
virtual ~variance_bound_refinement_policy()
Destructor.
virtual bool should_refine(field_refinement_buffer &xbuffer, size_type xrefinement_depth) const
True if the zone specified by xzone_id should be refined.
bool invariant_check() const
True if invariant checking is enabled.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
int dp() const
The dimension of the property (dependent variable) space.
sec_vd_value_type _variance_ub
The upper bound on the variance.
vd_value_type sec_vd_value_type
The type of component in the value of a section at a point.
bool is_same_type(const any *other) const
True if other is the same type as this.
void enable_invariant_check() const
Enable invariant checking.
block< sec_vd_dof_type > prop_dofs
A buffer for gathering property dofs.
virtual const std::string & class_name() const
The class name of this.