21 #include "SheafSystem/e4.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/fiber_bundles_namespace.h" 29 #include "SheafSystem/schema_poset_member.h" 30 #include "SheafSystem/stp.h" 31 #include "SheafSystem/wsv_block.h" 96 ensure(unexecutable(*
this == xother));
137 _row_dofs = xrow_dofs;
142 ensure(unexecutable(
row_dofs() == xrow_dofs));
161 put_components(x0, x1, x2, x3);
174 fiber_bundle::e4_lite::
192 fiber_bundle::e4_lite::
221 put_component(0, x0);
222 put_component(1, x1);
223 put_component(2, x2);
224 put_component(3, x3);
344 require((0 <= xp) && (xp <= 1));
370 ensure(unexecutable(
"result.p() == xp"));
381 require(precondition_of(static_tp_prototype(xp)));
385 const tp_lite& result = static_tp_prototype(xp);
389 ensure(postcondition_of(static_tp_prototype(xp)));
402 require((0 <= xp) && (xp <= 1));
428 ensure(unexecutable(
"result.p() == xp"));
439 require(precondition_of(static_atp_prototype(xp)));
443 const atp_lite& result = static_atp_prototype(xp);
447 ensure(postcondition_of(static_atp_prototype(xp)));
460 require((2 <= xp) && (xp <= 4));
469 ensure(unexecutable(
"result.p() == xp"));
480 require(precondition_of(static_stp_prototype(xp)));
484 const stp_lite& result = static_stp_prototype(xp);
488 ensure(postcondition_of(static_stp_prototype(xp)));
525 const string& result = static_class_name();
529 ensure(!result.empty());
544 static const string result(
"e4_lite");
548 ensure(!result.empty());
570 ensure(is_same_type(*result));
594 require(&xother != 0);
600 bool result =
dynamic_cast<const e4_lite*
>(&xother) != 0;
613 if(invariant_check())
617 disable_invariant_check();
621 invariance(ed_lite::invariant());
627 enable_invariant_check();
673 static const poset_path result(standard_schema_poset_name(),
"e4_schema");
694 string lmember_names =
"x DOUBLE false ";
695 lmember_names +=
"y DOUBLE false ";
696 lmember_names +=
"z DOUBLE false";
697 lmember_names +=
"t DOUBLE false";
700 standard_schema_path().member_name(),
701 ed::standard_schema_path(),
730 require(!xhost_path.
empty());
733 require(xschema_path.
full());
735 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
736 require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 4);
744 host_type::new_table(xns, xhost_path, xschema_path, xscalar_space_path, xauto_access);
748 ensure(xns.
owns(result, xauto_access));
749 ensure(result.
path(
true) == xhost_path);
751 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
754 ensure(result.
d(
true) == 4);
756 ensure(result.
p(
true) == 1);
757 ensure(result.
dd(
true) == 4);
776 require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
777 require(standard_host_is_available<e4>(xns, xsuffix, xauto_access));
787 poset_path lscalar_space_path = scalar_type::standard_host(xns, xsuffix, xauto_access).
path(
true);
789 poset_path lpath(standard_host_path<e4>(xsuffix));
798 result_ptr = &new_host(xns, lpath, standard_schema_path(), lscalar_space_path, xauto_access);
805 ensure(xns.
owns(result, xauto_access));
806 ensure(result.
path(
true) == standard_host_path<e4>(xsuffix));
808 ensure(result.
schema(
true).
path(xauto_access) == standard_schema_path());
811 ensure(result.
d(
true) == 4);
813 standard_host_path<scalar_type>(xsuffix) );
814 ensure(result.
p(
true) == 1);
815 ensure(result.
dd(
true) == 4);
860 attach_to_state(xhost, xhub_id);
866 ensure(index() == xhub_id);
867 ensure(is_attached());
882 attach_to_state(xhost, xid.
hub_pod());
888 ensure(index() ==~ xid);
889 ensure(is_attached());
900 require(!xname.empty());
905 attach_to_state(xhost, xname);
911 ensure(name() == xname);
912 ensure(is_attached());
922 require(xother != 0);
926 attach_to_state(xother);
931 ensure(is_attached());
932 ensure(is_same_state(xother));
944 require(precondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
948 new_jim_state(xhost, 0,
false, xauto_access);
952 ensure(postcondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
967 require(precondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
971 new_jim_state(&xhost, 0,
false, xauto_access);
987 ensure(postcondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
1000 require(state_is_read_write_accessible());
1008 ensure_for_all(i, 0, d(), component(i) == xrdt.
components[i]);
1023 require(is_ancestor_of(&xother));
1024 require(precondition_of(attach_to_state(&xother)));
1028 attach_to_state(&xother);
1032 ensure(postcondition_of(attach_to_state(&xother)));
1046 require(precondition_of(attach_to_state(&xother)));
1050 attach_to_state(&xother);
1054 ensure(postcondition_of(attach_to_state(&xother)));
1168 require(state_is_read_write_accessible());
1172 put_component(0, x0);
1173 put_component(1, x1);
1174 put_component(2, x2);
1175 put_component(3, x3);
1179 ensure(invariant());
1240 require((0 <= xp) && (xp <= 1));
1245 const string& lvector_space_name = xvector_space.
name();
1251 const string lname =
1252 create_tensor_space_name(lvector_space_name,
"at0");
1254 at0* result =
new at0(&lhost);
1260 const string lname =
1261 create_tensor_space_name(lvector_space_name,
"e4");
1263 e4* result =
new e4(&lhost);
1274 ensure(unexecutable(
"result.p() == xp"));
1288 require((0 <= xp) && (xp <= 1));
1293 const string& lvector_space_name = xvector_space.
name();
1299 const string lname =
1300 create_tensor_space_name(lvector_space_name,
"at0");
1302 at0* result =
new at0(&lhost);
1308 const string lname =
1309 create_tensor_space_name(lvector_space_name,
"e4");
1311 e4* result =
new e4(&lhost);
1322 ensure(unexecutable(
"result.p() == xp"));
1343 ensure(unexecutable(
"result.p() == xp"));
1357 require(precondition_of(e4::new_tp(vector_space(xauto_access), xp)));
1361 tp* result = e4::new_tp(vector_space(xauto_access), xp);
1365 ensure(postcondition_of(e4::new_tp(vector_space(xauto_access), xp)));
1378 require(precondition_of(e4::new_atp(vector_space(xauto_access), xp)));
1382 atp* result = e4::new_atp(vector_space(xauto_access), xp);
1386 ensure(postcondition_of(e4::new_atp(vector_space(xauto_access), xp)));
1399 require(precondition_of(e4::new_stp(vector_space(xauto_access), xp)));
1403 stp* result = e4::new_stp(vector_space(xauto_access), xp);
1407 ensure(postcondition_of(e4::new_stp(vector_space(xauto_access), xp)));
1433 const string& result = static_class_name();
1437 ensure(!result.empty());
1452 static const string result(
"e4");
1456 ensure(!result.empty());
1474 e4* result =
new e4();
1478 ensure(result != 0);
1505 require(xother != 0);
1512 bool result =
dynamic_cast<const e4*
>(xother) != 0;
1536 invariance(ed::invariant());
1538 if(invariant_check())
1542 disable_invariant_check();
1544 invariance((is_attached() ? d() == 4 :
true));
1548 enable_invariant_check();
1553 ensure(is_derived_query);
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 e4_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
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 void put_components(dof_type x0, dof_type x1, dof_type x2, dof_type x3)
Set values of the components to the given arguments.
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 const std::string & static_class_name()
The name of this class.
An antisymmetric tensor of degree p.
Euclidean vector space of dimension 4 (persistent version).
virtual volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
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...
poset_path path(bool xauto_access=true) const
A path to this component.
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.
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.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
static atp * new_atp(tp_space &xvector_space, int xp)
Static prototype for antisymmetric tensors of degree xp over this vector space.
bool is_ancestor_of(const any *xother) const
True if other conforms to current.
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.
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
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.
Abstract base class with useful features for all volatile objects.
Abstract base class with useful features for all objects.
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...
T components[4]
The components (row_dofs).
virtual const atp_lite & atp_prototype(int xp) const
Prototype for antisymmetric tensors of degree xp over this vector space.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
e4_lite()
Default constructor.
bool operator==(const e4_lite &xother) const
True if this has the same components as xother.
A space of scalars viewed as an antisymmetric tensor space of degree 0.
e4 & operator=(const row_dofs_type &xrdt)
Assignment to an instance of the associated row dofs type.
static const stp_lite & static_stp_prototype(int xp)
Static prototype for symmetric tensors of degree xp over this vector space.
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.
virtual void * row_dofs()
The row dofs for this instance (mutable version).
bool invariant() const
Class invariant.
A scalar viewed as an antisymmetric tensor of degree 0. As the degree is 0 there is nothing to be sym...
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).
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
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 ~e4_lite()
Destructor.
static const atp_lite & static_atp_prototype(int xp)
Static prototype for antisymmetric tensors of degree xp over this vector space.
Euclidean vector space of dimension 4 (volatile 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...
e4_lite & operator=(const e4_lite &xother)
Assignment operator.
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.
row_dofs_type _row_dofs
Row_dofs_type.
poset_path scalar_space_path() const
The path of the underlying space of scalars.
virtual const tp_lite & tp_prototype(int xp) const
Prototype for general tensors of degree xp over this vector space.
namespace_poset * name_space() const
The namespace this poset resides in.
virtual int dd() const
Dimension of the underlying vector space.
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
static stp * new_stp(tp_space &xvector_space, int xp)
Static 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.
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
int_type pod_index_type
The plain old data index type.
int dd() const
The dimension of the underlying ("domain") vector space.
virtual e4 * clone() const
Make a new handle, no state instance of current.
bool invariant() const
Class invariant.
virtual const std::string & class_name() const
The name of this class.
virtual void put_components(const value_type &x0, const value_type &x1, const value_type &x2, const value_type &x3)
Set values of the components to the given arguments.
static tp * new_tp(tp_space &xvector_space, int xp)
Static prototype for general tensors of degree xp over this vector space.
An abstract client handle for a member of a poset.
static const tp_lite & static_tp_prototype(int xp)
Static prototype for general tensors of degree xp over this vector space.
static const std::string & static_class_name()
The name of this class.
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...
static host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path<e4>(xsuffix). Returns the host if it already exists...
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 stp_lite & stp_prototype(int xp) const
Prototype for symmetric 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...
virtual const std::string & class_name() const
The name of this class.
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.