21 #include "SheafSystem/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/at0_space.h" 27 #include "SheafSystem/at1_space.h" 28 #include "SheafSystem/at2_e2.h" 29 #include "SheafSystem/fiber_bundles_namespace.h" 30 #include "SheafSystem/atp_space.h" 31 #include "SheafSystem/schema_poset_member.h" 32 #include "SheafSystem/st2_e2.h" 33 #include "SheafSystem/st4_e2.h" 34 #include "SheafSystem/stp_space.h" 35 #include "SheafSystem/t2_e2.h" 36 #include "SheafSystem/t4_e2.h" 37 #include "SheafSystem/wsv_block.h" 103 ensure(unexecutable(*
this == xother));
146 _row_dofs = xrow_dofs;
151 ensure(unexecutable(
row_dofs() == xrow_dofs));
167 put_components(x0, x1);
187 put_component(0, x_comp);
188 put_component(1, y_comp);
199 fiber_bundle::e2_lite::
217 fiber_bundle::e2_lite::
339 require(((0 <= xp) && (xp <= 2)) || (xp == 4));
380 ensure(unexecutable(
"result.p() == xp"));
391 require(precondition_of(static_tp_prototype(xp)));
395 const tp_lite& result = static_tp_prototype(xp);
399 ensure(postcondition_of(static_tp_prototype(xp)));
412 require((0 <= xp) && (xp <= 2));
443 ensure(unexecutable(
"result.p() == xp"));
454 require(precondition_of(static_atp_prototype(xp)));
458 const atp_lite& result = static_atp_prototype(xp);
462 ensure(postcondition_of(static_atp_prototype(xp)));
475 require((2 == xp) || (xp == 4));
504 ensure(unexecutable(
"result.p() == xp"));
515 require(precondition_of(static_stp_prototype(xp)));
519 const stp_lite& result = static_stp_prototype(xp);
523 ensure(postcondition_of(static_stp_prototype(xp)));
561 const string& result = static_class_name();
565 ensure(!result.empty());
580 static const string result(
"e2_lite");
584 ensure(!result.empty());
606 ensure(is_same_type(*result));
630 require(&xother != 0);
636 bool result =
dynamic_cast<const e2_lite*
>(&xother) != 0;
649 if(invariant_check())
653 disable_invariant_check();
657 invariance(ed_lite::invariant());
663 enable_invariant_check();
709 static const poset_path result(standard_schema_poset_name(),
"e2_schema");
730 string lmember_names =
"x DOUBLE false y DOUBLE false";
733 standard_schema_path().member_name(),
734 ed::standard_schema_path(),
763 require(!xhost_path.
empty());
766 require(xschema_path.
full());
768 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
769 require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 2);
777 host_type::new_table(xns, xhost_path, xschema_path, xscalar_space_path, xauto_access);
781 ensure(xns.
owns(result, xauto_access));
782 ensure(result.
path(
true) == xhost_path);
784 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
787 ensure(result.
d(
true) == 2);
789 ensure(result.
p(
true) == 1);
790 ensure(result.
dd(
true) == 2);
809 require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
810 require(standard_host_is_available<e2>(xns, xsuffix, xauto_access));
820 poset_path lscalar_space_path = scalar_type::standard_host(xns, xsuffix, xauto_access).
path(
true);
822 poset_path lpath(standard_host_path<e2>(xsuffix));
831 result_ptr = &new_host(xns, lpath, standard_schema_path(), lscalar_space_path, xauto_access);
838 ensure(xns.
owns(result, xauto_access));
839 ensure(result.
path(
true) == standard_host_path<e2>(xsuffix));
841 ensure(result.
schema(
true).
path(xauto_access) == standard_schema_path());
844 ensure(result.
d(
true) == 2);
845 ensure(result.
scalar_space_path(
true) == standard_host_path<scalar_type>(xsuffix) );
846 ensure(result.
p(
true) == 1);
847 ensure(result.
dd(
true) == 2);
892 attach_to_state(xhost, xhub_id);
898 ensure(index() == xhub_id);
899 ensure(is_attached());
913 attach_to_state(xhost, xid.
hub_pod());
919 ensure(index() ==~ xid);
920 ensure(is_attached());
931 require(!xname.empty());
936 attach_to_state(xhost, xname);
942 ensure(name() == xname);
943 ensure(is_attached());
952 require(xother != 0);
956 attach_to_state(xother);
961 ensure(is_attached());
962 ensure(is_same_state(xother));
971 require(precondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
975 new_jim_state(xhost, 0,
false, xauto_access);
979 ensure(postcondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
994 require(precondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
998 new_jim_state(&xhost, 0,
false, xauto_access);
1014 ensure(postcondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
1027 require(state_is_read_write_accessible());
1035 ensure_for_all(i, 0, d(), component(i) == xrdt.
components[i]);
1049 require(is_ancestor_of(&xother));
1050 require(precondition_of(attach_to_state(&xother)));
1054 attach_to_state(&xother);
1058 ensure(postcondition_of(attach_to_state(&xother)));
1071 require(precondition_of(attach_to_state(&xother)));
1075 attach_to_state(&xother);
1079 ensure(postcondition_of(attach_to_state(&xother)));
1195 require(state_is_read_write_accessible());
1199 put_component(0, xcomp);
1200 put_component(1, ycomp);
1204 ensure(invariant());
1263 require(((0 <= xp) && (xp <= 2)) || (xp == 4));
1268 const string& lvector_space_name = xvector_space.
name();
1274 const string lname =
1275 create_tensor_space_name(lvector_space_name,
"at0");
1277 at0* result =
new at0(&lhost);
1283 const string lname =
1284 create_tensor_space_name(lvector_space_name,
"e2");
1286 e2* result =
new e2(&lhost);
1292 const string lname =
1293 create_tensor_space_name(lvector_space_name,
"t2_e2");
1303 const string lname =
1304 create_tensor_space_name(lvector_space_name,
"t4_e2");
1317 ensure(unexecutable(
"result.p() == xp"));
1330 require((0 <= xp) && (xp <= 2));
1335 const string& lvector_space_name = xvector_space.
name();
1341 const string lname =
1342 create_tensor_space_name(lvector_space_name,
"at0");
1344 at0* result =
new at0(&lhost);
1350 const string lname =
1351 create_tensor_space_name(lvector_space_name,
"e2");
1353 e2* result =
new e2(&lhost);
1359 const string lname =
1360 create_tensor_space_name(lvector_space_name,
"at2_e2");
1373 ensure(unexecutable(
"result.p() == xp"));
1385 require((2 == xp) || (xp == 4));
1390 const string& lvector_space_name = xvector_space.
name();
1396 const string lname =
1397 create_tensor_space_name(lvector_space_name,
"st2_e2");
1407 const string lname =
1408 create_tensor_space_name(lvector_space_name,
"st4_e2");
1421 ensure(unexecutable(
"result.p() == xp"));
1433 require(precondition_of(e2::new_tp(vector_space(xauto_access), xp)));
1437 tp* result = e2::new_tp(vector_space(xauto_access), xp);
1441 ensure(postcondition_of(e2::new_tp(vector_space(xauto_access), xp)));
1454 require(precondition_of(e2::new_atp(vector_space(xauto_access), xp)));
1458 atp* result = e2::new_atp(vector_space(xauto_access), xp);
1462 ensure(postcondition_of(e2::new_atp(vector_space(xauto_access), xp)));
1475 require(precondition_of(e2::new_stp(vector_space(xauto_access), xp)));
1479 stp* result = e2::new_stp(vector_space(xauto_access), xp);
1483 ensure(postcondition_of(e2::new_stp(vector_space(xauto_access), xp)));
1510 const string& result = static_class_name();
1514 ensure(!result.empty());
1529 static const string result(
"e2");
1533 ensure(!result.empty());
1551 e2* result =
new e2();
1555 ensure(result != 0);
1582 require(xother != 0);
1589 bool result =
dynamic_cast<const e2*
>(xother) != 0;
1613 invariance(ed::invariant());
1615 if (invariant_check())
1619 disable_invariant_check();
1621 invariance((is_attached() ? d() == 2 :
true));
1625 enable_invariant_check();
1630 ensure(is_derived_query);
T components[2]
The components (row_dofs).
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 ...
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.
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
bool full() const
True if both poset name and member name are not empty.
static const std::string & static_class_name()
The name of this class.
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 2 (persistent version)...
An antisymmetric tensor of degree p.
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, 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...
Euclidean vector space of dimension 2 (persistent version).
A tensor of degree 2 over a Euclidean vector space of dimension 2 (volatile version).
poset_path path(bool xauto_access=true) const
A path to this component.
virtual void * row_dofs()
The row dofs for this instance (mutable version).
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 const tp_lite & static_tp_prototype(int xp)
Static prototype for general tensors of degree xp over this vector space.
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).
poset_path vector_space_path() const
The path of the underlying vector space.
A general antisymmetric tensor of degree 1 over an abstract vector space (volatile version)...
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.
virtual const tp_lite & tp_prototype(int xp) const
Prototype for general tensors of degree xp over this vector space.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
A tensor of degree 4 over a Euclidean vector space of dimension 2 (persistent version).
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile 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.
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).
static tp * new_tp(tp_space &xvector_space, int xp)
Static constructor for general tensors of degree xp over vector space xvector_space.
virtual const std::string & class_name() const
The name of this class.
e2_lite()
Default constructor.
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.
bool operator==(const e2_lite &xother) const
True if this has the same components as xother.
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).
bool invariant() const
Class invariant.
A space of scalars viewed as an antisymmetric tensor space of degree 0.
Euclidean vector space of dimension 2 (volatile version).
An abstract antisymmetric tensor space of degree p.
virtual ~e2_lite()
Destructor.
static host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path<e2>(xsuffix). Returns the host if it already exists...
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 volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
e2 & operator=(const row_dofs_type &xrdt)
Assignment to an instance of the associated row dofs type.
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
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 scalar viewed as an antisymmetric tensor of degree 0. As the degree is 0 there is nothing to be sym...
static atp * new_atp(tp_space &xvector_space, int xp)
Static constructor for antisymmetric 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.
Antisymetric tensor of degree 0 (volatile version).
SHEAF_DLL_SPEC vd_value_type perp_dot(const e2_lite &x0, const e2_lite &x1)
The perp-dot pseudo cross product of x0 with x1 (version for persistent types).
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 const std::string & static_class_name()
The name of this class.
vd_dof_type dof_type
The type of the degrees of freedom.
e2_lite & operator=(const e2_lite &xother)
Assignment operator.
A symmetric rank 3 tensor over a 3D Euclidean vector space (persistent version).
virtual std::string name() const
The name of this poset.
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...
bool invariant() const
Class invariant.
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
virtual e2_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
static stp * new_stp(tp_space &xvector_space, int xp)
Static constructor for symmetric tensors of degree xp over vector space xvector_space.
bool contains_poset(pod_index_type xhub_id, bool xauto_access=true) const
True if this contains a poset with hub id xhub_id..
A symmetric rank 4 tensor over a Euclidean vector space of dimension 3. (volatile version)...
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.
row_dofs_type _row_dofs
Row_dofs_type.
virtual e2 * clone() const
Make a new handle, no state instance of current.
poset_path scalar_space_path() const
The path of the underlying space of scalars.
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, const poset_path &xscalar_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...
static const atp_lite & static_atp_prototype(int xp)
Static prototype for antisymmetric tensors of degree xp over this vector space.
namespace_poset * name_space() const
The namespace this poset resides in.
virtual const std::string & class_name() const
The name of this class.
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
virtual const stp_lite & stp_prototype(int xp) const
Prototype for symmetric tensors of degree xp over this vector space.
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.
A symmetric tensor of degree 2 over a Euclidean vector space of dimension 2 (persistent version)...
int dd() const
The dimension of the underlying ("domain") vector space.
bool is_ancestor_of(const any *xother) const
True if other conforms to current.
virtual void put_components(dof_type x_comp, dof_type y_comp)
Set values of the components to the given arguments.
virtual void put_components(const value_type &x_comp, const value_type &y_comp)
Set values of the components to the given arguments.
A symmetric tensor of degree 2 over a Euclidean vector space of dimension 2 (volatile version)...
An abstract client handle for a member of a poset.
A tensor of degree 4 over a Euclidean vector space of dimension 2 (volatile version).
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...
An abstract tensor space of degree p.
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.
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
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...
static const stp_lite & static_stp_prototype(int xp)
Static prototype for symmetric tensors of degree xp over this vector space.
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 int dd() const
Dimension of the underlying vector space.
SHEAF_DLL_SPEC bool isunordered_or_equals(float x1, float x2)
True if isunordered(x1, x2) or x1 == x2.