21 #include "SheafSystem/sec_rep_descriptor.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/eval_family.h" 25 #include "SheafSystem/namespace_poset.h" 26 #include "SheafSystem/poset.h" 27 #include "SheafSystem/poset_dof_map.h" 28 #include "SheafSystem/poset_state_handle.h" 29 #include "SheafSystem/postorder_iterator.h" 30 #include "SheafSystem/std_string.h" 31 #include "SheafSystem/std_typeinfo.h" 32 #include "SheafSystem/schema_descriptor.h" 33 #include "SheafSystem/sec_rep_descriptor_poset.h" 34 #include "SheafSystem/sec_rep_space.h" 35 #include "SheafSystem/wsv_block.h" 55 static const poset_path result(
"sec_rep_descriptor_schema",
"sec_rep_descriptor_schema");
59 ensure(result.
full());
82 ldof_specs =
"discretization_subposet_name C_STRING false";
83 ldof_specs +=
" multivalued_subposet_name C_STRING false";
84 ldof_specs +=
" evaluation_subposet_name C_STRING false";
85 ldof_specs +=
" evaluator_family_name C_STRING false";
86 ldof_specs +=
" URL C_STRING false";
87 ldof_specs +=
" multiplicity INT false";
92 ldof_specs +=
" eval_is_above_disc SIZE_TYPE false";
96 ldof_specs +=
" prototypes_path C_STRING true";
99 standard_schema_path().member_name(),
100 poset_path(standard_schema_path().poset_name(),
"bottom"),
126 static const poset_path result(
"sec_rep_descriptors",
"");
130 ensure(!result.
empty());
131 ensure(!result.
full());
153 require(!xhost_path.
empty());
156 require(xschema_path.
full());
158 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
160 require(!xprototypes_path.
empty());
165 host_type& result = host_type::new_table(xns, xhost_path, xschema_path, xprototypes_path, xauto_access);
169 ensure(xns.
owns(result, xauto_access));
170 ensure(result.path(
true) == xhost_path);
171 ensure(result.state_is_not_read_accessible());
172 ensure(result.schema(
true).path(xauto_access) == xschema_path);
174 ensure(result.prototypes().path(xauto_access) == xprototypes_path);
207 poset_path lprototypes_path(base_space_member::prototypes_poset_name());
208 result_ptr = &new_host(xns, lpath, standard_schema_path(), lprototypes_path, xauto_access);
215 ensure(xns.
owns(result, xauto_access));
216 ensure(result.
path(
true) == standard_host_path());
218 ensure(result.
schema(
true).
path(xauto_access) == standard_schema_path());
241 require(is_ancestor_of(&xother));
262 require(is_ancestor_of(&xother));
323 new_jem_state(const_cast<sec_rep_descriptor*>(&xother),
true,
true);
445 const std::string& xdiscretization_subposet_name,
446 const std::string& xmultivalued_subposet_name,
447 const std::string& xevaluation_subposet_name,
448 const std::string& xevaluator_family_name,
449 const std::string& xurl,
451 bool xeval_is_above_disc,
463 xdiscretization_subposet_name,
464 xmultivalued_subposet_name,
465 xevaluation_subposet_name,
466 xevaluator_family_name,
502 ensure(
host() == xhost);
503 ensure(
index() == xindex);
526 ensure(
host() == xhost);
527 ensure(
index() ==~ xindex);
542 require(!xname.empty());
553 ensure(
host() == xhost);
554 ensure(
name() == xname);
642 require(precondition_of(
new_jim_state(
host(), xdof_map, xcopy_dof_map, xauto_access)));
650 ensure(postcondition_of(
new_jim_state(
host(), xdof_map, xcopy_dof_map, xauto_access)));
687 row_dof_tuple ltuple(lmt_str, lmt_str, lmt_str, lmt_str, lmt_str, 0, 0);
697 lcopy_dof_map =
false;
702 lcopy_dof_map = xcopy_dof_map;
715 ensure(xdof_map == 0 ?
url().empty() :
true);
737 const std::string& xdiscretization_subposet_name,
738 const std::string& xmultivalued_subposet_name,
739 const std::string& xevaluation_subposet_name,
740 const std::string& xevaluator_family_name,
741 const std::string& xurl,
743 bool xeval_is_above_disc,
751 require(xmultiplicity >= 0);
761 xmultivalued_subposet_name,
762 xevaluation_subposet_name,
763 xevaluator_family_name,
766 xeval_is_above_disc ? 1 : 0);
784 ensure(
host() == xhost);
790 ensure(
url() == xurl);
810 require(xrequire_write_access ?
835 require(xrequire_write_access ?
864 require(xdof_map != 0);
872 ensure(result == (dynamic_cast<const array_poset_dof_map*>(xdof_map) != 0));
891 result = row_dof_tuple_ptr()->discretization_subposet_name;
910 delete [] row_dof_tuple_ptr()->discretization_subposet_name;
935 result = row_dof_tuple_ptr()->multivalued_subposet_name;
954 delete [] row_dof_tuple_ptr()->multivalued_subposet_name;
979 result = row_dof_tuple_ptr()->evaluation_subposet_name;
998 delete [] row_dof_tuple_ptr()->evaluation_subposet_name;
1022 result = row_dof_tuple_ptr()->evaluator_family_name;
1041 delete [] row_dof_tuple_ptr()->evaluator_family_name;
1065 result = row_dof_tuple_ptr()->url;
1084 delete [] row_dof_tuple_ptr()->url;
1085 row_dof_tuple::copy_string_dof(row_dof_tuple_ptr()->
url, xurl);
1089 ensure(
url() == xurl);
1108 result = row_dof_tuple_ptr()->multiplicity;
1127 row_dof_tuple_ptr()->multiplicity = xmultiplicity;
1150 result = row_dof_tuple_ptr()->eval_is_above_disc;
1170 row_dof_tuple_ptr()->eval_is_above_disc = xvalue ? 1 : 0;
1202 if(_evaluators != 0)
1208 assertion(_evaluators == 0);
1210 if(!lnew_name.empty())
1230 fiber_bundle::sec_rep_descriptor::row_dof_tuple::
1231 row_dof_tuple(
const std::string& xdiscretization_subposet_name,
1232 const std::string& xmultivalued_subposet_name,
1233 const std::string& xevaluation_subposet_name,
1234 const std::string& xevaluator_family_name,
1235 const std::string& xurl,
1247 copy_string_dof(
url, xurl);
1258 ensure(
url == xurl);
1267 fiber_bundle::sec_rep_descriptor::row_dof_tuple::
1268 copy_string_dof(
char*& xdof,
const std::string& xdof_value)
1274 xdof =
new char[xdof_value.size()+1];
1275 strcpy(xdof, xdof_value.c_str());
1279 ensure(strcmp(xdof, xdof_value.c_str()) == 0);
poset_state_handle * host() const
The poset which this is a handle to a component of.
virtual void attach_handle_data_members()
Initializes handle data members when attaching to a different member of the same host.
eval_family * evaluators() const
The family of evaluators for this rep. /.
virtual bool invariant() const
Class invariant.
virtual poset_path path(bool xauto_access=true) const
The path of this poset.
virtual ~sec_rep_descriptor()
Destructor.
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 bool invariant() const
Class invariant.
virtual bool is_restricted() const
True if handle is a restriction of the state, that is, if schema() is not the same as host()->schema(...
poset_dof_map * row_dof_tuple(const scoped_index &xindex) const
The row dof tuple associated with xindex.
std::string evaluator_family_name() const
The name of the evaluator family.
bool full() const
True if both poset name and member name are not empty.
virtual int member_ct() const
The number of members of this poset.
virtual void new_jim_state(poset_dof_map *xdof_map=0, bool xcopy_dof_map=false, bool xauto_access=true)
Creates a new jim (join-irreducible member) state in host() and attaches this to it. If xdof_map == 0 a new dof map is created. If xdof_map != 0 and xcopy_dof_map == false, xdof_map is used as the dof map. If xdof_map != 0 and xcopy_dof_map is true, a copy of xdof_map is used.
poset_path path(bool xauto_access=true) const
A path to this component.
static const poset_path & standard_host_path()
The standard path for host spaces for this class.
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...
std::string discretization_subposet_name() const
The name of the discretization subposet.
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.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
static const poset_path & standard_schema_path()
The path of the schema required by this class.
int multiplicity() const
The number of degrees of freedom associated with each (discretization member, fiber_schema member) pa...
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 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 general, abstract map from dof ids to dof values.
The poset for sec_rep_descriptors.
virtual bool dof_map_is_ancestor_of(const poset_dof_map *xdof_map) const
True if xdof_map conforms to (i.e. is derived from) the type of dof map required by this member...
Abstract base class with useful features for all objects.
sec_rep_descriptor()
Default constructor.
bool path_is_available(const poset_path &xpath, bool xauto_access) const
True if the state referred to xpath does not exist or exists and conforms to poset type P...
static eval_family * new_family(const std::string &xname)
Creates an instance of the evaluator family associated with name xname.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
const base_space_poset & prototypes() const
The base space members prototypes poset.
void put_discretization_subposet_name(const std::string &xname)
Sets the name of the discretization subposet to xname.
bool eval_is_above_disc() const
True is the evaluation subposet is strictly above the discretization subposet.
void put_eval_is_above_disc(bool xvalue)
Sets eval_is_above_disc to xvalue.
A client handle for a mutable partially ordered set.
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 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)
virtual void detach_from_state()
Detach this handle from its state, if any.
void put_evaluation_subposet_name(const std::string &xname)
Sets the name of the evaluation subposet to xname.
An index within the external ("client") scope of a given id space.
A family of compatible section evaluators, one for each member of some family of cell types; a map fr...
virtual bool is_attached() const
True if this handle is attached to a non-void state.
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.
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. ...
virtual array_poset_dof_map & dof_map(bool xrequire_write_access=false)
The map from client_ids to dof values for this poset member (mutable version)
virtual void begin_jim_edit_mode(bool xauto_access=true)
Allow editing of jims and jim order relation.
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...
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...
bool contains_poset(pod_index_type xhub_id, bool xauto_access=true) const
True if this contains a poset with hub id xhub_id..
void put_evaluator_family_name(const std::string &xname)
Sets the name of the evaluator family to xname.
void put_multivalued_subposet_name(const std::string &xname)
Sets the name of the multivalued subposet to xname.
void put_url(const std::string &xurl)
Sets the url for a description of this representation to xurl.
void put_multiplicity(int xmultiplicity)
Sets the number of degrees of freedom associated with each (discretization member, fiber_schema member) pair.
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
virtual void put_dof_tuple(const void *xbuf, size_t xbuflen)
Copies the entire dof tuple from xbuf into internal storage.
virtual poset_state_handle * host() const
The poset which owns this.
bool invariant_check() const
True if invariant checking is enabled.
int_type pod_index_type
The plain old data index type.
std::string evaluation_subposet_name() const
The name of the evaluation subposet.
std::string multivalued_subposet_name() const
The name of the multivalued subposet.
static host_type & standard_host(namespace_type &xns, bool xauto_access)
The host with path standard_host_path(). Returns the host if it already exists, otherwise, creates it in namespace xns with schema specified by standard_schema_path() and standard paths for prerequisites, which are also created if needed.
virtual void end_jim_edit_mode(bool xensure_lattice_invariant=true, bool xauto_access=true)
Prevent editing of jims and jim order relation.
virtual void end_jim_edit_mode(bool xensure_lattice_invariant=true, bool xauto_access=true)
Prevent editing of jims and jim order relation.
virtual void put_dof_tuple(const void *xbuf, size_t xbuflen)=0
Copies the entire dof tuple from xbuf into internal storage.
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.
virtual void new_jim_state(poset_dof_map *xdof_map=0, bool xcopy_dof_map=false, bool xauto_access=true)
Creates a new jim (join-irreducible member) state in host() and attaches this to it. If xdof_map == 0 a new dof map is created. If xdof_map != 0 and xcopy_dof_map == false, xdof_map is used as the dof map. If xdof_map != 0 and xcopy_dof_map is true, a copy of xdof_map is used.
virtual void get_read_access() const
Get read access to the state associated with this.
An abstract client handle for a member of a poset.
virtual 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) ...
std::string url() const
The url for a description of this representation.
virtual void new_jem_state(abstract_poset_member *xother, bool xgreatest, bool xauto_access)
Creates a new jrm state in host() which is the greatest jem (xgreatest true) or least jem (xgreatest ...
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.
Namespace for the fiber_bundles component of the sheaf system.
virtual sec_rep_descriptor * clone() const
Make a new handle, no state instance of current.
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 bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, const poset_path &xprototypes_path, bool xauto_access)
Creates a new host table for members of this type. The poset is created in namespace xns with path xh...
A description for a section representation scheme.
virtual sec_rep_descriptor & operator=(const abstract_poset_member &xother)
Assignment operator.
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.