21 #include "SheafSystem/point_block_1d.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/point_block_crg_interval.h" 30 #include "SheafSystem/poset_path.h" 31 #include "SheafSystem/preorder_iterator.h" 32 #include "SheafSystem/tern.h" 33 #include "SheafSystem/wsv_block.h" 75 require(!xhost_path.
empty());
78 require(xschema_path.
full());
85 host_type::new_table(xns, xhost_path, xschema_path, 0, xauto_access);
89 ensure(xns.
owns(result, xauto_access));
90 ensure(result.
path(
true) == xhost_path);
92 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
94 ensure(result.
max_db() == 0);
126 result_ptr = &new_host(xns, xhost_path, standard_schema_path(), xauto_access);
133 ensure(xns.
owns(result, xauto_access));
134 ensure(result.
path(
true) == xhost_path);
136 ensure(result.
schema(
true).
path(xauto_access) == standard_schema_path());
138 ensure(result.
max_db() == 0);
167 ensure(!is_attached());
181 new_jem_state(const_cast<abstract_poset_member*>(&xother),
true,
true);
185 attach_to_state(&xother);
213 require(precondition_of(new_state(same args)));
217 new_state(xhost, xi_size, xauto_access);
221 ensure(postcondition_of(new_state(same args)));
235 require(precondition_of(attach_to_state(xhost, xhub_id)));
239 attach_to_state(xhost, xhub_id);
243 ensure(postcondition_of(attach_to_state(xhost, xhub_id)));
251 require(precondition_of(attach_to_state(xhost, xid)));
255 attach_to_state(xhost, xid.
hub_pod());
259 ensure(postcondition_of(attach_to_state(xhost, xid)));
267 require(precondition_of(attach_to_state(same args)));
271 attach_to_state(xhost, xname);
275 ensure(postcondition_of(attach_to_state(same args)));
287 require(precondition_of(attach_to_state(same args)));
291 attach_to_state(xnamespace, xpath, xauto_access);
295 ensure(postcondition_of(attach_to_state(same args)));
311 require(precondition_of(attach_to_state(same args)));
315 attach_to_state(xnamespace, xposet_id, xmember_id);
319 ensure(postcondition_of(attach_to_state(same args)));
335 require(precondition_of(attach_to_state(same args)));
339 attach_to_state(xnamespace, xposet_id.
hub_pod(), xmember_id.
hub_pod());
343 ensure(postcondition_of(attach_to_state(same args)));
358 require(precondition_of(new_state(host(), xi_size, xauto_access)));
362 new_state(host(), xi_size, xauto_access);
366 ensure(postcondition_of(new_state(host(), xi_size, xauto_access)));
395 require(namespace_is_ancestor_of(xhost->
name_space()));
400 require(dynamic_cast<base_space_poset*>(xhost) != 0);
402 require(xi_size > 0);
428 attach_to_state(xhost, lindex);
444 ensure(host() == xhost);
445 ensure(is_attached());
447 ensure(prototype_path() == static_prototype_path());
448 ensure(local_cell_type_name() ==
449 static_local_cell_prototype_path().member_name());
450 ensure(i_size() == xi_size);
478 require(state_is_read_accessible());
498 require(state_is_read_accessible());
502 row_dof_tuple()->i_size = xi_size;
506 ensure(i_size() == xi_size);
527 require(xi_size > 0);
545 new_row_dof_map(xhost,
546 static_prototype_path().member_name(),
547 static_local_cell_prototype_path().member_name(),
683 if(invariant_check())
687 disable_invariant_check();
691 invariance(state_is_read_accessible() ? is_jim(
false) :
true);
692 invariance(state_is_read_accessible() ? size() == i_size() :
true);
696 enable_invariant_check();
733 attach_to_state(&xother);
737 ensure(is_same_state(&xother));
751 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 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 ...
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.
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...
void update_max_db(int xmax_db)
Sets max_db() to the larger of old max_db() and xmax_db.
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 point_block_1d & operator=(const abstract_poset_member &xother)
Assignment operator; attaches this to the same state as xother.
point_block_1d()
Default constructor; creates a new, unattached point_block_1d handle.
virtual void * dof_tuple()=0
The dof tuple (mutable version).
static const poset_path & static_prototype_path()
The path of the prototype required by this class.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
virtual point_block_1d * clone() const
Make a new handle, no state instance of current.
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.
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...
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 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)
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 non-void state.
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.
const size_type & i_size() const
The number of vertices in this block;.
virtual bool invariant() const
Class invariant.
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...
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...
void put_i_size(const size_type &xi_size)
Sets i_size() to xi_size.
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.
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 const poset_path & static_local_cell_prototype_path()
The path of the local cell prototype required by this class.
int_type pod_index_type
The plain old data index type.
std::string member_name() const
The member name part of the path.
static scoped_index new_row_dof_map(poset_state_handle &xhost, size_type xi_size, bool xauto_access)
Creates a new row dof map and initializes it.
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...
A homogeneous collection of i_size() disconnected points; similar to a structured_block_1d, but without the segments.
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...
virtual bool is_ancestor_of(const any *other) const
True if other conforms to this.
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_1d()
Destructor; deletes a poset member and its attached state, if any.
void new_state(const size_type &xi_size, bool xauto_access=true)
Creates a new point_block_1d state in host() with i_size() == xi_size and attaches this to it...
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.