20 #include "SheafSystem/st4_e3.impl.h" 22 #include "SheafSystem/abstract_poset_member.impl.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/at0.h" 25 #include "SheafSystem/at1_space.h" 26 #include "SheafSystem/stp_space.h" 27 #include "SheafSystem/fiber_bundles_namespace.h" 28 #include "SheafSystem/schema_poset_member.h" 29 #include "SheafSystem/wsv_block.h" 136 _row_dofs = xrow_dofs;
148 fiber_bundle::st4_e3_lite::
164 fiber_bundle::st4_e3_lite::
283 require(precondition_of(e3_lite::static_tp_prototype(xp)));
287 const tp_lite& result = e3_lite::static_tp_prototype(xp);
291 ensure(postcondition_of(e3_lite::static_tp_prototype(xp)));
304 require(precondition_of(e3_lite::static_atp_prototype(xp)));
308 const atp_lite& result = e3_lite::static_atp_prototype(xp);
312 ensure(postcondition_of(e3_lite::static_atp_prototype(xp)));
325 require(precondition_of(e3_lite::static_stp_prototype(xp)));
329 const stp_lite& result = e3_lite::static_stp_prototype(xp);
333 ensure(postcondition_of(e3_lite::static_stp_prototype(xp)));
370 const string& result = static_class_name();
374 ensure(!result.empty());
389 static const string result(
"st4_e3_lite");
393 ensure(!result.empty());
415 ensure(is_same_type(*result));
439 require(&xother != 0);
445 bool result =
dynamic_cast<const st4_e3_lite*
>(&xother) != 0;
458 if(invariant_check())
462 disable_invariant_check();
466 invariance(st4_lite::invariant());
472 enable_invariant_check();
518 static const poset_path result(standard_schema_poset_name(),
"st4_e3_schema");
540 string lmember_names =
"xxxx DOUBLE false ";
541 lmember_names +=
"xxxy DOUBLE false ";
542 lmember_names +=
"xxxz DOUBLE false ";
543 lmember_names +=
"xxyy DOUBLE false ";
544 lmember_names +=
"xxyz DOUBLE false ";
545 lmember_names +=
"xxzz DOUBLE false ";
546 lmember_names +=
"xyyy DOUBLE false ";
547 lmember_names +=
"xyyz DOUBLE false ";
548 lmember_names +=
"xyzz DOUBLE false ";
549 lmember_names +=
"xzzz DOUBLE false ";
550 lmember_names +=
"yyyy DOUBLE false ";
551 lmember_names +=
"yyyz DOUBLE false ";
552 lmember_names +=
"yyzz DOUBLE false ";
553 lmember_names +=
"yzzz DOUBLE false ";
554 lmember_names +=
"zzzz DOUBLE false ";
557 standard_schema_path().member_name(),
558 st4::standard_schema_path(),
587 require(!xhost_path.
empty());
590 require(xschema_path.
full());
592 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
593 require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 15);
603 host_type::new_table(xns, xhost_path, xschema_path, 4, xvector_space_path, xauto_access);
607 ensure(xns.
owns(result, xauto_access));
608 ensure(result.path(
true) == xhost_path);
609 ensure(result.state_is_not_read_accessible());
610 ensure(result.schema(
true).path(xauto_access) == xschema_path);
612 ensure(result.factor_ct(
true) == 15);
613 ensure(result.d(
true) == 15);
615 ensure(result.p(
true) == 4);
616 ensure(result.dd(
true) == 3);
617 ensure(result.vector_space_path(
true) == xvector_space_path);
635 require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
636 require(standard_host_is_available<st4_e3>(xns, xsuffix, xauto_access));
646 poset_path lvector_space_path = vector_space_type::standard_host(xns, xsuffix, xauto_access).
path(
true);
648 poset_path lpath(standard_host_path<st4_e3>(xsuffix));
657 result_ptr = &new_host(xns, lpath, standard_schema_path(), lvector_space_path, xauto_access);
664 ensure(xns.
owns(result, xauto_access));
665 ensure(result.
path(
true) == standard_host_path<st4_e3>(xsuffix));
667 ensure(result.
schema(
true).
path(xauto_access) == standard_schema_path());
670 ensure(result.
d(
true) == 15);
671 ensure(result.
scalar_space_path(
true) == standard_host_path<vector_space_type::scalar_type>(xsuffix) );
672 ensure(result.
p(
true) == 4);
673 ensure(result.
dd(
true) == 3);
674 ensure(result.
vector_space_path(
true) == standard_host_path<vector_space_type>(xsuffix) );
717 attach_to_state(xhost, xhub_id);
723 ensure(index() == xhub_id);
724 ensure(is_attached());
738 attach_to_state(xhost, xid.
hub_pod());
744 ensure(index() ==~ xid);
745 ensure(is_attached());
756 require(!xname.empty());
761 attach_to_state(xhost, xname);
767 ensure(name() == xname);
768 ensure(is_attached());
778 require(xother != 0);
782 attach_to_state(xother);
787 ensure(is_attached());
788 ensure(is_same_state(xother));
798 require(precondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
802 new_jim_state(xhost, 0,
false, xauto_access);
806 ensure(postcondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
821 require(precondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
825 new_jim_state(&xhost, 0,
false, xauto_access);
841 ensure(postcondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
855 require(state_is_read_write_accessible());
863 ensure_for_all(i, 0, d(), component(i) == xrdt.
components[i]);
878 require(is_ancestor_of(&xother));
879 require(precondition_of(attach_to_state(&xother)));
883 attach_to_state(&xother);
887 ensure(postcondition_of(attach_to_state(&xother)));
901 require(precondition_of(attach_to_state(&xother)));
905 attach_to_state(&xother);
909 ensure(postcondition_of(attach_to_state(&xother)));
969 require(state_is_read_write_accessible());
973 put_component(0, xcomp);
985 fiber_bundle::st4_e3::
1001 fiber_bundle::st4_e3::
1067 require(precondition_of(e3::new_tp(vector_space(xauto_access), xp)));
1071 tp* result = e3::new_tp(vector_space(xauto_access), xp);
1075 ensure(postcondition_of(e3::new_tp(vector_space(xauto_access), xp)));
1088 require(precondition_of(e3::new_atp(vector_space(xauto_access), xp)));
1092 atp* result = e3::new_atp(vector_space(xauto_access), xp);
1096 ensure(postcondition_of(e3::new_atp(vector_space(xauto_access), xp)));
1109 require(precondition_of(e3::new_stp(vector_space(xauto_access), xp)));
1113 stp* result = e3::new_stp(vector_space(xauto_access), xp);
1117 ensure(postcondition_of(e3::new_stp(vector_space(xauto_access), xp)));
1142 const string& result = static_class_name();
1146 ensure(!result.empty());
1161 static const string result(
"st4_e3");
1165 ensure(!result.empty());
1187 ensure(result != 0);
1214 require(xother != 0);
1218 bool result =
dynamic_cast<const st4_e3*
>(xother) != 0;
1237 if(invariant_check())
1241 disable_invariant_check();
1245 invariance(st4::invariant());
1249 invariance((state_is_read_accessible() ? dd() == 3 :
true));
1253 enable_invariant_check();
static const std::string & static_class_name()
The name of this class.
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 void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
virtual tp * new_tp(int xp, bool xauto_access) const
Virtual constructor for general tensors of degree xp over vector space xvector_space.
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 atp * new_atp(int xp, bool xauto_access) const
Virtual constructor for antisymmetric tensors of degree xp over vector space xvector_space.
A symmetric tensor of degree p over an abstract vector space.
bool full() const
True if both poset name and member name are not empty.
An antisymmetric tensor of degree p.
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
static int d(const namespace_poset &xns, int xp, const poset_path &xvector_space_path, bool xauto_access)
The tensor dimension implied by tensor degree xp and the dimension of the domain vector space specifi...
st4_e3_lite()
Default constructor.
poset_path path(bool xauto_access=true) const
A path to this component.
static const std::string & static_class_name()
The name of this class.
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...
poset_path vector_space_path() const
The path of the underlying vector 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.
virtual const stp_lite & stp_prototype(int xp) const
Prototype for symmetric tensors of degree xp over this vector space.
virtual void put_components(dof_type xcomp)
Sets the value of the component to xcomp.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
row_dofs_type _row_dofs
Row_dofs_type.
virtual st4_e3_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
st4_e3 & operator=(const row_dofs_type &xrdt)
Assignment to an instance of the associated row dofs type.
virtual const atp_lite & atp_prototype(int xp) const
Prototype for antisymmetric tensors of degree xp over this vector space.
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.
bool invariant() const
Class invariant.
A symmetric rank 4 tensor over a Euclidean vector space of dimension 3. (volatile version)...
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
An antisymmetric tensor of degree p over an abstract vector space (volatile version).
static int d(const namespace_poset &xns, int xp, const poset_path &xvector_space_path, bool xauto_access)
The tensor dimension implied by tensor degree xp and the dimension of the domain vector space specifi...
A general tensor of "degree" p and given "variance" over an abstract vector space.
bool invariant() const
Class invariant.
st4_e3_lite & operator=(const st4_e3_lite &xother)
Assignment operator.
Abstract base class with useful features for all volatile objects.
Abstract base class with useful features for all objects.
static host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path<st4_e3>(xsuffix). Returns the host if it already exists...
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
virtual const std::string & class_name() const
The name of this class.
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 * row_dofs()
The row dofs for this instance (mutable version).
virtual void detach_from_state()
Detach this handle from its state, if any.
An index within the external ("client") scope of a given id space.
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
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. ...
int p(int xd, int xdd) const
Tensor degree as a function of tensor dimension xd and domain dimension xdd.
T components[15]
The components in the order:
virtual int dd() const
Dimension of the underlying vector space.
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...
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
virtual const std::string & class_name() const
The name of this class.
bool contains_poset(pod_index_type xhub_id, bool xauto_access=true) const
True if this contains a poset with hub id xhub_id..
bool path_is_auto_read_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 accessible.
poset_path scalar_space_path() const
The path of the underlying space of scalars.
virtual const tp_lite & tp_prototype(int xp) const
Prototype for general tensors of degree xp over this vector space.
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, const poset_path &xvector_space_path, bool xauto_access)
Creates a new host table for members of this type. The poset is created in namespace xns with path xh...
static int factor_ct(int xd)
Factor_ct() as a function of dimension xd.
int_type pod_index_type
The plain old data index type.
int dd() const
The dimension of the underlying ("domain") vector space.
A symmetric rank 3 tensor over a 3D Euclidean vector space (persistent version).
st4_e3()
Default constructor.
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
virtual volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
An abstract client handle for a member of a poset.
std::string path() const
The full path as a string.
vd_dof_type dof_type
The type of the degrees of freedom. Note that although dof_type == value_type in this implementation...
bool is_ancestor_of(const any *xother) const
True if xother conforms to current.
A symmetric tensor of degree p over an abstract vector space (volatile version).
An abstract symmetric tensor space of degree p.
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...
A client handle for a poset member which has been prepared for use as a schema.
A symmetric rank 4 tensor over an abstract vector space. (volatile version).
virtual stp * new_stp(int xp, bool xauto_access) const
Virtual constructor for symmetric tensors of degree xp over vector space xvector_space.
virtual st4_e3 * clone() const
Make a new handle, no state instance of current.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
virtual ~st4_e3_lite()
Destructor.
SHEAF_DLL_SPEC bool isunordered_or_equals(float x1, float x2)
True if isunordered(x1, x2) or x1 == x2.