21 #include "SheafSystem/t2_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/at2_e3.h" 28 #include "SheafSystem/fiber_bundles_namespace.h" 29 #include "SheafSystem/schema_poset_member.h" 30 #include "SheafSystem/st2_e3.h" 31 #include "SheafSystem/tp_space.h" 32 #include "SheafSystem/wsv_block.h" 140 for(
int i=0; i<3; i++)
142 for(
int j=0; j<3; j++)
145 put_component(i, j, lcomp);
183 for(
int i=0; i<3; i++)
185 for(
int j=0; j<3; j++)
188 put_component(i, j, lcomp);
225 _row_dofs = xrow_dofs;
274 fiber_bundle::t2_e3_lite::
290 fiber_bundle::t2_e3_lite::
306 fiber_bundle::t2_e3_lite::
322 fiber_bundle::t2_e3_lite::
353 put_components(xx_comp, xy_comp, xz_comp,
354 yx_comp, yy_comp, yz_comp,
355 zx_comp, zy_comp, zz_comp);
378 put_component(0, xx_comp);
379 put_component(1, xy_comp);
380 put_component(2, xz_comp);
381 put_component(3, yx_comp);
382 put_component(4, yy_comp);
383 put_component(5, yz_comp);
384 put_component(6, zx_comp);
385 put_component(7, zy_comp);
386 put_component(8, zz_comp);
465 require(precondition_of(e3_lite::static_tp_prototype(xp)));
469 const tp_lite& result = e3_lite::static_tp_prototype(xp);
473 ensure(postcondition_of(e3_lite::static_tp_prototype(xp)));
486 require(precondition_of(e3_lite::static_atp_prototype(xp)));
490 const atp_lite& result = e3_lite::static_atp_prototype(xp);
494 ensure(postcondition_of(e3_lite::static_atp_prototype(xp)));
507 require(precondition_of(e3_lite::static_stp_prototype(xp)));
511 const stp_lite& result = e3_lite::static_stp_prototype(xp);
515 ensure(postcondition_of(e3_lite::static_stp_prototype(xp)));
552 const string& result = static_class_name();
556 ensure(!result.empty());
571 static const string result(
"t2_e3_lite");
575 ensure(!result.empty());
597 ensure(is_same_type(*result));
621 require(&xother != 0);
627 bool result =
dynamic_cast<const t2_e3_lite*
>(&xother) != 0;
640 if(invariant_check())
644 disable_invariant_check();
648 invariance(t2_lite::invariant());
654 enable_invariant_check();
700 static const poset_path result(standard_schema_poset_name(),
"t2_e3_schema");
721 string lmember_names =
"xx DOUBLE false ";
722 lmember_names +=
"xy DOUBLE false ";
723 lmember_names +=
"xz DOUBLE false ";
724 lmember_names +=
"yx DOUBLE false ";
725 lmember_names +=
"yy DOUBLE false ";
726 lmember_names +=
"yz DOUBLE false ";
727 lmember_names +=
"zx DOUBLE false ";
728 lmember_names +=
"zy DOUBLE false ";
729 lmember_names +=
"zz DOUBLE false";
732 standard_schema_path().member_name(),
733 t2::standard_schema_path(),
762 require(!xhost_path.
empty());
765 require(xschema_path.
full());
767 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
768 require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 9);
775 require(host_type::d(xns, xschema_path, xauto_access) == host_type::d(xns, 2, xvector_space_path, xauto_access));
780 host_type::new_table(xns, xhost_path, xschema_path, 2, xvector_space_path, xauto_access);
784 ensure(xns.
owns(result, xauto_access));
785 ensure(result.
path(
true) == xhost_path);
787 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
790 ensure(result.
d(
true) == 9);
792 ensure(result.
p(
true) == 2);
793 ensure(result.
dd(
true) == 3);
812 require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
813 require(standard_host_is_available<t2_e3>(xns, xsuffix, xauto_access));
823 poset_path lvector_space_path = vector_space_type::standard_host(xns, xsuffix, xauto_access).
path(
true);
825 poset_path lpath(standard_host_path<t2_e3>(xsuffix));
834 result_ptr = &new_host(xns, lpath, standard_schema_path(), lvector_space_path, xauto_access);
841 ensure(xns.
owns(result, xauto_access));
842 ensure(result.
path(
true) == standard_host_path<t2_e3>(xsuffix));
844 ensure(result.
schema(
true).
path(xauto_access) == standard_schema_path());
847 ensure(result.
d(
true) == 9);
848 ensure(result.
scalar_space_path(
true) == standard_host_path<vector_space_type::scalar_type>(xsuffix) );
849 ensure(result.
p(
true) == 2);
850 ensure(result.
dd(
true) == 3);
851 ensure(result.
vector_space_path(
true) == standard_host_path<vector_space_type>(xsuffix) );
896 attach_to_state(&xother);
914 require(is_ancestor_of(&xother));
915 require(precondition_of(attach_to_state(&xother)));
919 attach_to_state(&xother);
923 ensure(postcondition_of(attach_to_state(&xother)));
937 require(precondition_of(attach_to_state(&xother)));
941 attach_to_state(&xother);
945 ensure(postcondition_of(attach_to_state(&xother)));
1010 require(precondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
1014 new_jim_state(xhost, 0,
false, xauto_access);
1018 ensure(postcondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
1033 require(precondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
1037 new_jim_state(&xhost, 0,
false, xauto_access);
1053 ensure(postcondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
1066 require(state_is_read_write_accessible());
1074 ensure_for_all(i, 0, d(), component(i) == xrdt.
components[i]);
1090 require(xhost != 0);
1096 attach_to_state(xhost, xhub_id);
1100 ensure(invariant());
1101 ensure(is_attached());
1103 ensure(index() == xhub_id);
1111 require(xhost != 0);
1117 attach_to_state(xhost, xid.
hub_pod());
1121 ensure(invariant());
1122 ensure(is_attached());
1124 ensure(index() ==~ xid);
1133 require(xhost != 0);
1135 require(!xname.empty());
1140 attach_to_state(xhost, xname);
1144 ensure(invariant());
1145 ensure(is_attached());
1147 ensure(name() == xname);
1151 fiber_bundle::t2_e3::
1156 require(state_is_read_write_accessible());
1169 fiber_bundle::t2_e3::
1174 require(state_is_read_accessible());
1237 require(precondition_of(e3::new_tp(vector_space(xauto_access), xp)));
1241 tp* result = e3::new_tp(vector_space(xauto_access), xp);
1245 ensure(postcondition_of(e3::new_tp(vector_space(xauto_access), xp)));
1258 require(precondition_of(e3::new_atp(vector_space(xauto_access), xp)));
1262 atp* result = e3::new_atp(vector_space(xauto_access), xp);
1266 ensure(postcondition_of(e3::new_atp(vector_space(xauto_access), xp)));
1279 require(precondition_of(e3::new_stp(vector_space(xauto_access), xp)));
1283 stp* result = e3::new_stp(vector_space(xauto_access), xp);
1287 ensure(postcondition_of(e3::new_stp(vector_space(xauto_access), xp)));
1313 const string& result = static_class_name();
1317 ensure(!result.empty());
1332 static const string result(
"t2_e3");
1336 ensure(!result.empty());
1358 ensure(result != 0);
1384 if(invariant_check())
1388 disable_invariant_check();
1392 invariance(t2::invariant());
1396 invariance(state_is_read_accessible() ? dd() == 3 :
true);
1400 enable_invariant_check();
1414 require(xother != 0);
1420 bool result =
dynamic_cast<const t2_e3*
>(xother) != 0;
1424 ensure(invariant());
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 ...
bool invariant() const
Class invariant.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
t2_e3_lite & operator=(const t2_e3_lite &xother)
Assignment operator.
static const std::string & static_class_name()
The name of this class.
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.
bool full() const
True if both poset name and member name are not empty.
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
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 t2_e3_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
T components[9]
The dofs in the following order: components[0] => xx components[1] => xy components[2] => xz componen...
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 atp * new_atp(int xp, bool xauto_access) const
Virtual constructor for antisymmetric tensors of degree xp over vector space xvector_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.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
virtual const std::string & class_name() const
The name of this class.
A tensor of degree 2 over a Euclidean vector space of dimension 3 (persistent version).
virtual value_type component(int xrow, int xcolumn) const
The value of the component in a specified row and column.
virtual t2_e3 * clone() const
Make a new handle, no state instance of current.
row_dofs_type _row_dofs
Row_dofs_type.
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.
static host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path<t2_e3>(xsuffix). Returns the host if it already exists...
virtual const tp_lite & tp_prototype(int xp) const
Prototype for general tensors of degree xp over this vector space.
virtual t2_e3 & operator=(const abstract_poset_member &xother)
Assignment operator; synonym for attach_to_state(&xother).
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
virtual int dd() const
Dimension of the underlying vector space.
A tensor of degree 2 over an abstract vector space (volatile version).
An antisymmetric tensor of degree p over an abstract vector space (volatile version).
virtual bool invariant() const
Class invariant.
A general tensor of "degree" p and given "variance" over an abstract vector space.
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
Abstract base class with useful features for all volatile objects.
Abstract base class with useful features for all objects.
static const std::string & static_class_name()
The name of this class.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
t2_e3()
Default constructor.
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...
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 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.
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.
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 ~t2_e3()
Destructor.
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 tensor of degree 2 over a Euclidean vector space of dimension 3 (volatile version).
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.
t2_e3_lite()
Default constructor.
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
virtual void put_components(const value_type &xx_comp, const value_type &xy_comp, const value_type &xz_comp, const value_type &yx_comp, const value_type &yy_comp, const value_type &yz_comp, const value_type &zx_comp, const value_type &zy_comp, const value_type &zz_comp)
Set values of the components to the given arguments.
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
virtual const atp_lite & atp_prototype(int xp) const
Prototype for antisymmetric tensors of degree xp over this vector space.
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.
int_type pod_index_type
The plain old data index type.
virtual void * row_dofs()
The row dofs for this instance (mutable version).
int dd() const
The dimension of the underlying ("domain") vector space.
virtual const std::string & class_name() const
The name of this class.
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 3. (volatile version)...
virtual const stp_lite & stp_prototype(int xp) const
Prototype for symmetric tensors of degree xp over this vector space.
virtual tp * new_tp(int xp, bool xauto_access) const
Virtual constructor for general tensors of degree xp over vector space xvector_space.
virtual ~t2_e3_lite()
Destructor.
virtual value_type component(int xrow, int xcolumn) const
The value of the component in a specified row and column.
An abstract client handle for a member of a poset.
std::string path() const
The full path as a string.
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
An abstract tensor space of degree p.
t2_e3_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
A symmetric tensor of degree p over an abstract vector space (volatile version).
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.
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.