21 #include "SheafSystem/t2_e2.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/at2_e2.h" 33 #include "SheafSystem/st2_e2.h" 141 for(
int i=0; i<2; i++)
143 for(
int j=0; j<2; j++)
146 put_component(i, j, lcomp);
184 for(
int i=0; i<2; i++)
186 for(
int j=0; j<2; j++)
189 put_component(i, j, lcomp);
226 _row_dofs = xrow_dofs;
273 fiber_bundle::t2_e2_lite::
289 fiber_bundle::t2_e2_lite::
305 fiber_bundle::t2_e2_lite::
321 fiber_bundle::t2_e2_lite::
347 put_components(xx_comp, xy_comp, yx_comp, yy_comp);
371 put_component(0, xx_comp);
372 put_component(1, xy_comp);
373 put_component(2, yx_comp);
374 put_component(3, yy_comp);
442 require(precondition_of(e2_lite::static_tp_prototype(xp)));
446 const tp_lite& result = e2_lite::static_tp_prototype(xp);
450 ensure(postcondition_of(e2_lite::static_tp_prototype(xp)));
463 require(precondition_of(e2_lite::static_atp_prototype(xp)));
467 const atp_lite& result = e2_lite::static_atp_prototype(xp);
471 ensure(postcondition_of(e2_lite::static_atp_prototype(xp)));
484 require(precondition_of(e2_lite::static_stp_prototype(xp)));
488 const stp_lite& result = e2_lite::static_stp_prototype(xp);
492 ensure(postcondition_of(e2_lite::static_stp_prototype(xp)));
524 const string& result = static_class_name();
528 ensure(!result.empty());
543 static const string result(
"t2_e2_lite");
547 ensure(!result.empty());
569 ensure(is_same_type(*result));
593 require(&xother != 0);
599 bool result =
dynamic_cast<const t2_e2_lite*
>(&xother) != 0;
612 if(invariant_check())
616 disable_invariant_check();
620 invariance(t2_lite::invariant());
626 enable_invariant_check();
672 static const poset_path result(standard_schema_poset_name(),
"t2_e2_schema");
693 string lmember_names =
"xx DOUBLE false ";
694 lmember_names +=
"xy DOUBLE false ";
695 lmember_names +=
"yx DOUBLE false ";
696 lmember_names +=
"yy DOUBLE false";
699 standard_schema_path().member_name(),
700 t2::standard_schema_path(),
729 require(!xhost_path.
empty());
732 require(xschema_path.
full());
734 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
735 require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 4);
742 require(host_type::d(xns, xschema_path, xauto_access) == host_type::d(xns, 2, xvector_space_path, xauto_access));
746 host_type& result = host_type::new_table(xns, xhost_path, xschema_path, 2, xvector_space_path, xauto_access);
750 ensure(xns.
owns(result, xauto_access));
751 ensure(result.
path(
true) == xhost_path);
753 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
756 ensure(result.
d(
true) == 4);
758 ensure(result.
p(
true) == 2);
759 ensure(result.
dd(
true) == 2);
778 require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
779 require(standard_host_is_available<t2_e2>(xns, xsuffix, xauto_access));
789 poset_path lvector_space_path = vector_space_type::standard_host(xns, xsuffix, xauto_access).
path(
true);
791 poset_path lpath(standard_host_path<t2_e2>(xsuffix));
800 result_ptr = &new_host(xns, lpath, standard_schema_path(), lvector_space_path, xauto_access);
807 ensure(xns.
owns(result, xauto_access));
808 ensure(result.
path(
true) == standard_host_path<t2_e2>(xsuffix));
810 ensure(result.
schema(
true).
path(xauto_access) == standard_schema_path());
813 ensure(result.
d(
true) == 4);
814 ensure(result.
scalar_space_path(
true) == standard_host_path<vector_space_type::scalar_type>(xsuffix) );
815 ensure(result.
p(
true) == 2);
816 ensure(result.
dd(
true) == 2);
817 ensure(result.
vector_space_path(
true) == standard_host_path<vector_space_type>(xsuffix) );
860 attach_to_state(&xother);
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)));
975 require(precondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
979 new_jim_state(xhost, 0,
false, xauto_access);
983 ensure(postcondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
998 require(precondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
1002 new_jim_state(&xhost, 0,
false, xauto_access);
1018 ensure(postcondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
1031 require(state_is_read_write_accessible());
1039 ensure_for_all(i, 0, d(), component(i) == xrdt.
components[i]);
1055 require(xhost != 0);
1061 attach_to_state(xhost, xhub_id);
1065 ensure(invariant());
1066 ensure(is_attached());
1068 ensure(index() == xhub_id);
1076 require(xhost != 0);
1082 attach_to_state(xhost, xid.
hub_pod());
1086 ensure(invariant());
1087 ensure(is_attached());
1089 ensure(index() ==~ xid);
1098 require(xhost != 0);
1100 require(!xname.empty());
1105 attach_to_state(xhost, xname);
1109 ensure(invariant());
1110 ensure(is_attached());
1112 ensure(name() == xname);
1123 require(state_is_read_write_accessible());
1127 (*this)[0] = xx_comp;
1128 (*this)[1] = xy_comp;
1129 (*this)[2] = yx_comp;
1130 (*this)[3] = yy_comp;
1134 ensure(invariant());
1145 fiber_bundle::t2_e2::
1150 require(state_is_read_write_accessible());
1163 fiber_bundle::t2_e2::
1168 require(state_is_read_accessible());
1231 require(precondition_of(e2::new_tp(vector_space(xauto_access), xp)));
1235 tp* result = e2::new_tp(vector_space(xauto_access), xp);
1239 ensure(postcondition_of(e2::new_tp(vector_space(xauto_access), xp)));
1252 require(precondition_of(e2::new_atp(vector_space(xauto_access), xp)));
1256 atp* result = e2::new_atp(vector_space(xauto_access), xp);
1260 ensure(postcondition_of(e2::new_atp(vector_space(xauto_access), xp)));
1273 require(precondition_of(e2::new_stp(vector_space(xauto_access), xp)));
1277 stp* result = e2::new_stp(vector_space(xauto_access), xp);
1281 ensure(postcondition_of(e2::new_stp(vector_space(xauto_access), xp)));
1307 const string& result = static_class_name();
1311 ensure(!result.empty());
1326 static const string result(
"t2_e2");
1330 ensure(!result.empty());
1352 ensure(result != 0);
1380 if(invariant_check())
1384 disable_invariant_check();
1388 invariance(t2::invariant());
1392 invariance(state_is_read_accessible() ? dd() == 2 :
true);
1396 enable_invariant_check();
1411 require(xother != 0);
1417 bool result =
dynamic_cast<const t2_e2*
>(xother) != 0;
1421 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 ...
row_dofs_type _row_dofs
Row_dofs_type.
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 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...
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...
static const std::string & static_class_name()
The name of this class.
A tensor of degree 2 over a Euclidean vector space of dimension 2 (volatile version).
virtual void put_components(dof_type xx_comp, dof_type xy_comp, dof_type yx_comp, dof_type yy_comp)
Sets values of the components to the given arguments.
virtual stp * new_stp(int xp, bool xauto_access) const
Virtual constructor for symmetric tensors of degree xp over vector space xvector_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...
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
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...
A tensor of degree 2 over a Euclidean vector space of dimension 2 (persistent version).
virtual const stp_lite & stp_prototype(int xp) const
Prototype for symmetric tensors of degree xp over this vector space.
poset_path vector_space_path() const
The path of the underlying vector space.
t2_e2_lite & operator=(const t2_e2_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...
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 atp_lite & atp_prototype(int xp) const
Prototype for antisymmetric tensors of degree xp over this vector space.
bool invariant() const
Class invariant.
virtual value_type component(int xrow, int xcolumn) const
The value of the component in a specified row and column.
virtual t2_e2_lite * clone() const
Virtual constructor, makes a new instance of the same type as 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.
t2_e2_lite()
Default constructor.
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 2 (volatile version)...
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
virtual void * row_dofs()
The row dofs for this instance (mutable version).
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).
A general tensor of "degree" p and given "variance" over an abstract vector space.
virtual bool invariant() const
Class invariant.
Abstract base class with useful features for all volatile objects.
Abstract base class with useful features for all objects.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
virtual const tp_lite & tp_prototype(int xp) const
Prototype for general tensors of degree xp over this vector space.
virtual t2_e2 * clone() const
Make a new handle, no state instance of current.
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 bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
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 ~t2_e2_lite()
Destructor.
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. ...
t2_e2()
Default constructor.
int p(int xd, int xdd) const
Tensor degree as a function of tensor dimension xd and domain dimension xdd.
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...
t2_e2_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
virtual void put_components(value_type xx_comp, value_type xy_comp, value_type yx_comp, value_type yy_comp)
Set values of the components to the given arguments.
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..
virtual tp * new_tp(int xp, bool xauto_access) const
Virtual constructor for general tensors of degree xp over vector space xvector_space.
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 volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
virtual ~t2_e2()
Destructor.
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.
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
virtual const std::string & class_name() const
The name of this class.
virtual t2_e2 & 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.
static const std::string & static_class_name()
The name of this class.
int_type pod_index_type
The plain old data index type.
T components[4]
The xx, xy, yx and yy dofs.
static host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path<t2_e2>(xsuffix). Returns the host if it already exists...
int dd() const
The dimension of the underlying ("domain") vector space.
A symmetric tensor of degree 2 over a Euclidean vector space of dimension 2 (volatile version)...
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
virtual value_type component(int xrow, int xcolumn) const
The value of the component in a specified row and column.
virtual atp * new_atp(int xp, bool xauto_access) const
Virtual constructor for antisymmetric tensors of degree xp over vector space xvector_space.
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...
virtual int dd() const
Dimension of the underlying vector space.
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.
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.