21 #include "SheafSystem/product_section_space_schema_poset.h" 23 #include "SheafSystem/abstract_poset_member.impl.h" 24 #include "SheafSystem/arg_list.h" 25 #include "SheafSystem/array_poset_dof_map.h" 26 #include "SheafSystem/ij_product_structure.h" 27 #include "SheafSystem/index_iterator.h" 28 #include "SheafSystem/list_cover_set.h" 29 #include "SheafSystem/error_message.h" 30 #include "SheafSystem/index_space_iterator.h" 31 #include "SheafSystem/namespace_poset.impl.h" 32 #include "SheafSystem/namespace_poset_member.h" 33 #include "SheafSystem/pod_types.h" 34 #include "SheafSystem/poset_handle_factory.h" 35 #include "SheafSystem/poset_member_iterator.h" 36 #include "SheafSystem/poset_state.h" 37 #include "SheafSystem/product_section_space_schema_crg_range.h" 38 #include "SheafSystem/product_section_space_schema_member.impl.h" 39 #include "SheafSystem/schema_descriptor.h" 40 #include "SheafSystem/section_space_schema_table_dofs_type.h" 41 #include "SheafSystem/section_space_schema_table_dof_crg_range.h" 42 #include "SheafSystem/std_limits.h" 43 #include "SheafSystem/wsv_block.h" 67 result <<
"rep_path" << xrep_path
68 <<
"base_space_path" << xbase_space_path
69 <<
"fiber_space_path" << xfiber_space_path;
72 #ifdef DIAGNOSTIC_OUTPUT 73 cout <<
"product_section_space_schema_poset::make_arg_list:result: " << result << endl;
78 ensure(unexecutable(
"result.conforms_to(schema of this class)"));
79 ensure(result.
value(
"rep_path") == xrep_path);
80 ensure(result.
value(
"base_space_path") == xbase_space_path);
81 ensure(result.
value(
"fiber_space_path") == xfiber_space_path);
90 const std::string& xname,
101 require(precondition_of(
new_state(same args)));
107 new_state(xns, xname, xargs, xschema_path, xauto_access);
111 ensure(postcondition_of(
new_state(same args)));
173 const std::string& xname,
182 require(!xschema_path.
empty());
186 require(xns.arg_is_auto_read_accessible(
"rep_path", xargs, xauto_access));
187 require(xns.arg_is_auto_read_accessible(
"base_space_path", xargs, xauto_access));
188 require(xns.arg_is_auto_read_accessible(
"fiber_space_path", xargs, xauto_access));
196 #ifdef DIAGNOSTIC_OUTPUT 197 cout <<
"product_section_space_schema_poset::initialize_arg_list:xargs: " << endl
220 ensure(is_basic_query);
289 ensure(is_basic_query);
323 ensure(is_basic_query);
355 poset_type ltype = PRODUCT_SECTION_SPACE_SCHEMA_POSET_ID;
392 ensure(result.
full());
422 lschema.detach_from_state();
508 ensure(is_basic_query);
519 bool xauto_access)
const 533 ensure(is_basic_query);
591 return PRODUCT_SECTION_SPACE_SCHEMA_POSET_ID;
602 static const char* result =
"product_section_space_schema_poset";
616 const std::string& xname,
634 require(unexecutable(xname != xns.
name()));
639 require(xargs.
conforms_to(xns, xschema_path,
true, xauto_access));
641 require(xns.arg_is_auto_read_accessible(
"rep_path", xargs, xauto_access));
642 require(xns.arg_is_auto_read_accessible(
"base_space_path", xargs, xauto_access));
643 require(xns.arg_is_auto_read_accessible(
"fiber_space_path", xargs, xauto_access));
740 ensure(
name() == xname);
796 require(unexecutable(
"rep in xdof_map exists"));
797 require(unexecutable(
"rep in xdof_map is read accessible"));
799 require(unexecutable(
"base space in xdof_map exists"));
800 require(unexecutable(
"base space in xdof_map is read accessible"));
802 require(unexecutable(
"fiber space in xdof_map exists"));
803 require(unexecutable(
"fiber space in xdof_map is read accessible"));
805 require(unexecutable(
"rep in xdof_map is valid for base and fiber in xdof_map"));
1109 tuple(xindex, lbase_space_id, lfiber_schema_id);
1111 if(lbase_space_id == BOTTOM_INDEX)
1164 tuple(xindex, lbase_id, lfiber_id);
1168 if( (lbase_id == BOTTOM_INDEX) &&
1174 result = lfiber_name;
1183 if(!lbase_name.empty() || !lfiber_name.empty())
1185 result = lbase_name +
'_' + lfiber_name;
1244 lprivate_data[0] = 0;
1245 lprivate_data[1] = 0;
1250 lrange_id = poset_state_handle::new_member_range(
"section_space_schema_table_dof_crg_range", lrange_size);
1256 lrange_id = poset_state_handle::new_member_range(
"product_section_space_schema_crg_range", lrange_size);
1430 ordinal(lbase_id, lfiber_id, lint_id);
1438 ensure(result != 0);
1512 ensure(result != 0);
1548 #ifndef DOXYGEN_SKIP_INSTANTIATIONS 1553 sheaf::namespace_poset::
1554 member_poset<fiber_bundle::product_section_space_schema_poset>(
const poset_path& xpath,
bool xauto_access)
const;
1559 sheaf::namespace_poset::
1560 contains_poset<fiber_bundle::product_section_space_schema_poset>(
const poset_path& xpath,
bool xauto_access)
const;
1565 sheaf::namespace_poset::
1566 contains_path<fiber_bundle::product_section_space_schema_poset>(
const poset_path& xpath,
bool xauto_access)
const;
1571 sheaf::namespace_poset::
1572 path_is_auto_read_accessible<fiber_bundle::product_section_space_schema_poset>(
const poset_path& xpath,
bool xauto_access)
const;
1577 sheaf::namespace_poset::
1578 path_is_auto_read_available<fiber_bundle::product_section_space_schema_poset>(
const poset_path& xpath,
bool xauto_access)
const;
1583 sheaf::namespace_poset::
1584 path_is_auto_read_write_accessible<fiber_bundle::product_section_space_schema_poset>(
const poset_path& xpath,
bool xauto_access)
const;
1589 sheaf::namespace_poset::
1590 path_is_auto_read_write_available<fiber_bundle::product_section_space_schema_poset>(
const poset_path& xpath,
bool xauto_access)
const;
1592 #endif // ifndef DOXYGEN_SKIP_INSTANTIATIONS 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.
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 insert_prototype(const poset_state_handle *xprototype)
Sets xprototype as the prototype for its client class.
void extend_last_member_term(size_type xct, bool xauto_access)
Extends the last term of the member hub id space to ct == xct.
static bool rep_is_valid(const sec_rep_descriptor &xrep, const poset_state_handle &xbase_space)
True if the discretization and evaluation subposets named in xrep are included in xbase_space and the...
int df() const
The dimension of the fiber space.
static void get_size(const product_section_space_schema_poset &xhost, size_type &result)
The size for an instance created with parameter xhost.
void initialize_table_dof_subposet()
Create the table dof members with the same ids as the table dofs in the fiber schema id space and ini...
bool has_standard_member_ct() const
True if poset is in its initial state, that is, it contains just the standard members.
bool full() const
True if both poset name and member name are not empty.
virtual pod_index_type new_member(bool xis_jim, pod_index_type xdof_tuple_id)
Create a disconnected member with is_jim == xis_jim. Redefined here only to trap attempts to make a n...
static void get_size(const product_section_space_schema_poset &xhost, size_type &result)
The size for an instance created with parameter xhost.
The private state of a partially ordered set.
An abstract iterator over the ids of an id space.
virtual product_section_space_schema_poset * clone() const
Virtual constructor; creates a new handle of the same actual type as this, attached to the same state...
virtual void new_link(pod_index_type xgreater, pod_index_type xlesser)
Insert a link from lesser to greater (i.e. lesser <= greater). Redefined here only to trap attempts t...
virtual bool contains_member(pod_index_type xbase_space_id, pod_index_type xfiber_schema_id) const
True if this range contains the member with base space id xbase_space_id and fiber schema id xfiber_s...
const scoped_index & index() const
The member index of this poset within the namespace host()
implicit_crg_interval * implicit_member(pod_index_type xid) const
The implicit interval for the member with index xid. Returns null, if no implicit interval exists...
virtual void tuple(pod_index_type xindex, pod_index_type &xbase_space_id, pod_index_type &xfiber_schema_id) const
The tuple conversion from section space schema id xindex to the base space id xbase_space_id and fibe...
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
void initialize_table_dof_tuple(array_poset_dof_map *xdof_tuple)
Installs xdof_tuple as the table dof tuple.
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.
poset_type
Identifiers for poset types.
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 schema_poset_member & schema()
The schema on which this is allocated (mutable version).
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...
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...
A client handle for a general, abstract partially order set.
virtual void finalize(poset_state_handle &xhost)
Finialize the initialization of this crg range in the host xhost.
static const std::string & standard_schema_poset_name()
The name of the standard schema poset for this class.
virtual string member_name(pod_index_type xindex, bool xauto_access=false) const
The name of the member with index xindex.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
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()).
subposet & discretization()
The discretization subposet for section spaces on this schema.
virtual void get_read_access() const
Get read access to the state associated with this.
virtual bool contains_member(pod_index_type xbase_space_id, pod_index_type xfiber_schema_id) const
True if this range contains the member with base space id xbase_space_id and fiber schema id xfiber_s...
void put_standard_row_dof_tuple_ct(int xct)
Sets the number of standard row dof tuples automatically allocated by the constructor.
virtual bool contains_member(pod_index_type xmbr_hub_id) const
True if this poset contains poset member with hub id xmbr_hub_id.
void update_product_structure()
Update teh product structure of the local id space.
abstract_poset_member * _top
Top member of poset.
void reserve(index_type xub)
Makes ub() at least xub; if new storage is allocated, it is uninitialized.
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.
int db() const
The dimension of the base space.
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...
static bool make_prototype()
Creates prototype for this class and enters in in factory.
std::string row_dof_subposet_name() const
The standard name for the row dof subposet associated with this schema member. Synonym for dof_subpos...
virtual void get_read_access() const
Get read access to the state associated with this.
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 const char * class_name() const
The name of this class.
virtual void next()=0
Makes id() the next id in the iteration.
virtual void ordinal(pod_index_type xbase_space_id, pod_index_type xfiber_schema_id, pod_index_type &xindex) const
The ordinal conversion from base space id xbase_space_id and fiber schema id xfiber_schema_id to sect...
virtual index_space_iterator & get_iterator() const
Allocates an id space iterator from the iterator pool.
abstract_poset_member * _bottom
Bottom members of poset.
An schema poset for a section space represented by a Cartesian product subspace of the tensor product...
void new_state(namespace_poset &xhost, const std::string &xname, const arg_list &xargs, const poset_path &xschema_path, bool xauto_access)
Attaches this to a new poset state in namespace xhost, schema specified by xschema_path, name xname, and table dofs initialized by xargs.
virtual bool is_ancestor_of(const any *other) const
True if other conforms to this.
virtual void reset()=0
Restarts the iteration.
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...
virtual bool invariant() const
Class invariant.
product_section_space_schema_poset & operator=(const poset_state_handle &xother)
Assignment operator; attaches this to the same state as xother.
Abstract base class with useful features for all objects.
product_section_space_schema_member & bottom()
The bottom of member of the lattice (mutable version)
poset & fiber_space()
The fiber space for section spaces on this schema.
A whitespace separated list of arguments. Insertion operaters are used to insert arguments into the l...
virtual void put_name(const std::string &xname, bool xunique, bool xauto_access)
Make xname a name for this; if xunique, make xname the only name.
virtual void initialize_namespace(namespace_poset &xns, const std::string &xposet_name, bool xauto_link=true)
Installs this as a member of xns. If xauto_link, automatically links the member into an appropriate g...
bool conforms_to(const poset_path &xother, bool xauto_access) const
True if the schema member this refers to conforms to the schema member xother refers to in the curren...
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).
virtual bool is_homogeneous(pod_index_type xindex) const
True if xindex is in the homogeneous member id space.
Abstract emulator for a range of implicit section space schema members.
bool is_done() const
True if iteration is finished.
virtual void ordinal(pod_index_type xbase_space_id, pod_index_type xfiber_schema_id, pod_index_type &xindex) const
The ordinal conversion from base space id xbase_space_id and fiber schema id xfiber_schema_id to sect...
subposet & row_dof_subposet()
The row dof subposet when this poset is used as a schema (mutable version).
virtual void finalize(poset_state_handle &xhost)
Finialize the initialization of this crg range in the host xhost.
void initialize_row_dof_subposet()
Initialize the row dof subposet to the product of the row dof ids in the base space and the row dof i...
void update_standard_member_id_spaces()
Update the initially allocated id spaces.
bool is_external() const
True if this has a corresponding member in a name space, but is not yet 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...
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.
primitive_value & value(int xi)
The value of the xi-th argument.
virtual void detach_from_state()
Detach this handle from its state, if any.
void set_ct(size_type xct)
Sets ct() == xct.
virtual bool is_attached() const
True if this handle is attached to a non-void state.
product_section_space_schema_member & top()
The top of member of the lattice (mutable version)
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.
virtual void insert_member(pod_index_type xmbr_hub_id)
Inserts the member of host() with hub id xmbr_hub_id.
size_type row_dof_tuple_ct() const
The number of row_dof_tuples of this poset.
virtual bool invariant() const
Class invariant.
product_section_space_schema_crg_range & product_range()
The implicit crg range that represents the product members of this poset.
sec_rep_descriptor & rep()
The representation for section spaces on this schema.
virtual std::string member_name(pod_index_type xmbr_hub_id, bool xauto_access=false) const
A name for the member with hub id xmbr_hub_id.
virtual void initialize_handle_data_members(const namespace_poset &xns)
Initializes the handle data members that depend on the table dofs and are required to get access when...
virtual void put_name(const std::string &xname, bool xunique, bool xauto_access)
Make xname a name for this; if xunique, make xname the only name.
void put_standard_member_ct(int xct)
Sets the number of standard members automatically allocated by the constructor.
section_space_schema_table_dof_crg_range & table_dof_range()
The implicit crg range that represents the table dof members of this poset.
void put_product_range(product_section_space_schema_crg_range &xproduct_range)
Set the product range.
virtual std::string name() const
The name of this poset.
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...
const ij_product_structure & product_structure() const
The product structure of the local id space,.
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 ij_product_structure & product_structure() const
The product structure of this poset.
virtual void tuple(pod_index_type xindex, pod_index_type &xbase_space_id, pod_index_type &xfiber_schema_id) const
The tuple conversion from section space schema id xindex to the base space id xbase_space_id and fibe...
bool contains_poset(pod_index_type xhub_id, bool xauto_access=true) const
True if this contains a poset with hub id xhub_id..
virtual void update_hub_id_space(bool xauto_access)
Extends the hub id space to match extension of the base space.
const scattered_insertion_index_space_handle & id_space() const
The id space for the members of with this (const version).
static poset_handle_factory & factory()
The poset handle factory.
virtual bool contains_range_member(pod_index_type xbase_space_id, pod_index_type xfiber_schema_id, bool xauto_access) const
True if this poset contains a member with base space id xbase_space_id and fiber schema id xfiber_sch...
virtual int member_ct() const
The number of members of this poset.
namespace_poset * name_space() const
The namespace this poset resides in.
virtual bool is_attached() const
True if this is attached to a state.
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. ...
bool conforms_to(const namespace_poset &xns, const poset_path &xschema_path, bool xuse_table_schema, bool xauto_access) const
True if the values in this conform to the table schema (xuse_table_schema true) or row schema (xuse_t...
section_space_schema_poset & operator=(const poset_state_handle &xother)
Assignment operator; disabled.
product_section_space_schema_crg_range * _product_range
The implicit crg range that represents the product members of this poset.
virtual void put_dof_tuple(const void *xbuf, size_t xbuflen)
Copies the entire dof tuple from xbuf into internal storage.
poset_state * _state
State object for this poset.
An abstract schema poset for a section space. A Cartesian product subspace of the tensor product of a...
poset_crg_state & crg() const
The cover relation graph.
product_section_space_schema_poset()
Default constructor; creates a new product_section_space_schema_poset handle not attached to any stat...
bool invariant_check() const
True if invariant checking is enabled.
virtual std::string name() const
The name of this poset.
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...
poset_state_handle & fiber_schema()
The fiber schema for section spaces on this schema (mutable version).
static void make_standard_schema(namespace_poset &xns)
Creates standard schema for this class in namespace xns.
Emulator for a range of implicit section space schema members representing the Cartesian product the ...
subposet & table_dof_subposet()
The table dof subposet when this poset is used as a schema (mutable version).
virtual void initialize_arg_list(const namespace_poset &xns, const std::string &xname, arg_list &xargs, const poset_path &xschema_path, bool xauto_access)
Initializes xarg to satisfy class invariants.
int_type pod_index_type
The plain old data index type.
A 2D implementation of abstract_product_structure.
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.
virtual schema_poset_member * new_schema_handle(const std::string &xid_space_name, 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)
Creates a member handle of the type appropriate for members of this when used as a schema...
void attach_to_state(const namespace_poset *xns, const poset_path &xpath, bool xauto_access=true)
Attach to the state specified by path xpath in the namespace xns.
static bool is_valid_name(const std::string &xname)
True if xname is not empty and contains only name legal characters.
virtual void release_iterator(index_space_iterator &xitr) const
Returns the id space iterator xitr to the iterator pool.
virtual void ordinal(pod_index_type xbase_space_id, pod_index_type xfiber_schema_id, pod_index_type &xindex) const
The ordinal conversion from base space id xbase_space_id and fiber schema id xfiber_schema_id to sect...
virtual bool is_jim(pod_index_type xindex, bool xin_current_version=true) const
True if the member with index xindex is a jim.
static arg_list make_arg_list(const poset_path &xrep_path, const poset_path &xbase_space_path, const poset_path &xfiber_space_path)
Creates an arg list which conforms to the schema of this.
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.
virtual void new_state(bool xinitialize=true, bool xauto_access=true)
Creates a new subposet state in host() and attaches this object to it. If xinitialize, initialize the membership to xmembers, If !xinitialize, leave the membership uninitialized.
Namespace for the fiber_bundles component of the sheaf system.
virtual void attach_to_state(pod_index_type xbase_space_id, pod_index_type xfiber_schema_id)=0
Attach to the state in host() with component ids xbase_id and xfiber_schema_id.
void put_table_dof_range(section_space_schema_table_dof_crg_range &xtable_dof_range)
Set the table dof crg range.
void enable_invariant_check() const
Enable invariant checking.
virtual void initialize_standard_members()
Creates the members common to every poset (i.e. _top and _bottom).
virtual ~product_section_space_schema_poset()
Destructor.
virtual void tuple(pod_index_type xindex, pod_index_type &xbase_space_id, pod_index_type &xfiber_schema_id) const
The tuple conversion from section space schema id xindex to the base space id xbase_space_id and fibe...
section_space_schema_table_dof_crg_range * _table_dof_range
The implicit crg range that represents the table dof members of this poset.
virtual poset_type type_id() const
Identifier for the type of this poset.
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 void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
void update_gathered_id_spaces()
Update the gathered hub id spaces for the base space and fiber schema.
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
pod_type hub_pod() const
The current unglued hub id in the iteration. synonym for unglued_hub_pod().
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.
base_space_poset & base_space()
The base space for section spaces on this schema.
virtual array_poset_dof_map & table_dof_map(bool xrequire_write_access=false)
The map from table dof client_ids to table dof values for this poset (mutable version) ...
virtual void begin_jim_edit_mode(bool xauto_access=true)
Allow editing of jims and jim order relation.
A client handle for a poset member which has been prepared for use as a schema for a section space...