21 #include "SheafSystem/binary_section_space_schema_member.impl.h" 23 #include "SheafSystem/binary_section_space_schema_poset.h" 24 #include "SheafSystem/assert_contract.h" 25 #include "SheafSystem/base_space_poset.h" 26 #include "SheafSystem/fiber_bundles_namespace.h" 27 #include "SheafSystem/sec_rep_descriptor.h" 28 #include "SheafSystem/sec_rep_descriptor_poset.h" 29 #include "SheafSystem/wsv_block.h" 49 result(section_space_schema_member::standard_schema_path().poset_name(),
"binary_section_space_schema_schema");
53 ensure(result.
full());
76 standard_schema_path().member_name(),
77 section_space_schema_member::standard_schema_path(),
81 lschema.detach_from_state();
108 require(!xhost_path.
empty());
111 require(xschema_path.
full());
113 require(schema_poset_member::conforms_to(xns, xschema_path, host_type::standard_schema_path(), xauto_access));
115 require(xbase_path.
full());
118 require(!xfiber_path.
empty());
121 require(xrep_path.
full());
126 host_type& result = host_type::new_table(xns, xhost_path, xschema_path, xbase_path, xfiber_path, xrep_path, xauto_access);
130 ensure(xns.
owns(result, xauto_access));
131 ensure(result.
path(
true) == xhost_path);
133 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
137 ensure(result.
rep_path(
true) == xrep_path);
271 ensure(
host() == xhost);
272 ensure(
index() == xhub_id);
292 ensure(
host() == xhost);
293 ensure(
index() ==~ xid);
299 const std::string& xname)
305 require(!xname.empty());
315 ensure(
host() == xhost);
316 ensure(
name() == xname);
472 ensure(xis_table_dof ? result == NOT_A_PRIMITIVE_TYPE :
true);
491 require(xis_table_dof);
499 ensure(unexecutable(result != 0 implies it points to a buffer of
length table_dof_ct()+1));
693 ldecomp->
force(lschema_mbr_id,
true);
701 host()->member_hub_id_space(
false),
732 ensure(
host()->contains_member(result));
751 require(
host()->member_id_spaces(
false).contains(xid_space_name));
752 require(
host()->
base_space().member_id_spaces(
false).contains(xid_space_name));
754 require(
host()->
fiber_schema().member_id_spaces(
false).contains(xid_space_name));
761 xschema_poset_ext_id =
775 xfiber_schema_ext_id =
838 require(xrequire_write_access ?
861 require(xrequire_write_access ?
901 _index =
hub_id(
host()->get_index_from_components(xbase_space_id, xfiber_schema_id));
937 _index =
hub_id(
host()->get_index_from_components(xbase_space_id, xfiber_schema_id));
967 require(xbase_path.
full());
969 require(xfiber_schema_path.
full());
1065 ensure(result != 0);
bool has_path(const poset_path &xpath, bool xauto_access) const
True if and only if xpath refers to this component.
virtual poset_path path(bool xauto_access=true) const
The path of this poset.
bool state_is_auto_read_write_accessible(bool xauto_access) const
True if state is auto accessible for read and write, that is, if the state is already accessible for ...
virtual bool is_jim(bool xin_current_version=true) const
True if this member is join irreducible in the current version of the host (xin_current_version == tr...
virtual void get_ext_ids(const std::string &xid_space_name, pod_index_type &xschema_poset_ext_id, pod_index_type &xschema_member_ext_id, pod_index_type &xbase_space_ext_id, pod_index_type &xfiber_schema_ext_id, pod_index_type &xlocal_schema_ext_id) const
Gets the external ids of this in the id space with namexid_space_name.
A client handle for a subposet.
Iterates in postorder over dofs of a schema member anchor. Attaches an a handle of type section_space...
A client handle for a poset member which has been prepared for use as a schema for a section space...
bool full() const
True if both poset name and member name are not empty.
int version(bool xunalias=true) const
The (possibly aliased) version of this component. The version of the host used when evaluating proper...
void length(const S &x0, SR &xresult, bool xauto_access)
binary_section_space_schema_poset * host() const
The poset which this is a handle to a component of.
const pod_type & pod() const
The "plain old data" storage of this; the value in the external id space.
virtual size_t size() const
The number of bytes in this dof.
virtual primitives_poset_dof_map & dof_map(bool xrequire_write_access=false)
The map from schema member ids or client ids to dof values for this poset member (mutable version) ...
virtual schema_poset_member & ext_data_type_schema()
The schema for the external data type associated with this schema.
schema_poset_member & fiber_schema()
The fiber schema component of this (mutable version).
poset_path path(bool xauto_access=true) const
A path to this component.
The default name space; a poset which contains other posets as members.
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 path_is_auto_read_accessible(const poset_path &xpath, bool xauto_access) const
True if the state referred to xpath exists and is auto read accessible.
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
poset_state_handle * _host
The host poset for this component.
bool contains_poset_member(pod_index_type xposet_hub_id, pod_index_type xmember_hub_id, bool xauto_access=true) const
True if this contains a poset with hub id xposet_hub_id which contains a member with hub id xmember_h...
A client handle for a general, abstract partially order set.
virtual void update_row_cache(bool xupdate_id_space=false) const
Updates cached row properties.
const scoped_index & index() const
The current item in the subset.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
dof_descriptor_array * dof_descriptors(bool xis_table_dof) const
The dof_descriptors_array for the table dof tuple (xis_table_dof true) or row dof tuple defined by th...
subposet & discretization()
The discretization subposet for section spaces on this schema.
virtual bool contains_member(pod_index_type xmbr_hub_id) const
True if this poset contains poset member with hub id xmbr_hub_id.
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.
A schema poset for a section space. A binary Cartesian product subspace of the binary tensor product ...
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 bool is_ancestor_of(const any *other) const
True if other conforms to this.
virtual namespace_poset * name_space() const
The namespace of host()
const scoped_index & index() const
The index of the component state this handle is attached to.
std::string name() const
A name for this.
The poset for sec_rep_descriptors.
virtual primitive_type type() const
The primitive type index of the dof defined by this.
poset_path rep_path(bool xauto_access) const
The path to the representation for section spaces on this schema..
virtual size_t ext_data_type_ct(bool xis_table_schema) const
The number of instances of the external data type needed to represent this schema.
virtual void attach_to_state(pod_index_type xbase_space_id, pod_index_type xfiber_schema_id)
Attach to the state in host() with component ids xbase_id and xfiber_schema_id.
void next()
Makes item the next member of the subset.
virtual ~binary_section_space_schema_member()
Destructor; deletes a poset member and its attached state, if any.
Abstract base class with useful features for all objects.
scoped_index _index
The index for this component within the host.
pod_index_type fiber_schema_id() const
The member id of the fiber schema component of this.
A map from Zn (the integers mod n) to bools. A characteristic function used to represent subsets of Z...
The lattice of closed cells of a cellular space; a lattice representation of a computational mesh...
virtual size_t alignment() const
The alignment for this dof.
pod_index_type get_int_id(pod_index_type xext_id, const std::string &xid_space_name, bool xauto_access) const
Translates xext_id to an internal id using the equivalence map with name xid_space_name.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
scoped_index _row_cache_index
The index with respect to which the cached row properties were evaluated.
virtual binary_section_space_schema_member & operator=(const abstract_poset_member &xother)
Assignment operator; attaches this to the same state as xother.
virtual pod_index_type get_ext_id(pod_index_type xint_id, const std::string &xid_space_name, bool xauto_access) const
Translates xint_id to an external id using the equivalence map with name xid_space_name.
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, const poset_path &xbase_path, const poset_path &xfiber_path, const poset_path &xrep_path, bool xauto_access)
Creates a new host for members of this type in namespace xns with path xhost_path, schema specified by xschema_path, and table attributes base_space_path, fiber_space_path, and rep_path specified by xbase_path, xfiber_path, and xrep_path, respectively.
primitive_type
Type ids for sheaf primitives.
virtual void attach_handle_data_members()
Initializes the handle data members when this handle is attached to a state.
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...
size_type _row_dof_ct
The number of row dofs defined by this schema.
virtual pod_index_type get_ext_id(const std::string &xid_space_name) const
Gets an external id corresponding to index() in the id space with name xid_space_name. /.
A map from schema poset member ids to dof values for primitives_poset members.
bool owns(const poset_state_handle &xposet, bool xauto_access) const
True if and only if this contains the poset xposet. synonym for contains_poset(xposet.poset_path(true), xauto_access)
int table_dof_ct() const
The number of table dofs defined by this schema. Synonym for dof_ct(true).
An index within the external ("client") scope of a given id space.
size_type _row_dof_tuple_ub
The size in bytes of the row dof tuple defined by this schema.
virtual bool is_attached() const
True if this handle is attached to a non-void state.
dof_descriptor_array * _row_dof_descriptors
The dof_descriptors_array for the row dof tuple defined by this schema.
std::string poset_name() const
The poset name part of the path.
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
int _version
The version of this component. The version of the host used when evaluating properties of this compon...
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. ...
binary_section_space_schema_member()
Default constructor; creates a new, unattached binary_section_space_schema_member handle...
virtual dof_descriptor_array * dof_descriptors(bool xis_table_dof) const
The dof_descriptors_array for the table dof tuple (xis_table_dof true) or row dof tuple defined by th...
SHEAF_DLL_SPEC bool is_primitive_index(pod_index_type xindex)
True if xindex is a valid primitive index.
virtual pod_index_type get_int_id(pod_index_type xext_id, const std::string &xid_space_name) const
Gets the internal id corresponding to xext_id in the id space with name xid_space_name.
int discretization_ct() const
The number of members in the intersection of the discretization subposet and the down set of the base...
virtual bool invariant() const
Class invariant.
virtual primitive_type dof_tuple_type(bool xis_table_dof) const
The type of table dofs (xis_table_dof == true) or row dofs (xis_table_dof == false) defined by this s...
An array for storing structs which describe the size, alignment, and offset of dofs within a dof tupl...
static int row_dof_ct(const namespace_poset &xns, const poset_path &xpath, bool xauto_access=true)
The number of row dofs defined by the schema specified by xns and xpath. Synonym for dof_ct(xns...
virtual sheaf::primitive_type type() const
The primitive type index of the dof defined by this.
int _row_cache_version
The version with respect to which the cached row properties were evaluated.
bool empty() const
True if both poset name and member name are empty.
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
poset_path base_space_path(bool xauto_access) const
The path to the base space for section spaces on this schema.
virtual const scoped_index & hub_id() const
A id in the hub id space for components of this type; intended for copying to initialize ids to the h...
bool contains_poset(pod_index_type xhub_id, bool xauto_access=true) const
True if this contains a poset with hub id xhub_id..
Iterates over the subset of Zn defined by the characteristic function host().
virtual binary_section_component_iterator * component_iterator() const
A postorder iterator over the components defined by this.
virtual void detach_from_state()
Detach this handle from its state, if any.
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. ...
An abstract schema poset for a section space. A Cartesian product subspace of the tensor product of a...
bool is_table_dof() const
True if this is in the table_dofs part of some schema. Synonym for is_dof(true).
size_t row_dof_tuple_ub() const
The size in bytes of the row dof tuple defined by this schema. Synonym for dof_tuple_ub(false).
bool invariant_check() const
True if invariant checking is enabled.
total_poset_member & base_space()
The base space component of this (mutable version).
poset_path fiber_space_path(bool xauto_access) const
The path to the fiber space for section spaces on this schema.
Iterates in postorder over dofs of a schema member anchor. Attaches an a handle of type section_space...
poset_state_handle & fiber_schema()
The fiber schema for section spaces on this schema (mutable version).
virtual void update_row_cache(bool xupdate_id_map=false) const
Updates cached row properties.
virtual bool host_is_ancestor_of(const poset_state_handle *other) const
True if other conforms to host.
int_type pod_index_type
The plain old data index type.
std::string member_name() const
The member name part of the path.
virtual primitives_poset_dof_map & dof_map(bool xrequire_write_access=false)
The map from schema member ids or client ids to dof values for this poset member (mutable version) ...
bool is_done() const
True if iteration finished.
virtual index_iterator * get_decomposition(pod_index_type xindex) const
An iterator over the members of the decomposition identified by xindex.
A client handle for a poset member which has been prepared for use as a schema for a section space...
virtual size_t alignment() const
The alignment for this dof.
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
virtual binary_section_space_schema_member * clone() const
Make a new handle, no state instance of current.
virtual bool is_dof(bool xin_table_dofs) const
True if this is in the table dofs part (xin_table_dofs == true) or in the row dofs part (xin_table_do...
static void make_standard_schema(namespace_poset &xns)
Creates standard schema for this class in namespace xns.
virtual binary_section_dof_iterator * dof_iterator(bool xis_table_dofs, int xversion=CURRENT_MEMBER_VERSION) const
A postorder iterator over the table (xis_table_dofs == true) or row (xis_table_dofs == false) dofs de...
virtual bool invariant() const
Class invariant.
virtual pod_index_type get_index_from_components(pod_index_type xbase_space_id, pod_index_type xfiber_schema_id) const
Computes the index associated with component ids xbase_space_id, xfiber_schema_id, and xlocal_schema_id.
An abstract client handle for a member of a poset.
virtual size_t size() const
The number of bytes in this dof.
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
Namespace for the fiber_bundles component of the sheaf system.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
int _discretization_ct
The number of members in the intersection of the discretization subposet the down set of the base spa...
void enable_invariant_check() const
Enable invariant checking.
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...
A client handle for a poset member which has been prepared for use as a schema.
virtual primitive_type dof_tuple_type(bool xis_table_dof) const
The type of table dofs (xis_table_dof == true) or row dofs (xis_table_dof == false) defined by this s...
virtual index_iterator indexed_member_iterator() const
An iterator for members of this poset; index version.
bool is_row_dof() const
True if this is in in the row_dofs part of some schema. Synonym for is_dof(false).
bool has_version(int xversion) const
True if xversion is a valid version for this.
void force(int i, bool value)
Sets the i-th member to value, extends the upper bound if necessary.
base_space_poset & base_space()
The base space for section spaces on this schema.
virtual const scoped_index & member_id(bool xauto_access) const
An id in the member hub id space; intended for copying to initialize ids to the member id space...
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
pod_index_type _base_space_id
The member id of the base space component of this.
pod_index_type base_space_id() const
The member id of the base space component of this.