21 #include "SheafSystem/t4_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/wsv_block.h" 31 #include "SheafSystem/tp_space.h" 32 #include "SheafSystem/std_sstream.h" 96 ensure_for_all(i, 0, d(), component(i) == xother[i]);
140 _row_dofs = xrow_dofs;
152 fiber_bundle::t4_e3_lite::
168 fiber_bundle::t4_e3_lite::
243 require(precondition_of(e3_lite::static_tp_prototype(xp)));
247 const tp_lite& result = e3_lite::static_tp_prototype(xp);
251 ensure(postcondition_of(e3_lite::static_tp_prototype(xp)));
264 require(precondition_of(e3_lite::static_atp_prototype(xp)));
268 const atp_lite& result = e3_lite::static_atp_prototype(xp);
272 ensure(postcondition_of(e3_lite::static_atp_prototype(xp)));
285 require(precondition_of(e3_lite::static_stp_prototype(xp)));
289 const stp_lite& result = e3_lite::static_stp_prototype(xp);
293 ensure(postcondition_of(e3_lite::static_stp_prototype(xp)));
330 const string& result = static_class_name();
334 ensure(!result.empty());
349 static const string result(
"t4_e3_lite");
353 ensure(!result.empty());
375 ensure(is_same_type(*result));
399 require(&xother != 0);
405 bool result =
dynamic_cast<const t4_e3_lite*
>(&xother) != 0;
418 if(invariant_check())
422 disable_invariant_check();
426 invariance(t4_lite::invariant());
432 enable_invariant_check();
478 static const poset_path result(standard_schema_poset_name(),
"t4_e3_schema");
499 string lcomp_names[81] = {
500 "xxxx",
"xxxy",
"xxxz",
"xxyx",
"xxyy",
"xxyz",
"xxzx",
"xxzy",
"xxzz",
501 "xyxx",
"xyxy",
"xyxz",
"xyyx",
"xyyy",
"xyyz",
"xyzx",
"xyzy",
"xyzz",
502 "xzxx",
"xzxy",
"xzxz",
"xzyx",
"xzyy",
"xzyz",
"xzzx",
"xzzy",
"xzzz",
503 "yxxx",
"yxxy",
"yxxz",
"yxyx",
"yxyy",
"yxyz",
"yxzx",
"yxzy",
"yxzz",
504 "yyxx",
"yyxy",
"yyxz",
"yyyx",
"yyyy",
"yyyz",
"yyzx",
"yyzy",
"yyzz",
505 "yzxx",
"yzxy",
"yzxz",
"yzyx",
"yzyy",
"yzyz",
"yzzx",
"yzzy",
"yzzz",
506 "zxxx",
"zxxy",
"zxxz",
"zxyx",
"zxyy",
"zxyz",
"zxzx",
"zxzy",
"zxzz",
507 "zyxx",
"zyxy",
"zyxz",
"zyyx",
"zyyy",
"zyyz",
"zyzx",
"zyzy",
"zyzz",
508 "zzxx",
"zzxy",
"zzxz",
"zzyx",
"zzyy",
"zzyz",
"zzzx",
"zzzy",
"zzzz"};
511 for(
int i=0; i<81; ++i)
513 los << lcomp_names[i] <<
" DOUBLE false ";
516 string lmember_names = los.str();
519 standard_schema_path().member_name(),
520 t4::standard_schema_path(),
549 require(!xhost_path.
empty());
552 require(xschema_path.
full());
554 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
555 require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 81);
562 require(host_type::d(xns, xschema_path, xauto_access) == host_type::d(xns, 4, xvector_space_path, xauto_access));
567 host_type::new_table(xns, xhost_path, xschema_path, 4, xvector_space_path, xauto_access);
571 ensure(xns.
owns(result, xauto_access));
572 ensure(result.
path(
true) == xhost_path);
574 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
577 ensure(result.
d(
true) == 81);
579 ensure(result.
p(
true) == 4);
580 ensure(result.
dd(
true) == 3);
599 require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
600 require(standard_host_is_available<t4_e3>(xns, xsuffix, xauto_access));
610 poset_path lvector_space_path = vector_space_type::standard_host(xns, xsuffix, xauto_access).
path(
true);
612 poset_path lpath(standard_host_path<t4_e3>(xsuffix));
621 result_ptr = &new_host(xns, lpath, standard_schema_path(), lvector_space_path, xauto_access);
628 ensure(xns.
owns(result, xauto_access));
629 ensure(result.
path(
true) == standard_host_path<t4_e3>(xsuffix));
631 ensure(result.
schema(
true).
path(xauto_access) == standard_schema_path());
634 ensure(result.
d(
true) == 81);
635 ensure(result.
scalar_space_path(
true) == standard_host_path<vector_space_type::scalar_type>(xsuffix) );
636 ensure(result.
p(
true) == 4);
637 ensure(result.
dd(
true) == 3);
638 ensure(result.
vector_space_path(
true) == standard_host_path<vector_space_type>(xsuffix) );
682 attach_to_state(&xother);
700 require(is_ancestor_of(&xother));
701 require(precondition_of(attach_to_state(&xother)));
705 attach_to_state(&xother);
709 ensure(postcondition_of(attach_to_state(&xother)));
723 require(precondition_of(attach_to_state(&xother)));
727 attach_to_state(&xother);
731 ensure(postcondition_of(attach_to_state(&xother)));
795 require(precondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
799 new_jim_state(xhost, 0,
false, xauto_access);
803 ensure(postcondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
818 require(precondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
822 new_jim_state(&xhost, 0,
false, xauto_access);
838 ensure(postcondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
851 require(state_is_read_write_accessible());
859 ensure_for_all(i, 0, d(), component(i) == xrdt.
components[i]);
878 attach_to_state(xhost, xhub_id);
883 ensure(is_attached());
885 ensure(index() == xhub_id);
899 attach_to_state(xhost, xid.
hub_pod());
904 ensure(is_attached());
906 ensure(index() ==~ xid);
917 require(!xname.empty());
922 attach_to_state(xhost, xname);
927 ensure(is_attached());
929 ensure(name() == xname);
933 fiber_bundle::t4_e3::
938 require(state_is_read_write_accessible());
951 fiber_bundle::t4_e3::
956 require(state_is_read_accessible());
1019 require(precondition_of(e3::new_tp(vector_space(xauto_access), xp)));
1023 tp* result = e3::new_tp(vector_space(xauto_access), xp);
1027 ensure(postcondition_of(e3::new_tp(vector_space(xauto_access), xp)));
1040 require(precondition_of(e3::new_atp(vector_space(xauto_access), xp)));
1044 atp* result = e3::new_atp(vector_space(xauto_access), xp);
1048 ensure(postcondition_of(e3::new_atp(vector_space(xauto_access), xp)));
1061 require(precondition_of(e3::new_stp(vector_space(xauto_access), xp)));
1065 stp* result = e3::new_stp(vector_space(xauto_access), xp);
1069 ensure(postcondition_of(e3::new_stp(vector_space(xauto_access), xp)));
1095 const string& result = static_class_name();
1099 ensure(!result.empty());
1114 static const string result(
"t4_e3");
1118 ensure(!result.empty());
1140 ensure(result != 0);
1169 if(invariant_check())
1173 disable_invariant_check();
1177 invariance(t4::invariant());
1181 invariance(state_is_read_accessible() ? dd() == 3 :
true);
1185 enable_invariant_check();
1199 require(xother != 0);
1205 bool result =
dynamic_cast<const t4_e3*
>(xother) != 0;
1209 ensure(invariant());
1226 #include "SheafSystem/st4_e3.h" 1241 for(
int i=0; i<ldd; ++i)
1243 for(
int j=i; j<ldd; ++j)
1245 for(
int k=j; k<ldd; ++k)
1247 for(
int l=k; l<ldd; ++l)
1283 ensure(unexecutable(
"xresult is equal to the symmetric part of x0"));
1310 for(
int i=0; i<ldd; ++i)
1312 for(
int j=i; j<ldd; ++j)
1314 for(
int k=j; k<ldd; ++k)
1316 for(
int l=k; l<ldd; ++l)
1364 ensure(unexecutable(
"xresult is equal to the antisymmetric part of x0"));
virtual const std::string & class_name() const
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...
virtual int dd() const
Dimension of the underlying vector 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 volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
virtual void put_component(int xi, int xj, int xk, int xl, value_type xvalue)
Sets the component with indices xi, xj, xk, xl to xvalue.
virtual t4_e3 & operator=(const abstract_poset_member &xother)
Assignment operator; synonym for attach_to_state(&xother).
virtual void put_component(int xi, int xj, int xk, int xl, value_type xvalue)
Sets the component with indices xi, xj, xk, xl to xvalue.
A symmetric tensor of degree p over an abstract 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 void * row_dofs()
The row dofs for this instance (mutable version).
An antisymmetric tensor of degree p.
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 value_type component(int xi, int xj, int xk, int xl) const
The component with indices xi, xj, xk, xl.
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...
poset_path vector_space_path() const
The path of the underlying vector space.
t4_e3_lite & operator=(const t4_e3_lite &xother)
Assignment operator.
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 path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
static const std::string & static_class_name()
The name of this class.
T components[81]
The dofs are in the following order:
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
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 ~t4_e3_lite()
Destructor.
virtual const std::string & class_name() const
The name of this class.
A symmetric rank 4 tensor over a Euclidean vector space of dimension 3. (volatile version)...
t4_e3_lite()
Default constructor.
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
A tensor of degree 4 over a Euclidean vector space of dimension 3 (persistent version).
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
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).
static const std::string & static_class_name()
The name of this class.
A general tensor of "degree" p and given "variance" over an abstract vector space.
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
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...
Abstract base class with useful features for all volatile objects.
Abstract base class with useful features for all objects.
virtual const stp_lite & stp_prototype(int xp) const
Prototype for symmetric tensors of degree xp over this vector space.
virtual t4_e3_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
t4_e3()
Default constructor.
bool invariant() const
Class invariant.
virtual const atp_lite & atp_prototype(int xp) const
Prototype for antisymmetric tensors of degree xp over this vector space.
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.
An index within the external ("client") scope of a given id space.
A tensor of degree 4 over a Euclidean vector space of dimension 3 (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.
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 t4_e3 * clone() const
Make a new handle, no state instance of current.
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 atp * new_atp(int xp, bool xauto_access) const
Virtual constructor for antisymmetric tensors of degree xp over vector space xvector_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...
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...
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.
A tensor of degree 4 over an abstract vector space (volatile version).
virtual value_type component(int xi, int xj, int xk, int xl) const
The component with indices xi, xj, xk, xl.
poset_path scalar_space_path() const
The path of the underlying space of scalars.
virtual ~t4_e3()
Destructor.
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 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.
static int factor_ct(int xd)
Factor_ct() as a function of dimension xd.
row_dofs_type _row_dofs
Row_dofs_type.
int_type pod_index_type
The plain old data index type.
virtual bool invariant() const
Class invariant.
int dd() const
The dimension of the underlying ("domain") vector space.
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
A symmetric rank 3 tensor over a 3D Euclidean vector space (persistent version).
virtual tensor_variance variance(bool xauto_access) const
The variance.
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<t4_e3>(xsuffix). Returns the host if it already exists...
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.
virtual const tp_lite & tp_prototype(int xp) const
Prototype for general tensors of degree xp over this vector space.
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.
virtual tp * new_tp(int xp, bool xauto_access) const
Virtual constructor for general tensors of degree xp over vector space xvector_space.