21 #include "SheafSystem/field_refiner_family.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/base_space_member.h" 25 #include "SheafSystem/base_space_poset.h" 26 #include "SheafSystem/factory.impl.h" 27 #include "SheafSystem/field_refinement_policy.h" 28 #include "SheafSystem/local_field_refiner.h" 29 #include "SheafSystem/namespace_poset.h" 46 require(family_factory().contains_prototype(xname));
50 result = family_factory().new_instance(xname);
71 _members.reserve(xother.
_members.ct());
73 for(
int i=0; i<xother.
_members.ct(); ++i)
76 _members[i] = (lmbr != 0) ? lmbr->
clone() : 0;
78 _members.set_ct(xother.
_members.ct());
92 _cell_type_id_space = 0;
123 if(_cell_type_id_space != 0)
125 _cell_type_id_space->release_id_space();
145 static const string result;
149 ensure(!result.empty());
164 require((0 <= xtype_id) && (xtype_id < size()));
170 result = _members[xtype_id];
189 result = _members.ct();
205 require(is_initialized());
246 require(!is_initialized());
251 poset& lprototypes_poset =
258 _members.reserve(lprototypes_poset.member_index_ub().pod());
260 _members.set_ct(_members.ub());
265 _policy = xpolicy.
clone();
269 _cell_type_id_space =
270 &lprototypes_poset.member_id_spaces(
false).get_id_space(
"cell_types");
274 _is_initialized =
true;
278 lprototypes_poset.release_access();
283 ensure(is_initialized());
284 ensure_for_all(i, 0, size(), (member(i) != 0) ? (&member(i)->policy() == &xpolicy) :
true);
295 return _is_initialized;
304 _cell_type_id_space(0),
305 _is_initialized(false)
384 require(xother != 0);
virtual bool invariant() const
Class invariant, intended to be redefined in each descendant. See below for template for invariant in...
static field_refiner_family * new_family(const std::string &xname)
Creates an instance of the refiner family associated with name xname.
static factory< field_refiner_family > & family_factory()
A factory for making field_refiner_family objects.
A family of compatible local_field_refiners, one for each member of some family of cell types; a map ...
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...
size_type size() const
The number of members of this family.
virtual field_refiner_family * clone() const
Virtual constructor; makes a new instance of the same type as this.
virtual ~field_refiner_family()
Destructor.
poset_state_handle & member_poset(pod_index_type xhub_id, bool xauto_access=true) const
The poset_state_handle object referred to by hub id xhub_id.
virtual index_space_handle & get_id_space() const =0
Allocates an id space handle from the handle pool attached to the same id space.
bool is_initialized() const
True if this has been populated with members.
Abstract base class with useful features for all objects.
virtual const std::string & class_name() const =0
The name of this family.
index_space_handle * _cell_type_id_space
The id space for base space cell type ids.
The lattice of closed cells of a cellular space; a lattice representation of a computational mesh...
field_refiner_family()
Default constructor.
A factory for instanting descendants of an abstract type T, given the class name of the descendant...
A client handle for a mutable partially ordered set.
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.
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 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...
block< local_field_refiner * > _members
The members of the family.
namespace_poset * name_space() const
The namespace this poset resides in.
bool _is_initialized
True if this has been populated with members.
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.
int_type pod_index_type
The plain old data index type.
virtual bool invariant() const
Class invariant.
virtual bool is_ancestor_of(const any *xother) const
Conformance test; true if other conforms to this.
virtual void get_read_access() const
Get read access to the state associated with this.
virtual field_refinement_policy * clone() const =0
Virtual constructor, makes a new instance of the same type as this.
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.
field_refinement_policy * _policy
The refinement policy for this family.
virtual local_field_refiner * clone() const =0
Virtual constructor, makes a new instance of the same type as this.