21 #include "SheafSystem/t3_e3.impl.h" 23 #include "SheafSystem/abstract_poset_member.impl.h" 24 #include "SheafSystem/assert_contract.h" 25 #include "SheafSystem/at0.h" 26 #include "SheafSystem/at1_space.h" 27 #include "SheafSystem/fiber_bundles_namespace.h" 28 #include "SheafSystem/schema_poset_member.h" 29 #include "SheafSystem/tp_space.h" 30 #include "SheafSystem/wsv_block.h" 32 #include "SheafSystem/at3_e3.h" 33 #include "SheafSystem/st3_e3.h" 98 ensure_for_all(i, 0, d(), component(i) == xother[i]);
143 for(
int i=0; i<3; i++)
145 for(
int j=0; j<3; j++)
147 for(
int k=0; k<3; k++)
150 put_component(i, j, k, lcomp);
189 for(
int i=0; i<3; i++)
191 for(
int j=0; j<3; j++)
193 for(
int k=0; k<3; k++)
196 put_component(i, j, k, lcomp);
234 _row_dofs = xrow_dofs;
246 fiber_bundle::t3_e3_lite::
262 fiber_bundle::t3_e3_lite::
332 require(precondition_of(e3_lite::static_tp_prototype(xp)));
336 const tp_lite& result = e3_lite::static_tp_prototype(xp);
340 ensure(postcondition_of(e3_lite::static_tp_prototype(xp)));
353 require(precondition_of(e3_lite::static_atp_prototype(xp)));
357 const atp_lite& result = e3_lite::static_atp_prototype(xp);
361 ensure(postcondition_of(e3_lite::static_atp_prototype(xp)));
374 require(precondition_of(e3_lite::static_stp_prototype(xp)));
378 const stp_lite& result = e3_lite::static_stp_prototype(xp);
382 ensure(postcondition_of(e3_lite::static_stp_prototype(xp)));
414 const string& result = static_class_name();
418 ensure(!result.empty());
433 static const string result(
"t3_e3_lite");
437 ensure(!result.empty());
459 ensure(is_same_type(*result));
483 require(&xother != 0);
489 bool result =
dynamic_cast<const t3_e3_lite*
>(&xother) != 0;
502 if(invariant_check())
506 disable_invariant_check();
510 invariance(t3_lite::invariant());
516 enable_invariant_check();
562 static const poset_path result(standard_schema_poset_name(),
"t3_e3_schema");
583 string lmember_names =
"xxx DOUBLE false ";
584 lmember_names +=
"xxy DOUBLE false ";
585 lmember_names +=
"xxz DOUBLE false ";
586 lmember_names +=
"xyx DOUBLE false ";
587 lmember_names +=
"xyy DOUBLE false ";
588 lmember_names +=
"xyz DOUBLE false ";
589 lmember_names +=
"xzx DOUBLE false ";
590 lmember_names +=
"xzy DOUBLE false ";
591 lmember_names +=
"xzz DOUBLE false ";
592 lmember_names +=
"yxx DOUBLE false ";
593 lmember_names +=
"yxy DOUBLE false ";
594 lmember_names +=
"yxz DOUBLE false ";
595 lmember_names +=
"yyx DOUBLE false ";
596 lmember_names +=
"yyy DOUBLE false ";
597 lmember_names +=
"yyz DOUBLE false ";
598 lmember_names +=
"yzx DOUBLE false ";
599 lmember_names +=
"yzy DOUBLE false ";
600 lmember_names +=
"yzz DOUBLE false ";
601 lmember_names +=
"zxx DOUBLE false ";
602 lmember_names +=
"zxy DOUBLE false ";
603 lmember_names +=
"zxz DOUBLE false ";
604 lmember_names +=
"zyx DOUBLE false ";
605 lmember_names +=
"zyy DOUBLE false ";
606 lmember_names +=
"zyz DOUBLE false ";
607 lmember_names +=
"zzx DOUBLE false ";
608 lmember_names +=
"zzy DOUBLE false ";
609 lmember_names +=
"zzz DOUBLE false";
612 standard_schema_path().member_name(),
613 t3::standard_schema_path(),
642 require(!xhost_path.
empty());
645 require(xschema_path.
full());
647 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
648 require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 27);
655 require(host_type::d(xns, xschema_path, xauto_access) == host_type::d(xns, 3, xvector_space_path, xauto_access));
660 host_type::new_table(xns, xhost_path, xschema_path, 3, xvector_space_path, xauto_access);
664 ensure(xns.
owns(result, xauto_access));
665 ensure(result.
path(
true) == xhost_path);
667 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
670 ensure(result.
d(
true) == 27);
672 ensure(result.
p(
true) == 3);
673 ensure(result.
dd(
true) == 3);
692 require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
693 require(standard_host_is_available<t3_e3>(xns, xsuffix, xauto_access));
703 poset_path lvector_space_path = vector_space_type::standard_host(xns, xsuffix, xauto_access).
path(
true);
705 poset_path lpath(standard_host_path<t3_e3>(xsuffix));
714 result_ptr = &new_host(xns, lpath, standard_schema_path(), lvector_space_path, xauto_access);
721 ensure(xns.
owns(result, xauto_access));
722 ensure(result.
path(
true) == standard_host_path<t3_e3>(xsuffix));
724 ensure(result.
schema(
true).
path(xauto_access) == standard_schema_path());
727 ensure(result.
d(
true) == 27);
728 ensure(result.
scalar_space_path(
true) == standard_host_path<vector_space_type::scalar_type>(xsuffix) );
729 ensure(result.
p(
true) == 3);
730 ensure(result.
dd(
true) == 3);
731 ensure(result.
vector_space_path(
true) == standard_host_path<vector_space_type>(xsuffix) );
775 attach_to_state(const_cast<t3_e3*>(&xother));
793 require(is_ancestor_of(&xother));
794 require(precondition_of(attach_to_state(&xother)));
798 attach_to_state(&xother);
802 ensure(postcondition_of(attach_to_state(&xother)));
816 require(precondition_of(attach_to_state(&xother)));
820 attach_to_state(&xother);
824 ensure(postcondition_of(attach_to_state(&xother)));
888 require(precondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
892 new_jim_state(xhost, 0,
false, xauto_access);
896 ensure(postcondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
911 require(precondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
915 new_jim_state(&xhost, 0,
false, xauto_access);
931 ensure(postcondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
944 require(state_is_read_write_accessible());
952 ensure_for_all(i, 0, d(), component(i) == xrdt.
components[i]);
973 attach_to_state(xhost, xhub_id);
978 ensure(is_attached());
980 ensure(index() == xhub_id);
994 attach_to_state(xhost, xid.
hub_pod());
999 ensure(is_attached());
1001 ensure(index() ==~ xid);
1010 require(xhost != 0);
1012 require(!xname.empty());
1017 attach_to_state(xhost, xname);
1021 ensure(invariant());
1022 ensure(is_attached());
1024 ensure(name() == xname);
1028 fiber_bundle::t3_e3::
1033 require(state_is_read_write_accessible());
1046 fiber_bundle::t3_e3::
1051 require(state_is_read_accessible());
1114 require(precondition_of(e3::new_tp(vector_space(xauto_access), xp)));
1118 tp* result = e3::new_tp(vector_space(xauto_access), xp);
1122 ensure(postcondition_of(e3::new_tp(vector_space(xauto_access), xp)));
1135 require(precondition_of(e3::new_atp(vector_space(xauto_access), xp)));
1139 atp* result = e3::new_atp(vector_space(xauto_access), xp);
1143 ensure(postcondition_of(e3::new_atp(vector_space(xauto_access), xp)));
1156 require(precondition_of(e3::new_stp(vector_space(xauto_access), xp)));
1160 stp* result = e3::new_stp(vector_space(xauto_access), xp);
1164 ensure(postcondition_of(e3::new_stp(vector_space(xauto_access), xp)));
1190 const string& result = static_class_name();
1194 ensure(!result.empty());
1209 static const string result(
"t3_e3");
1213 ensure(!result.empty());
1235 ensure(result != 0);
1263 if(invariant_check())
1267 disable_invariant_check();
1271 invariance(t3::invariant());
1275 invariance(state_is_read_accessible() ? dd() == 3 :
true);
1279 enable_invariant_check();
1293 require(xother != 0);
1299 bool result =
dynamic_cast<const t3_e3*
>(xother) != 0;
1303 ensure(invariant());
1320 #include "SheafSystem/at3_e3.h" 1321 #include "SheafSystem/st3_e3.h" 1351 ensure(unexecutable(
"xresult is equal to the symmetric part of x0"));
1398 ensure(unexecutable(
"xresult is equal to the symmetric part of x0"));
1415 for(
int i=0; i<ldd; ++i)
1417 for(
int j=i; j<ldd; ++j)
1419 for(
int k=j; k<ldd; ++k)
1436 ensure(unexecutable(
"xresult is equal to the symmetric part of x0"));
1463 for(
int i=0; i<ldd; ++i)
1465 for(
int j=i; j<ldd; ++j)
1467 for(
int k=j; k<ldd; ++k)
1499 ensure(unexecutable(
"xresult is equal to the antisymmetric part of x0"));
A tensor of degree 3 over an abstract vector space (volatile version).
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 const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
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 void * row_dofs()
The row dofs for this instance (mutable version).
static const std::string & static_class_name()
The name of this class.
SHEAF_DLL_SPEC void alt(const t2_lite &x0, at2_lite &xresult)
The alternating (antisymmetric) part of tensor x0 (pre-allocated version for volatile types)...
A symmetric tensor of degree p over an abstract vector space.
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
virtual int dd() const
Dimension of the underlying vector space.
bool full() const
True if both poset name and member name are not empty.
void put_variance(const tensor_variance &xvariance, bool xauto_access)
Sets the variance to xvariance.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
An antisymmetric tensor of degree p.
t3_e3()
Default constructor.
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...
virtual t3_e3_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
An antisymmetric rank 3 tensor over a Euclidean vector space of dimension 3. (volatile version)...
poset_path path(bool xauto_access=true) const
A path to this component.
t3_e3_lite()
Default constructor.
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...
virtual const atp_lite & atp_prototype(int xp) const
Prototype for antisymmetric tensors of degree xp over this vector space.
poset_path vector_space_path() const
The path of the underlying vector space.
virtual value_type component(int xi, int xj, int xk) const
The component with indices xi, xj, xk.
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.
SHEAF_DLL_SPEC void sym(const t2_lite &x0, st2_lite &xresult)
The symmetric part of tensor x0 (pre-allocated version for volatile types).
A symmetric rank 3 tensor over a 3D Euclidean vector space (persistent version).
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
virtual void put_component(int xi, int xj, int xk, value_type xvalue)
Sets the component with indices xi, xj, xk to xvalue.
virtual const std::string & class_name() const
The name of this class.
row_dofs_type _row_dofs
Row_dofs_type.
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 value_type component(int xi, int xj, int xk) const
The component with indices xi, xj, xk.
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
virtual bool invariant() const
Class invariant.
bool is_mixed() const
True if and only if there exists at least one index that is covariant and at least one that is contra...
An antisymmetric tensor of degree p over an abstract vector space (volatile version).
virtual tp * new_tp(int xp, bool xauto_access) const
Virtual constructor for general tensors of degree xp over vector space xvector_space.
A general tensor of "degree" p and given "variance" over an abstract vector 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...
virtual ~t3_e3()
Destructor.
Abstract base class with useful features for all volatile objects.
An antisymmetric rank 3 tensor over a 3D Euclidean vector space.
Abstract base class with useful features for all objects.
A tensor of degree 3 over a Euclidean vector space of dimension 3 (volatile version).
virtual value_type component(int xi, int xj, int xk) const
The value of component with indices xi, xj, xk.
t3_e3_lite & operator=(const t3_e3_lite &xother)
Assignment operator.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
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...
virtual void put_component(int xi, int xj, int xk, value_type xvalue)
Sets the component with indices xi, xj, xk to xvalue.
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.
An index within the external ("client") scope of a given id space.
virtual volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
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 stp * new_stp(int xp, bool xauto_access) const
Virtual constructor for symmetric tensors of degree xp over vector space xvector_space.
T components[27]
The dofs in the following order:
virtual void put_component(int xi, int xj, int xk, value_type xvalue)
Sets the component with indices xi, xj, xk to xvalue.
virtual ~t3_e3_lite()
Destructor.
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.
virtual int dd() const
Dimension of the underlying vector space.
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
static host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path<t3_e3>(xsuffix). Returns the host if it already exists...
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...
virtual const tp_lite & tp_prototype(int xp) const
Prototype for general tensors of degree xp over this vector space.
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
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 bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
virtual const stp_lite & stp_prototype(int xp) const
Prototype for symmetric tensors of degree xp over this vector space.
virtual const std::string & class_name() const
The name of this class.
bool invariant() const
Class invariant.
virtual atp * new_atp(int xp, bool xauto_access) const
Virtual constructor for antisymmetric tensors of degree xp over vector space xvector_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...
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
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...
virtual t3_e3 * clone() const
Make a new handle, no state instance of current.
static int d(const namespace_poset &xns, const poset_path &xschema_path, bool xauto_access)
The tensor dimension implied by the schema specified by xschema_path.
virtual t3_e3 & operator=(const abstract_poset_member &xother)
Assignment operator; synonym for attach_to_state(&xother).
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.
static const std::string & static_class_name()
The name of this class.
A symmetric rank 3 tensor over a Euclidean vector space of dimension 3. (volatile version)...
virtual value_type component(int xi, int xj, int xk) const
The component with indices xi, xj, xk.
virtual tensor_variance variance(bool xauto_access) const
The variance.
virtual void put_component(int xi, int xj, int xk, value_type xvalue)
Sets the component with indices xi, xj, xk to xvalue.
An abstract client handle for a member of a poset.
std::string path() const
The full path as a string.
An abstract tensor space of degree p.
A symmetric tensor of degree p over an abstract vector space (volatile version).
Namespace for the fiber_bundles component of the sheaf system.
A tensor of degree 3 over a Euclidean vector space of dimension 3 (persistent version).
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.
double vd_value_type
The type of component in the fiber; the scalar type in the fiber vector space.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.