21 #include "SheafSystem/st2_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/stp_space.h" 28 #include "SheafSystem/fiber_bundles_namespace.h" 29 #include "SheafSystem/schema_poset_member.h" 30 #include "SheafSystem/stp_space.h" 31 #include "SheafSystem/wsv_block.h" 135 _row_dofs = xrow_dofs;
182 fiber_bundle::st2_e3_lite::
198 fiber_bundle::st2_e3_lite::
214 fiber_bundle::st2_e3_lite::
230 fiber_bundle::st2_e3_lite::
254 put_components(xx, xy, xz, yy, yz, zz);
275 put_component(0, xx_comp);
276 put_component(1, xy_comp);
277 put_component(2, xz_comp);
278 put_component(3, yy_comp);
279 put_component(4, yz_comp);
280 put_component(5, zz_comp);
365 require(precondition_of(e3_lite::static_tp_prototype(xp)));
369 const tp_lite& result = e3_lite::static_tp_prototype(xp);
373 ensure(postcondition_of(e3_lite::static_tp_prototype(xp)));
386 require(precondition_of(e3_lite::static_atp_prototype(xp)));
390 const atp_lite& result = e3_lite::static_atp_prototype(xp);
394 ensure(postcondition_of(e3_lite::static_atp_prototype(xp)));
407 require(precondition_of(e3_lite::static_stp_prototype(xp)));
411 const stp_lite& result = e3_lite::static_stp_prototype(xp);
415 ensure(postcondition_of(e3_lite::static_stp_prototype(xp)));
452 const string& result = static_class_name();
456 ensure(!result.empty());
471 static const string result(
"st2_e3_lite");
475 ensure(!result.empty());
497 ensure(is_same_type(*result));
521 require(&xother != 0);
527 bool result =
dynamic_cast<const st2_e3_lite*
>(&xother) != 0;
540 if(invariant_check())
544 disable_invariant_check();
548 invariance(st2_lite::invariant());
554 enable_invariant_check();
600 static const poset_path result(standard_schema_poset_name(),
"st2_e3_schema");
621 string lmember_names =
"xx DOUBLE false ";
622 lmember_names +=
"xy DOUBLE false ";
623 lmember_names +=
"xz DOUBLE false ";
624 lmember_names +=
"yy DOUBLE false ";
625 lmember_names +=
"yz DOUBLE false ";
626 lmember_names +=
"zz DOUBLE false";
629 standard_schema_path().member_name(),
630 st2::standard_schema_path(),
659 require(!xhost_path.
empty());
662 require(xschema_path.
full());
664 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
665 require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 6);
675 host_type::new_table(xns, xhost_path, xschema_path, 2, xvector_space_path, xauto_access);
679 ensure(xns.
owns(result, xauto_access));
680 ensure(result.path(
true) == xhost_path);
681 ensure(result.state_is_not_read_accessible());
682 ensure(result.schema(
true).path(xauto_access) == xschema_path);
684 ensure(result.factor_ct(
true) == 6);
685 ensure(result.d(
true) == 6);
687 ensure(result.p(
true) == 2);
688 ensure(result.dd(
true) == 3);
689 ensure(result.vector_space_path(
true) == xvector_space_path);
707 require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
708 require(standard_host_is_available<st2_e3>(xns, xsuffix, xauto_access));
718 poset_path lvector_space_path = vector_space_type::standard_host(xns, xsuffix, xauto_access).
path(
true);
720 poset_path lpath(standard_host_path<st2_e3>(xsuffix));
729 result_ptr = &new_host(xns, lpath, standard_schema_path(), lvector_space_path, xauto_access);
736 ensure(xns.
owns(result, xauto_access));
737 ensure(result.
path(
true) == standard_host_path<st2_e3>(xsuffix));
739 ensure(result.
schema(
true).
path(xauto_access) == standard_schema_path());
742 ensure(result.
d(
true) == 6);
743 ensure(result.
scalar_space_path(
true) == standard_host_path<vector_space_type::scalar_type>(xsuffix) );
744 ensure(result.
p(
true) == 2);
745 ensure(result.
dd(
true) == 3);
746 ensure(result.
vector_space_path(
true) == standard_host_path<vector_space_type>(xsuffix) );
788 attach_to_state(xhost, xhub_id);
794 ensure(index() == xhub_id);
795 ensure(is_attached());
809 attach_to_state(xhost, xid.
hub_pod());
815 ensure(index() ==~ xid);
816 ensure(is_attached());
827 require(!xname.empty());
832 attach_to_state(xhost, xname);
838 ensure(name() == xname);
839 ensure(is_attached());
849 require(xother != 0);
853 attach_to_state(xother);
858 ensure(is_attached());
859 ensure(is_same_state(xother));
869 require(precondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
873 new_jim_state(xhost, 0,
false, xauto_access);
877 ensure(postcondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
892 require(precondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
896 new_jim_state(&xhost, 0,
false, xauto_access);
912 ensure(postcondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
925 require(state_is_read_write_accessible());
933 ensure_for_all(i, 0, d(), component(i) == xrdt.
components[i]);
948 require(is_ancestor_of(&xother));
949 require(precondition_of(attach_to_state(&xother)));
953 attach_to_state(&xother);
957 ensure(postcondition_of(attach_to_state(&xother)));
971 require(precondition_of(attach_to_state(&xother)));
975 attach_to_state(&xother);
979 ensure(postcondition_of(attach_to_state(&xother)));
1042 require(state_is_read_write_accessible());
1046 put_component(0, xx_comp);
1047 put_component(1, xy_comp);
1048 put_component(2, xz_comp);
1049 put_component(3, yy_comp);
1050 put_component(4, yz_comp);
1051 put_component(5, zz_comp);
1055 ensure(invariant());
1068 fiber_bundle::st2_e3::
1073 require(state_is_read_write_accessible());
1086 fiber_bundle::st2_e3::
1091 require(state_is_read_accessible());
1165 require(precondition_of(e3::new_tp(vector_space(xauto_access), xp)));
1169 tp* result = e3::new_tp(vector_space(xauto_access), xp);
1173 ensure(postcondition_of(e3::new_tp(vector_space(xauto_access), xp)));
1186 require(precondition_of(e3::new_atp(vector_space(xauto_access), xp)));
1190 atp* result = e3::new_atp(vector_space(xauto_access), xp);
1194 ensure(postcondition_of(e3::new_atp(vector_space(xauto_access), xp)));
1207 require(precondition_of(e3::new_stp(vector_space(xauto_access), xp)));
1211 stp* result = e3::new_stp(vector_space(xauto_access), xp);
1215 ensure(postcondition_of(e3::new_stp(vector_space(xauto_access), xp)));
1242 const string& result = static_class_name();
1246 ensure(!result.empty());
1261 static const string result(
"st2_e3");
1265 ensure(!result.empty());
1287 ensure(result != 0);
1313 require(xother != 0);
1320 bool result =
dynamic_cast<const st2_e3*
>(xother) != 0;
1324 ensure(invariant());
1342 if(invariant_check())
1346 disable_invariant_check();
1350 invariance(st2::invariant());
1354 invariance(state_is_read_accessible() ? (dd() == 3) :
true);
1355 invariance(state_is_read_accessible() ? (d() == 6) :
true);
1359 enable_invariant_check();
1364 ensure(is_derived_query);
1414 value_type xx = xv[0];
1415 value_type xy = xv[1];
1416 value_type xz = xv[2];
1417 value_type yy = xv[3];
1418 value_type yz = xv[4];
1419 value_type zz = xv[5];
1441 if(!is_contravariant)
1452 for(
int m=0; m<3; ++m)
1454 for(
int n=m; n<3; ++n)
1456 value_type Te_mn = 0.0;
1457 for(
int k=0; k<3; ++k)
1459 for(
int l=0; l<3; ++l)
1461 Te_mn += B[k][m]*B[l][n]*Tf[k][l];
1479 for(
int m=0; m<3; ++m)
1481 for(
int n=m; n<3; ++n)
1483 value_type Te_mn = 0.0;
1484 for(
int k=0; k<3; ++k)
1486 for(
int l=0; l<3; ++l)
1488 Te_mn += C[m][k]*C[n][l]*Tf[k][l];
1537 xresult = a00*c00 + a01*c01 + a02*c02;
1546 ensure(unexecutable(
"xresult == determinant of x0"));
1560 require(precondition_of(
determinant(x0, result, xauto_access)));
1570 ensure(postcondition_of(
determinant(x0, result, xauto_access)));
1600 xresult = a00*c00 + a01*c01 + a02*c02;
1604 ensure(unexecutable(
"xresult == determinant of x0"));
1618 require(precondition_of(
determinant(x0, result)));
1628 ensure(postcondition_of(
determinant(x0, result)));
virtual ~st2_e3_lite()
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...
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 ...
matrix_type & basis_matrix()
The associated basis transformation matrix (non const version).
virtual const stp_lite & stp_prototype(int xp) const
Prototype for symmetric tensors of degree xp over this vector space.
virtual volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
virtual stp * new_stp(int xp, bool xauto_access) const
Virtual constructor for symmetric tensors of degree xp over vector space xvector_space.
void jacobi_transformation(const symmetric_matrix_3x3< T > &xm, general_matrix_3x3< T > &xeigenvectors, T xeigenvalues[3])
Determine the eigenvectors and eigenvalues of a real symmetric matrix xm.
A symmetric tensor of degree p over an abstract vector space.
virtual const tp_lite & tp_prototype(int xp) const
Prototype for general tensors of degree xp over this vector space.
bool full() const
True if both poset name and member name are not empty.
An antisymmetric tensor of degree p.
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
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...
virtual const atp_lite & atp_prototype(int xp) const
Prototype for antisymmetric tensors of degree xp over this vector space.
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...
virtual void put_components(const value_type &xx_comp, const value_type &xy_comp, const value_type &xz_comp, const value_type &yy_comp, const value_type &yz_comp, const value_type &zz_comp)
Set values of the components to the given arguments.
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...
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 const std::string & class_name() const
The name of this class.
virtual const std::string & class_name() const
The name of this class.
virtual void put_components(dof_type xx_comp, dof_type xy_comp, dof_type xz_comp, dof_type yy_comp, dof_type yz_comp, dof_type zz_comp)
Sets values of the components to the given arguments.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
virtual value_type component(int xrow, int xcolumn) const
The value of the component in a specified row and column.
st2_e3_lite()
Default constructor.
bool invariant() const
Class invariant.
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.
st2_e3 & operator=(const row_dofs_type &xrdt)
Assignment to an instance of the associated row dofs type.
virtual void * row_dofs()
The row dofs for this instance (mutable version).
SHEAF_DLL_SPEC void determinant(const st2 &x0, vd_value_type &xresult, bool xauto_access)
The determinant of a symmetric tensor (pre-allocated version for persistent types).
SHEAF_DLL_SPEC void transform_basis_by(e3_lite &xv, const gl3_lite &xtransform, bool is_contravariant=true)
Transform the basis and components of xv by xtransform.
matrix_type & component_matrix()
The associated component transformation matrix (non const version).
T * to_principal_axes(const T &xlite, GLN &xtransform)
Computes the principal axes basis for xlite. Returns the diagonalization in the auto-allocated result...
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...
bool invariant() const
Class invariant.
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...
Abstract base class with useful features for all volatile objects.
Abstract base class with useful features for all objects.
A general symmetric tensor of degree 2 over an abstract vector space (volatile version).
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
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...
A symmetric tensor of degree 2 over a Euclidean vector space of dimension 3 (volatile version)...
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 st2_e3_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
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.
virtual tp * new_tp(int xp, bool xauto_access) const
Virtual constructor for general tensors of degree xp over vector space xvector_space.
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
gl3_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
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 ...
st2_e3()
Default constructor.
The mathematical group GL(3, R). The group of all invertible, linear transformations on the R3...
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 atp * new_atp(int xp, bool xauto_access) const
Virtual constructor for antisymmetric tensors of degree xp over vector space xvector_space.
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
st2_e3_lite & operator=(const st2_e3_lite &xother)
Assignment operator.
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.
static const std::string & static_class_name()
The name of this class.
int dd() const
The dimension of the underlying ("domain") vector space.
General matrix with 3 rows and 3 columns.
bool is_ancestor_of(const any *other) const
True if other conforms to current.
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...
st2_e3_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
T components[6]
The xx, xy, xz, yy, yz, zz dofs.
virtual st2_e3 * clone() const
Make a new handle, no state instance of 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.
value_type component(int xrow, int xcolumn) const
The component with row index xrow and column index xcolumn.
static const std::string & static_class_name()
The name of this class.
row_dofs_type _row_dofs
Row_dofs_type.
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 int dd() const
Dimension of the underlying vector space.
double vd_value_type
The type of component in the fiber; the scalar type in the fiber vector space.
static host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path<st2_e3>(xsuffix). Returns the host if it already exists...
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 symmetric tensor of degree 2 over a Euclidean vector space of dimension 3 (persistent version)...
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
SHEAF_DLL_SPEC bool isunordered_or_equals(float x1, float x2)
True if isunordered(x1, x2) or x1 == x2.