21 #include "SheafSystem/homogeneous_block.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/array_index_space_state.h" 25 #include "SheafSystem/arg_list.h" 27 #include "SheafSystem/homogeneous_block_crg_interval.h" 28 #include "SheafSystem/index_space_handle.h" 29 #include "SheafSystem/index_space_iterator.h" 30 #include "SheafSystem/fiber_bundles_namespace.h" 31 #include "SheafSystem/poset_path.h" 32 #include "SheafSystem/preorder_iterator.h" 33 #include "SheafSystem/section_space_schema_member.h" 34 #include "SheafSystem/tern.h" 35 #include "SheafSystem/wsv_block.h" 56 require(!xhost_path.
empty());
59 require(xschema_path.
full());
63 require(xmax_db >= 0);
68 host_type::new_table(xns, xhost_path, xschema_path, xmax_db, xauto_access);
72 ensure(xns.
owns(result, xauto_access));
73 ensure(result.
path(
true) == xhost_path);
75 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
77 ensure(result.
max_db() == xmax_db);
94 require(!xhost_path.
empty());
98 require(xmax_db >= 0);
103 new_host(xns, xhost_path, standard_schema_path(), xmax_db, xauto_access);
107 ensure(xns.
owns(result, xauto_access));
108 ensure(result.
path(
true) == xhost_path);
110 ensure(result.
schema(
true).
path(xauto_access) == standard_schema_path());
112 ensure(result.
max_db() == xmax_db);
192 require(state_is_read_accessible());
216 require(state_is_read_accessible());
217 require(is_jim(
false));
238 require(state_is_read_accessible());
255 const std::string& xprototype_name,
256 const std::string& xlocal_cell_name,
263 require(!xprototype_name.empty());
265 require(!xlocal_cell_name.empty());
280 poset_path local_proto_path(prototypes_poset_name(), xlocal_cell_name);
288 ltuple.
db = local_proto.db();
290 local_proto.detach_from_state();
307 const std::string& xprototype_name,
308 const std::string& xlocal_cell_name,
316 require(!xprototype_name.empty());
318 require(!xlocal_cell_name.empty());
339 poset_path local_proto_path(prototypes_poset_name(), xlocal_cell_name);
345 ltuple->
db = local_proto.db();
348 ltuple->
size = xsize;
352 local_proto.detach_from_state();
381 ensure(! is_attached() );
390 require(state_is_read_accessible());
391 require(unexecutable(data members created));
403 ensure(!is_restricted());
423 require(state_is_read_accessible());
427 row_dof_tuple()->size = xsize;
431 ensure(size() == xsize);
453 require(state_is_auto_read_accessible(xauto_access));
466 ensure(is_basic_query);
479 require(state_is_auto_read_accessible(xauto_access));
480 require(contains_zone_id_space(xauto_access));
494 ensure(host()->member_id_spaces(xauto_access).allocated_id_space(result));
507 require(state_is_auto_read_accessible(xauto_access));
508 require(host()->member_id_spaces(xauto_access).allocated_id_space(xid_space));
534 require(state_is_auto_read_accessible(xauto_access));
535 require(contains_zone_id_space(xauto_access));
549 ensure(host()->member_id_spaces(xauto_access).allocated_id_space_iterator(result));
562 require(state_is_auto_read_accessible(xauto_access));
563 require(host()->member_id_spaces(xauto_access).allocated_id_space_iterator(xitr));
600 require(state_is_auto_read_accessible(xauto_access));
613 ensure(is_basic_query);
626 require(state_is_auto_read_accessible(xauto_access));
627 require(contains_vertex_id_space(xauto_access));
641 ensure(host()->member_id_spaces(xauto_access).allocated_id_space(result));
654 require(state_is_auto_read_accessible(xauto_access));
655 require(host()->member_id_spaces(xauto_access).allocated_id_space(xid_space));
681 require(state_is_auto_read_accessible(xauto_access));
682 require(contains_vertex_id_space(xauto_access));
696 ensure(host()->member_id_spaces(xauto_access).allocated_id_space_iterator(result));
709 require(state_is_auto_read_accessible(xauto_access));
710 require(host()->member_id_spaces(xauto_access).allocated_id_space_iterator(xitr));
747 require(state_is_auto_read_accessible(xauto_access));
748 require(local_id_space().contains_hub(xzone_id));
761 ensure(is_basic_query);
774 require(state_is_auto_read_accessible(xauto_access));
775 require(local_id_space().contains(xzone_id));
779 bool result = contains_connectivity_id_space(xzone_id.
hub_pod(), xauto_access);
783 ensure(is_basic_query);
796 require(state_is_auto_read_accessible(xauto_access));
797 require(local_id_space().contains_hub(xzone_id));
798 require(contains_connectivity_id_space(xzone_id, xauto_access));
812 ensure(host()->member_id_spaces(xauto_access).allocated_id_space(result));
825 require(state_is_auto_read_accessible(xauto_access));
826 require(local_id_space().contains(xzone_id));
827 require(contains_connectivity_id_space(xzone_id, xauto_access));
836 ensure(host()->member_id_spaces(xauto_access).allocated_id_space(result));
849 require(state_is_auto_read_accessible(xauto_access));
850 require(host()->member_id_spaces(xauto_access).allocated_id_space(xid_space));
876 require(state_is_auto_read_accessible(xauto_access));
877 require(local_id_space().contains_hub(xzone_id));
878 require(contains_connectivity_id_space(xzone_id, xauto_access));
892 ensure(host()->member_id_spaces(xauto_access).allocated_id_space_iterator(result));
905 require(state_is_auto_read_accessible(xauto_access));
906 require(local_id_space().contains_hub(xzone_id.
hub_pod()));
907 require(contains_connectivity_id_space(xzone_id, xauto_access));
916 ensure(host()->member_id_spaces(xauto_access).allocated_id_space_iterator(result));
929 require(state_is_auto_read_accessible(xauto_access));
930 require(host()->member_id_spaces(xauto_access).allocated_id_space_iterator(xitr));
967 require(state_is_auto_read_accessible(xauto_access));
968 require(local_id_space().contains_hub(xvertex_id));
981 ensure(is_basic_query);
994 require(state_is_auto_read_accessible(xauto_access));
995 require(local_id_space().contains(xvertex_id));
999 bool result = contains_adjacency_id_space(xvertex_id.
hub_pod(), xauto_access);
1003 ensure(is_basic_query);
1016 require(state_is_auto_read_accessible(xauto_access));
1017 require(local_id_space().contains_hub(xvertex_id));
1018 require(contains_adjacency_id_space(xvertex_id, xauto_access));
1032 ensure(host()->member_id_spaces(xauto_access).allocated_id_space(result));
1045 require(state_is_auto_read_accessible(xauto_access));
1046 require(local_id_space().contains(xvertex_id));
1047 require(contains_adjacency_id_space(xvertex_id, xauto_access));
1056 ensure(host()->member_id_spaces(xauto_access).allocated_id_space(result));
1069 require(state_is_auto_read_accessible(xauto_access));
1070 require(host()->member_id_spaces(xauto_access).allocated_id_space(xid_space));
1096 require(state_is_auto_read_accessible(xauto_access));
1097 require(local_id_space().contains_hub(xvertex_id));
1098 require(contains_adjacency_id_space(xvertex_id, xauto_access));
1112 ensure(host()->member_id_spaces(xauto_access).allocated_id_space_iterator(result));
1125 require(state_is_auto_read_accessible(xauto_access));
1126 require(local_id_space().contains(xvertex_id));
1127 require(contains_adjacency_id_space(xvertex_id, xauto_access));
1136 ensure(host()->member_id_spaces(xauto_access).allocated_id_space_iterator(result));
1149 require(state_is_auto_read_accessible(xauto_access));
1150 require(host()->member_id_spaces(xauto_access).allocated_id_space_iterator(xitr));
1226 if(invariant_check())
1230 disable_invariant_check();
1234 invariance(state_is_read_accessible() ? is_jim(
false) :
true);
1235 invariance(unexecutable(
"db() == local cell db"));
1240 enable_invariant_check();
1279 attach_to_state(&xother);
1283 ensure(is_same_state(&xother));
1297 require(is_ancestor_of(&xother));
1305 ensure(invariant());
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...
void release_vertex_id_space_iterator(index_space_iterator &xitr, bool xauto_access) const
Returns the iterator to the vertex id space, xitr to the pool of id space iterators.
virtual bool invariant() const
Class invariant.
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 ...
void release_zone_id_space_iterator(index_space_iterator &xitr, bool xauto_access) const
Returns the zone id space iterator xitr to the pool of iterators.
void release_adjacency_id_space_iterator(index_space_iterator &xid_space, bool xauto_access) const
Returns the id space iterator xid_space to the adjacency iterator pool.
bool full() const
True if both poset name and member name are not empty.
virtual const size_type & size() const
The number of local cell instances in this block.
An abstract iterator over the ids of an id space.
array_poset_dof_map * new_row_dof_map(const poset *xhost, const std::string &xprototype_name, const std::string &xlocal_cell_name, size_type xsize)
OBSOLETE: use scoped_index new_row_dof_map(poset_state_handle& ...) Creates a new row dof map and ini...
index_space_handle & get_zone_id_space(bool xauto_access) const
Allocates a handle from the pool of handles for the id space of zones in this block.
size_type size
The number of local cells.
virtual ~homogeneous_block()
Destructor; deletes a poset member and its attached state, if any.
poset_path path(bool xauto_access=true) const
A path to this component.
bool conforms_to(const schema_poset_member &xother) const
True if the dofs defined by this agree in type and in order with the dofs defined by xother...
int local_cell_type_id
The local cell type id.
index_space_iterator & get_vertex_id_space_iterator(pod_index_type xmbr_id, bool xauto_access) const
Allocates an vertex id space iterator for the block containing the member with index xmbr_id for the ...
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...
void release_vertex_id_space(index_space_handle &xid_space, bool xauto_access) const
Returns the handle to the vertex id space, xid_space to the pool of id space handles.
const char * local_cell_type_name
The local cell type name.
homogeneous_block()
Default constructor; creates a new, unattached homogeneous_block handle.
bool state_is_auto_read_accessible(bool xauto_access) const
True if the state is auto accessible for read, that is, if the state is already accessible for read o...
void release_adjacency_id_space(index_space_handle &xid_space, bool xauto_access) const
Returns the id space handle xid_space to the adjacency handle pool.
A client handle for a general, abstract partially order set.
void release_connectivity_id_space_iterator(index_space_iterator &xid_space, bool xauto_access) const
Returns the id space iterator xid_space to the connectivity iterator pool.
virtual void * dof_tuple()=0
The dof tuple (mutable version).
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
virtual void attach_handle_data_members()
Initializes handle data members when attaching to a different member of the same host; intended to be...
void release_zone_id_space(index_space_handle &xid_space, bool xauto_access) const
Returns the handle to the zone id space, xid_space to the pool of id space handles.
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.
void release_zone_id_space_iterator(index_space_iterator &xitr, bool xauto_access) const
Returns the iterator to the zone id space, xitr to the pool of id space iterators.
bool contains_vertex_id_space(bool xauto_access) const
True if and only if this block contains a vertex id space.
virtual bool is_attached() const =0
True if this handle is attached to a state.
bool contains_connectivity_id_space(pod_index_type xzone_id, bool xauto_access) const
True if this block contains the connectivity for a zone with id xzone_id.
An implementation of class sum_index_space_handle that has a primary sum id space state...
int db
The base space dimension.
const hub_index_space_handle & hub_id_space() const
The hub id space.
void release_zone_id_space(index_space_handle &xid_space, bool xauto_access) const
Returns the zone id space xid_space to the pool of handles.
index_space_handle & get_adjacency_id_space(pod_index_type xvertex_id, bool xauto_access) const
Allocates an id space handle from the adjacency handle pool attached to the adjacency id space state ...
A client handle for a member of a base space poset.
const pod_index_type & local_cell_type_id() const
The type id of the prototype for the local cell; the id of the local cell prototype in the id space "...
void put_size(const size_type &xsize)
Sets the number of local cell instances in this block.
bool contains_vertex_id_space(pod_index_type xmbr_id, bool xauto_access) const
True, if and only if the block containing the member with index xmbr_id has a vertex id space...
const index_space_handle & local_id_space() const
The id space for the members of this block, including the block itself.
index_space_iterator & get_connectivity_id_space_iterator(pod_index_type xzone_id, bool xauto_access) const
Allocates an id space iterator from the connectivity iterator pool attached to the connectivity id sp...
Abstract base class with useful features for all objects.
The lattice of closed cells of a cellular space; a lattice representation of a computational mesh...
index_space_iterator & get_zone_id_space_iterator(bool xauto_access) const
Allocates a zone id space iterator from the pool of iterators.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
void release_connectivity_id_space_iterator(index_space_iterator &xid_space, bool xauto_access) const
Returns the id space iterator xid_space to the connectivity iterator pool.
Emulator for a interval of implicit base space members representing a homogeneous collection of cells...
A client handle for a mutable partially ordered set.
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)
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.
bool contains_adjacency_id_space(pod_index_type xvertex_id, bool xauto_access) const
True if this block contains the adjacency for a vertex with id xvertex_id.
void release_adjacency_id_space_iterator(index_space_iterator &xid_space, bool xauto_access) const
Returns the id space iterator xid_space to the adjacency iterator pool.
virtual void get_read_access() const
Get read access to the state associated with this.
virtual bool is_ancestor_of(const any *other) const
True if other conforms to this.
index_space_iterator & get_adjacency_id_space_iterator(pod_index_type xvertex_id, bool xauto_access) const
Allocates an id space iterator from the adjacency iterator pool attached to the adjacency id space st...
index_space_handle & get_connectivity_id_space(pod_index_type xzone_id, bool xauto_access) const
Allocates an id space handle from the connectivity handle pool attached to the connectivity id space ...
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
static array_poset_dof_map * new_row_dof_map(const poset *xhost, const std::string &xprototype_name)
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
void release_vertex_id_space_iterator(index_space_iterator &xitr, bool xauto_access) const
Returns the vertex id space iterator xitr to the pool of iterators.
index_space_iterator & get_zone_id_space_iterator(pod_index_type xmbr_id, bool xauto_access) const
Allocates an zone id space iterator for the block containing the member with index xmbr_id for the po...
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. ...
A client handle for a base space member which represents a homgeneous collection of local cells...
void release_connectivity_id_space(index_space_handle &xid_space, bool xauto_access) const
Returns the id space handle xid_space to the connectivity handle pool.
bool empty() const
True if both poset name and member name are empty.
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 hub_index_space_handle & hub_id_space() const
The hub id space of this block.
bool contains_zone_id_space(pod_index_type xmbr_id, bool xauto_access) const
True, if and only if the block containing the member with index xmbr_id has a zone id space...
index_space_handle & get_vertex_id_space(pod_index_type xmbr_id, bool xauto_access) const
Allocates an vertex id space handle for the block containing the member with index xmbr_id for the po...
index_space_handle & get_connectivity_id_space(pod_index_type xzone_id, bool xauto_access) const
Allocates an id space handle from the connectivity handle pool attached to the connectivity id space ...
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, int xmax_db, bool xauto_access)
Creates a new host poset for members of this type. The poset is created in namespace xns with path xh...
bool contains_adjacency_id_space(pod_index_type xvertex_id, bool xauto_access) const
True if this poset contains the adjacency for a vertex with id xvertex_id.
virtual const homogeneous_block_crg_interval & interval() const
The implicit interval member for this block.
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.
namespace_poset * name_space() const
The namespace this poset resides in.
virtual bool is_attached() const =0
True if this iterator is attached to a state.
void release_vertex_id_space(index_space_handle &xid_space, bool xauto_access) const
Returns the vertex id space handle xid_space to the pool of handles.
int_type pod_index_type
The plain old data index type.
const char * local_cell_type_name() const
The type name of the prototype for the local cell.
index_space_iterator & get_connectivity_id_space_iterator(pod_index_type xzone_id, bool xauto_access) const
Allocates an id space iterator from the connectivity iterator pool attached to the connectivity id sp...
virtual bool invariant() const
Class invariant.
void release_adjacency_id_space(index_space_handle &xid_space, bool xauto_access) const
Returns the id space handle xid_space to the adjacency handle pool.
void release_connectivity_id_space(index_space_handle &xid_space, bool xauto_access) const
Returns the id space handle xid_space to the connectivity handle pool.
index_space_handle & get_vertex_id_space(bool xauto_access) const
Allocates a handle from the pool of handles for the id space of vertices in this block.
bool contains_connectivity_id_space(pod_index_type xzone_id, bool xauto_access) const
True if this poset contains the connectivity for a zone with id xzone_id.
index_space_iterator & get_adjacency_id_space_iterator(pod_index_type xvertex_id, bool xauto_access) const
Allocates an id space iterator from the adjacency iterator pool attached to the adjacency id space st...
virtual void get_read_access() const
Get read access to the state associated with this.
int max_db() const
The maximum dimension of the members of this base space.
An abstract client handle for a member of a poset.
virtual homogeneous_block & operator=(const abstract_poset_member &xother)
Assignment operator; attaches this to the same state as xother.
index_space_iterator & get_vertex_id_space_iterator(bool xauto_access) const
Allocates a vertex id space iterator from the pool of iterators.
The type of row dof tuple for base_space_member.
An array representation of abstract class poset_dof_map.
bool contains_zone_id_space(bool xauto_access) const
True if and only if this block contains a zone id space.
Namespace for the fiber_bundles component of the sheaf system.
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 void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
row_dof_tuple_type * row_dof_tuple(bool xrequire_write_access=false)
The row dof tuple for this.
index_space_handle & get_adjacency_id_space(pod_index_type xvertex_id, bool xauto_access) const
Allocates an id space handle from the adjacency handle pool attached to the adjacency id space state ...
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
index_space_handle & get_zone_id_space(pod_index_type xmbr_id, bool xauto_access) const
Allocates an zone id space handle for the block containing the member with index xmbr_id from the poo...