21 #include "SheafSystem/sec_rep_space.h" 22 #include "SheafSystem/arg_list.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/array_index_space_handle.h" 25 #include "SheafSystem/array_index_space_state.h" 26 #include "SheafSystem/array_section_dof_map.h" 27 #include "SheafSystem/binary_section_space_schema_member.impl.h" 28 #include "SheafSystem/binary_section_space_schema_poset.h" 29 #include "SheafSystem/index_space_iterator.h" 30 #include "SheafSystem/namespace_poset.impl.h" 31 #include "SheafSystem/poset.h" 32 #include "SheafSystem/poset_type.h" 33 #include "SheafSystem/poset_handle_factory.h" 34 #include "SheafSystem/poset_member.h" 35 #include "SheafSystem/poset_state.h" 36 #include "SheafSystem/postorder_iterator.h" 37 #include "SheafSystem/std_string.h" 38 #include "SheafSystem/sec_rep_descriptor.h" 39 #include "SheafSystem/sec_rep_space_member.h" 40 #include "SheafSystem/tern.h" 59 static const string result(
"sec_rep_space");
63 ensure(!result.empty());
76 require(state_is_read_accessible());
84 return schema().base_space();
93 require(state_is_read_accessible());
101 return schema().base_space();
112 require(state_is_read_accessible());
116 result = schema().db();
136 require(state_is_read_accessible());
140 result = schema().df();
158 require(state_is_read_accessible());
166 return schema().fiber_schema();
175 require(state_is_read_accessible());
183 return schema().fiber_schema();
192 require(xauto_access || state_is_read_accessible());
200 return schema(xauto_access).fiber_schema();
209 require(xauto_access || state_is_read_accessible());
217 return schema(xauto_access).fiber_schema();
227 require(state_is_read_accessible());
235 return schema().rep();
245 require(state_is_read_accessible());
253 return schema().rep();
271 result = section_space_schema_poset::rep_is_valid(*xrep, *(xbase->
host()));
286 require(state_is_read_accessible());
294 return schema().discretization();
303 require(state_is_read_accessible());
311 return schema().discretization();
320 require(state_is_read_accessible());
328 return schema().discretization_ct();
337 require(state_is_read_accessible());
345 return schema().rep().multiplicity();
354 require(state_is_read_accessible());
363 return schema().evaluation();
372 require(state_is_read_accessible());
381 return schema().evaluation();
390 require(state_is_read_accessible());
398 return schema().rep().evaluator_family_name();
407 require(state_is_read_accessible());
415 return schema().rep().url();
443 require(xbottom != 0);
478 fiber_bundle::sec_rep_space::
526 result = !
is_jim(xhub_id,
true);
575 ensure(!result.empty());
598 ensure(!result.empty());
620 static const string multisection_id_space_name(
"__multisections");
630 multisection_id_space_name,
667 static const string multisection_id_space_name(
"__multisections");
677 multisection_id_space_name,
775 ensure(is_basic_query);
796 ensure(is_basic_query);
879 ensure(is_basic_query);
900 ensure(is_basic_query);
922 return SEC_REP_SPACE_ID;
933 static const char* result =
"sec_rep_space";
1008 require(unexecutable(
"xschema.is_same_state(xdof_map.schema())"));
1053 ensure(
base().
is_same_state(&(reinterpret_cast<const section_space_schema_member&>(xschema).base_space())));
1054 ensure(
schema().fiber_space().
is_same_state(&(reinterpret_cast<const section_space_schema_member&>(xschema).
host()->fiber_space())));
1055 ensure(
rep().
is_same_state(&(reinterpret_cast<const section_space_schema_member&>(xschema).
rep())));
1285 ensure(result >= 0);
1300 require(xdof_map != 0);
1310 ensure(result ? (dynamic_cast<const section_dof_map*>(xdof_map) != 0) :
true);
1334 ensure(result >= 0);
1377 require(
schema().base_space().geqv(xbase_id));
1408 require(
schema().base_space().geqv(xbase_id));
1436 require(
is_jim(xmbr_index,
false));
1460 require(
is_jim(xmbr_index,
false));
1475 require(
is_jim(xmbr_index,
false));
1499 require(
is_jim(xmbr_index,
false));
1531 ensure(result != 0);
static bool rep_is_valid(const abstract_poset_member *xbase, const sec_rep_descriptor *xrep)
True if xrep is a valid rep descriptor for sec rep spaces over xbase,.
virtual void get_read_write_access(bool xrelease_read_only_access=false)
Get read write access to the state associated with this. If release_read_only_access is requested...
poset_state_handle * host() const
The poset which this is a handle to a component of.
bool allocated_id_space_iterator(const index_space_iterator &xitr) const
True if and only if id space iterator xitr was allocated by the iterator pool.
bool allocated_branch_handle(index_space_handle &xid_space, bool xauto_access) const
True if the handle pool allocated xid_space.
A client handle for a subposet.
void insert_prototype(const poset_state_handle *xprototype)
Sets xprototype as the prototype for its client class.
int db() const
The dimension of the base space.
bool has_standard_member_ct() const
True if poset is in its initial state, that is, it contains just the standard members.
virtual void attach_to(pod_type xindex)
Attach to the state with index xindex in the id space family id_spaces().
The private state of a partially ordered set.
int discretization_ct() const
The number of members of the intersection of discretization with the down set of base.
The abstract map from section dof ids to section dof values of heterogeneous type.
An abstract iterator over the ids of an id space.
void release_id_space(index_space_handle &xid_space) const
Returns the id space handle xid_space to the handle pool.
virtual poset_state * state_obj() const
State object for this poset.
void put_row_dof_tuple(poset_dof_map *xdof_tuple)
Sets the dof tuple at index xindex to xdof_tuple.
void initialize_table_dof_tuple(array_poset_dof_map *xdof_tuple)
Installs xdof_tuple as the table dof tuple.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
bool allocated_branch_iterator(index_space_iterator &xitr, bool xauto_access) const
True if the iterator pool allocated xitr.
poset_type
Identifiers for poset types.
pod_index_type member_dof_tuple_id(pod_index_type xmbr_hub_id, bool xauto_access) const
The dof tuple hub id of the member with hub id xmbr_hub_id.
std::string evaluator_family() const
The name of the evaluator family used by this section space.
virtual void initialize_standard_members()
Creates the members common to every poset, for instance, top() and bottom().
A client handle for a general, abstract partially order set.
index_space_handle & get_id_space(const std::string &xname) const
Allocates an id space handle from the handle pool attached to state with name xname.
static int dof_ct(const namespace_poset &xns, const poset_path &xpath, bool xis_table_dof, bool xauto_access=true)
The number of table dofs (xis_table_dof true) or row dofs defined by the schema specified by xns and ...
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
A member of a sec_rep_space; a section.
const index_space_family & member_id_spaces(bool xauto_access) const
Collection of member id spaces for this (const version).
virtual void initialize_standard_subposets(const std::string &xname)
Creates the subposets common to every poset (e.g. whole() and jims()).
virtual size_t dof_tuple_ub(bool xis_table_dof) const
The size in bytes of the table/row dof tuple.
abstract_poset_member * _top
Top member of poset.
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
int df() const
The dimension of the fiber space.
The general, abstract map from dof ids to dof values.
namespace_poset * host() const
The namespace this poset resides in. Obsolete; use name_space() instead.
poset_table_state * table() const
Table (dof tuples).
index_space_iterator & get_id_space_iterator(const std::string &xname) const
Allocates an id space iterator from the iterator pool attached to state with name xname...
abstract_poset_member & base()
The base space for this section space (mutable version)
bool has_version(int xversion) const
True if xversion is a valid version.
abstract_poset_member * _bottom
Bottom members of poset.
virtual pod_type pod(pod_type xid) const
The pod index in this space equivalent to xid in the hub id space.
sec_rep_space_member & top()
The top of member of the lattice (mutable version)
Abstract base class with useful features for all objects.
bool invariant() const
The class invariant.
sec_rep_descriptor & rep()
A representation descriptor for this sec rep space (mutable version).
virtual section_space_schema_member & schema()
The schema for this poset (mutable version)
std::string url() const
The url for a description of the representation.
virtual bool schema_is_ancestor_of(const schema_poset_member *xother_schema) const
True if xother_schema conforms to the type of schema required by this.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
section_dof_map & member_dof_map(pod_index_type xmbr_index, bool xrequire_write_access=false)
The dof map associated with the member identified by xmbr_id (mutable version).
const scattered_insertion_index_space_handle & multisection_id_space(bool xauto_access) const
The sequence id space for multisections (const version).
void release_branch_id_space(index_space_handle &xid_space, bool xauto_access) const
Returns the id space handle xid_space to the handle pool.
bool has_standard_subposet_ct() const
True if poset is in its initial state, that is, it contains just the standard subposets.
void update_standard_member_id_spaces()
Update the initially allocated id spaces.
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 contiguous tuple, contiguous fiber representation of the abstract map from section dof ids to secti...
subposet & discretization()
The subposet on which the degrees of freedom are defined (mutable version).
bool has_standard_row_dof_tuple_ct() const
True if poset is in its initial state, that is, it contains just the standard row_dof_tuples.
virtual int dof_ct(bool xis_table_dof) const
The number of dofs in the table/row dof tuple of this sec_rep_space;.
void release_id_space_iterator(index_space_iterator &xitr) const
Returns the id space iterator xitr to the iterator pool.
virtual const scoped_index & new_row_dof_map()
Creates a new row dof map for total sections of this.
An index within the external ("client") scope of a given id space.
virtual bool is_attached() const
True if this handle is attached to a state.
An array implementation of class scattered_insertion_index_space_handle. This representation is inten...
std::string poset_name() const
The poset name part of the path.
size_type row_dof_tuple_ct() const
The number of row_dof_tuples of this poset.
schema_poset_member & fiber_schema()
The schema of the fiber space, i.e. fiber().schema() (mutable version).
virtual bool contains_member(pod_index_type xmbr_hub_id, bool xauto_access=true) const
True if some version of this poset contains poset member with hub id xmbr_hub_id. ...
virtual void begin_jim_edit_mode(bool xauto_access=true)
allow editing of jims and jim order relation
virtual void begin_jim_edit_mode(bool xauto_access=true)
Allow editing of jims and jim order relation.
scattered_insertion_index_space_handle _multisection_id_space
The sequence id space for multisections.
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...
std::string branch_id_space_name(pod_index_type xhub_id, bool xauto_access) const
The name of the sequence id space for the branches of the multisection with hub id xhub_id...
poset_state_handle()
Default constructor.
scattered_insertion_index_space_handle & get_branch_id_space(pod_index_type xhub_id, bool xauto_access)
Allocate an id space handle from the handle pool attached to the branch id space of the multisection ...
virtual bool is_ancestor_of(const any *other) const
True if other conforms to this.
sec_rep_space_member & bottom()
The bottom of member of the lattice (mutable version)
static poset_handle_factory & factory()
The poset handle factory.
virtual ~sec_rep_space()
Destructor.
static const std::string & static_class_name()
The name of this class.
virtual poset_dof_map & row_dof_map(pod_index_type xtuple_hub_id, bool xrequire_write_access=false) const
The map from row dof client_ids to row dof values for dof tuple hub id xtuple_hub_id.
virtual bool is_attached() const
True if this is attached to a state.
int multiplicity() const
The number of degrees of freedom associated with each member of the discretization.
bool is_multisection(pod_index_type xhub_id, bool xauto_access) const
True if the section with hub id xhub_id is a multisection.
poset_state * _state
State object for this poset.
virtual poset_type type_id() const
Identifier for the type of this poset.
virtual bool is_attached() const =0
True if this iterator is attached to a state.
bool invariant_check() const
True if invariant checking is enabled.
bool allocated_id_space(const index_space_handle &xid_space) const
True if and only if id space handle xid_space was allocated by the handle pool.
size_t dof_tuple_ub(bool xis_table_dof) const
The size in bytes of the table dof tuple (xis_table_dof true) or the row dof tuple defined by this sc...
virtual bool row_dof_map_conforms(const poset_dof_map *xdof_map) const
True if xdof_map conforms to (i.e. is derived from) the type of row_dof map required by this poset...
virtual const char * class_name() const
The name of this class.
int_type pod_index_type
The plain old data index type.
virtual void new_state(const poset_path &xpath, const schema_poset_member &xschema, array_poset_dof_map &xdof_map)
Creates a new poset state with path xpath, schema xschema and table dof map xdof_map, attaches this to the state.
A handle for a scattered_insertion_index_space_state.
A client handle for a poset member which has been prepared for use as a schema for a section space...
virtual void end_jim_edit_mode(bool xensure_lattice_invariant=true, bool xauto_access=true)
prevent editing of jims and jim order relation
sec_rep_space()
Default constructor; creates an unattached handle.
static array_index_space_handle new_space(index_space_family &xid_spaces, const std::string &xname, bool xis_persistent, size_type xcapacity)
Create a new array id space in the id space family xid_spaces at the next available id space index wi...
virtual bool is_jim(pod_index_type xmbr_hub_id, bool xin_current_version=true) const
True if the member with hub id xmbr_hub_id is a jim in the current version (xin_current_version == tr...
virtual void end_jim_edit_mode(bool xensure_lattice_invariant=true, bool xauto_access=true)
Prevent editing of jims and jim order relation.
bool is_same_state(const poset_state_handle *xother) const
True if this is attached to the same state as xother.
void release_branch_id_space_iterator(index_space_iterator &xitr, bool xauto_access) const
Returns the id space iterator xitr to the iterator pool.
virtual void get_read_access() const
Get read access to the state associated with this.
An abstract client handle for a member of a poset.
bool in_jim_edit_mode() const
True if editing jims and jim order relation is allowed.
An array representation of abstract class poset_dof_map.
Namespace for the fiber_bundles component of the sheaf system.
bool is_same_type(const any *other) const
True if other is the same type as this.
virtual sec_rep_space * clone() const
Virtual constructor.
void enable_invariant_check() const
Enable invariant checking.
bool contains_row_dof_tuple(pod_index_type xtuple_hub_id) const
True if this contains a tuple with hub id xtuple_hub_id.
bool state_is_not_read_accessible() const
True if this is attached and if the state is accessible for read or if access control is disabled...
virtual bool invariant() const
Class invariant.
A client handle for a poset member which has been prepared for use as a schema.
const scoped_index & index() const
The index of this in host() dof tuple table.
index_space_iterator & get_branch_id_space_iterator(pod_index_type xhub_id, bool xauto_access) const
Allocate an id space iterator from the iterator pool attached to the branch id space of the multisect...
subposet & evaluation()
The subposet on which the evaluation method is defined (mutable version).
static std::string make_reserved_name(const std::string &xprefix, const size_t &xindex, const std::string &xsuffix)
Creates a string reserved_prefix()_xprefix_xindex_xsuffix.
A description for a section representation scheme.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
A handle for a poset whose members are numerical representations of sections of a fiber bundle...