21 #include "SheafSystem/point_block_2d.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/arg_list.h" 26 #include "SheafSystem/chart_point_3d.h" 27 #include "SheafSystem/fiber_bundles_namespace.h" 28 #include "SheafSystem/namespace_poset.h" 29 #include "SheafSystem/poset_path.h" 30 #include "SheafSystem/preorder_iterator.h" 31 #include "SheafSystem/point_block_crg_interval.h" 32 #include "SheafSystem/tern.h" 33 #include "SheafSystem/wsv_block.h" 55 const poset_path& result = STATIC_PROTOTYPE_PATH;
77 require(!xhost_path.
empty());
80 require(xschema_path.
full());
87 host_type::new_table(xns, xhost_path, xschema_path, 0, xauto_access);
91 ensure(xns.
owns(result, xauto_access));
92 ensure(result.
path(
true) == xhost_path);
94 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
96 ensure(result.
max_db() == 0);
128 result_ptr = &new_host(xns, xhost_path, standard_schema_path(), xauto_access);
135 ensure(xns.
owns(result, xauto_access));
136 ensure(result.
path(
true) == xhost_path);
138 ensure(result.
schema(
true).
path(xauto_access) == standard_schema_path());
140 ensure(result.
max_db() == 0);
169 ensure(!is_attached());
183 new_jem_state(const_cast<abstract_poset_member*>(&xother),
true,
true);
187 attach_to_state(&xother);
218 require(precondition_of(new_state(same args)));
222 new_state(xhost, xi_size, xj_size, xauto_access);
226 ensure(postcondition_of(new_state(same args)));
240 require(precondition_of(attach_to_state(xhost, xhub_id)));
244 attach_to_state(xhost, xhub_id);
248 ensure(postcondition_of(attach_to_state(xhost, xhub_id)));
256 require(precondition_of(attach_to_state(xhost, xid)));
260 attach_to_state(xhost, xid.
hub_pod());
264 ensure(postcondition_of(attach_to_state(xhost, xid)));
272 require(precondition_of(attach_to_state(same args)));
276 attach_to_state(xhost, xname);
280 ensure(postcondition_of(attach_to_state(same args)));
292 require(precondition_of(attach_to_state(same args)));
296 attach_to_state(xnamespace, xpath, xauto_access);
300 ensure(postcondition_of(attach_to_state(same args)));
316 require(precondition_of(attach_to_state(same args)));
320 attach_to_state(xnamespace, xposet_id, xmember_id);
324 ensure(postcondition_of(attach_to_state(same args)));
340 require(precondition_of(attach_to_state(same args)));
344 attach_to_state(xnamespace, xposet_id.
hub_pod(), xmember_id.
hub_pod());
348 ensure(postcondition_of(attach_to_state(same args)));
365 require(precondition_of(new_state(host(), xi_size, xj_size, xauto_access)));
369 new_state(host(), xi_size, xj_size, xauto_access);
373 ensure(postcondition_of(new_state(host(), xi_size, xj_size, xauto_access)));
405 require(namespace_is_ancestor_of(xhost->
name_space()));
410 require(dynamic_cast<base_space_poset*>(xhost) != 0);
414 require(xi_size > 1);
415 require(xj_size > 1);
441 attach_to_state(xhost, lindex);
451 ensure(host() == xhost);
452 ensure(is_attached());
454 ensure(prototype_path() == static_prototype_path());
455 ensure(local_cell_type_name() ==
456 static_local_cell_prototype_path().member_name());
457 ensure(i_size() == xi_size);
458 ensure(j_size() == xj_size);
486 require(state_is_read_accessible());
506 require(state_is_read_accessible());
510 row_dof_tuple()->i_size = xsize;
514 ensure(i_size() == xsize);
527 require(state_is_read_accessible());
547 require(state_is_read_accessible());
551 row_dof_tuple()->j_size = xsize;
555 ensure(j_size() == xsize);
576 require(xi_size > 0);
577 require(xj_size > 0);
595 new_row_dof_map(xhost,
596 static_prototype_path().member_name(),
597 static_local_cell_prototype_path().member_name(),
735 if(invariant_check())
739 disable_invariant_check();
743 invariance(state_is_read_accessible() ? is_jim(
false) :
true);
744 invariance(state_is_read_accessible() ? size() == (i_size()*j_size()) :
true);
748 enable_invariant_check();
785 attach_to_state(&xother);
789 ensure(is_same_state(&xother));
803 require(is_ancestor_of(&xother));
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...
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_ancestor_of(const any *other) const
True if other conforms to this.
void new_state(const size_type &xi_size, const size_type &xj_size, bool xauto_access=true)
Creates a new point_block_2d state in host() with i_size() == xi_size and j_size() == xj_size and att...
bool path_is_auto_read_write_available(const poset_path &xpath, bool xauto_access) const
True if the state referred to xpath does not exist or exists and is auto read-write accessible...
virtual void create_cover_link(abstract_poset_member *xlesser)
Insert a link from this to lesser; make lesser <= this.
bool full() const
True if both poset name and member name are not empty.
abstract_poset_member & top()
The top member of the poset (mutable version)
static void get_dof_tuple_ids(poset_state_handle &xhost, size_type xi_size, block< pod_index_type > &result)
The dof tuple ids for an instance created with parameter xi_size.
virtual point_block_2d & operator=(const abstract_poset_member &xother)
Assignment operator; attaches this to the same state as xother.
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...
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...
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.
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, bool xauto_access)
Creates a new host poset for members of this type. The poset is created in namespace xns with path xh...
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".
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.
static void get_private_data(size_type xi_size, block< pod_index_type > &result)
The private data for an instance with parameter xi_size.
static const std::string & prototypes_poset_name()
The name of the prototypes poset.
const size_type & j_size() const
The upper bound for index_1; the number of "vertices" in the 1-th direction in the conceptual array t...
virtual ~point_block_2d()
Destructor; deletes a poset member and its attached state, if any.
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...
virtual bool invariant() const
Class invariant.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
size_type i_size
The upper bound on the x direction index for structured blocks.
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)
A homogeneous collection of i_size() * j_size() disconnected points similar to a structured_block_2d...
static const poset_path & static_local_cell_prototype_path()
The path of the local cell prototype required by this class.
An index within the external ("client") scope of a given id space.
static const poset_path & static_prototype_path()
The path of the prototype required by this class.
virtual bool is_attached() const
True if this handle is attached to a non-void state.
point_block_2d()
Default constructor; creates a new, unattached point_block_2d handle.
virtual void get_read_access() const
Get read access to the state associated with this.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
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.
void put_i_size(const size_type &xsize)
Sets i_size() to xsize.
void put_j_size(const size_type &xsize)
Sets j_size() to xsize.
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...
size_type j_size
The upper bound on the y direction index for structured blocks.
static host_type & standard_host(namespace_type &xns, const poset_path &xhost_path, bool xauto_access)
The host with path xhost_path. Returns the host if it already exists, otherwise, creates it in namesp...
bool poset_state_is_read_accessible(const poset_path &xpath, bool xauto_access=true) const
True if the poset referred to by xpath is read accessible.
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
True if this is attached to a state.
const size_type & i_size() const
The upper bound for index_0; the number of "vertices" in the 0-th direction in the conceptual array t...
static void get_size(size_type xi_size, size_type &result)
The size for an instance created with parameters xi_size, xj_size, xk_size.
static scoped_index new_row_dof_map(poset_state_handle &xhost, size_type xi_size, size_type xj_size, bool xauto_access)
Creates a new row dof map and initializes it.
int_type pod_index_type
The plain old data index type.
std::string member_name() const
The member name part of the path.
virtual bool invariant() const
Class invariant.
virtual void end_jim_edit_mode(bool xensure_lattice_invariant=true, bool xauto_access=true)
Prevent editing of jims and jim order relation.
virtual pod_index_type new_member_interval(const std::string &xinterval_type, size_type xsize, const block< pod_index_type > &xtuple_hub_ids, const block< pod_index_type > &xdata)
Create a disconnected member interval of type xinterval_type with size xsize, dof tuple ids xtuple_hu...
static bool is_valid_name(const std::string &xname)
True if xname is not empty and contains only name legal characters.
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.
bool row_conforms_to(const schema_poset_member &xother) const
True if the row dofs defined by this agree in type and in order with the dofs defined by xother...
The type of row dof tuple for base_space_member.
bool in_jim_edit_mode() const
True if editing jims and jim order relation is allowed.
Namespace for the fiber_bundles component of the sheaf system.
virtual point_block_2d * clone() const
Make a new handle, no state instance of current.
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.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
virtual void begin_jim_edit_mode(bool xauto_access=true)
Allow editing of jims and jim order relation.