23 #include "SheafSystem/met.h" 25 #include "SheafSystem/abstract_poset_member.impl.h" 26 #include "SheafSystem/assert_contract.h" 27 #include "SheafSystem/at0.h" 28 #include "SheafSystem/stp_space.h" 29 #include "SheafSystem/fiber_bundles_namespace.h" 30 #include "SheafSystem/schema_poset_member.h" 31 #include "SheafSystem/wsv_block.h" 131 vd_lite::operator=(xrow_dofs);
135 postcondition_of(vd_lite::operator=(xrow_dofs));
217 const string& result = static_class_name();
221 ensure(!result.empty());
236 static const string result(
"met_lite");
240 ensure(!result.empty());
262 ensure(is_same_type(*result));
286 require(&xother != 0);
292 bool result =
dynamic_cast<const met_lite*
>(&xother) != 0;
305 if(invariant_check())
309 disable_invariant_check();
313 invariance(st2_lite::invariant());
319 enable_invariant_check();
351 static const poset_path result(standard_schema_poset_name(),
"met_schema");
373 standard_schema_path().member_name(),
374 st2::standard_schema_path(),
378 lschema.detach_from_state();
403 require(!xhost_path.
empty());
406 require(xschema_path.
full());
408 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
416 host_type::new_table(xns, xhost_path, xschema_path, 2, xvector_space_path, xauto_access);
420 ensure(xns.
owns(result, xauto_access));
421 ensure(result.
path(
true) == xhost_path);
423 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
425 ensure(result.
factor_ct(
true) == result.
d(
true));
426 ensure(result.
d(
true) == schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access));
428 ensure(result.
p(
true) == 2);
429 ensure(result.
dd(
true) == result.
d(
true));
473 attach_to_state(xhost, xhub_id);
479 ensure(index() == xhub_id);
480 ensure(is_attached());
494 attach_to_state(xhost, xid.
hub_pod());
500 ensure(index() ==~ xid);
501 ensure(is_attached());
512 require(!xname.empty());
517 attach_to_state(xhost, xname);
523 ensure(name() == xname);
524 ensure(is_attached());
534 require(xother != 0);
538 attach_to_state(xother);
543 ensure(is_attached());
544 ensure(is_same_state(xother));
554 require(precondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
558 new_jim_state(xhost, 0,
false, xauto_access);
562 ensure(postcondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
576 require(is_ancestor_of(&xother));
577 require(precondition_of(attach_to_state(&xother)));
581 attach_to_state(&xother);
585 ensure(postcondition_of(attach_to_state(&xother)));
599 require(precondition_of(attach_to_state(&xother)));
603 attach_to_state(&xother);
607 ensure(postcondition_of(attach_to_state(&xother)));
736 const string& result = static_class_name();
740 ensure(!result.empty());
755 static const string result(
"met");
759 ensure(!result.empty());
808 require(xother != 0);
815 bool result =
dynamic_cast<const met*
>(xother) != 0;
839 invariance(st2::invariant());
841 if (invariant_check())
845 disable_invariant_check();
849 enable_invariant_check();
854 ensure(is_derived_query);
875 #include "SheafSystem/error_message.h" 876 #include "SheafSystem/e1.h" 877 #include "SheafSystem/e2.h" 878 #include "SheafSystem/e3.h" 879 #include "SheafSystem/met_e1.h" 880 #include "SheafSystem/met_e2.h" 881 #include "SheafSystem/met_e3.h" 894 require(xcovector.
d(xauto_access) == xmetric.
dd(xauto_access));
895 require(xresult.
d(xauto_access) == xmetric.
dd(xauto_access));
901 const met_e1* met_e1_xmetric =
dynamic_cast<const met_e1*
>(&xmetric);
902 const met_e2* met_e2_xmetric =
dynamic_cast<const met_e2*
>(&xmetric);
903 const met_e3* met_e3_xmetric =
dynamic_cast<const met_e3*
>(&xmetric);
905 const e1* e1_xcovector =
dynamic_cast<const e1*
>(&xcovector);
906 const e2* e2_xcovector =
dynamic_cast<const e2*
>(&xcovector);
907 const e3* e3_xcovector =
dynamic_cast<const e3*
>(&xcovector);
909 e1* e1_xresult =
dynamic_cast<e1*
>(&xresult);
910 e2* e2_xresult =
dynamic_cast<e2*
>(&xresult);
911 e3* e3_xresult =
dynamic_cast<e3*
>(&xresult);
913 if(met_e1_xmetric && e1_xcovector && e1_xresult)
915 raise(*met_e1_xmetric, *e1_xcovector, *e1_xresult, xauto_access);
917 else if(met_e2_xmetric && e2_xcovector && e2_xresult, xauto_access)
919 raise(*met_e2_xmetric, *e2_xcovector, *e2_xresult, xauto_access);
921 else if(met_e3_xmetric && e3_xcovector && e3_xresult, xauto_access)
923 raise(*met_e3_xmetric, *e3_xcovector, *e3_xresult, xauto_access);
927 post_fatal_error_message(\
928 "Unsupported argument types in call to raise(...)");
943 lower(
const met& xmetric,
const ed& xvector,
ed& xresult,
bool xauto_access)
950 require(xvector.
d(xauto_access) == xmetric.
dd(xauto_access));
951 require(xresult.
d(xauto_access) == xmetric.
dd(xauto_access));
957 const met_e1* met_e1_xmetric =
dynamic_cast<const met_e1*
>(&xmetric);
958 const met_e2* met_e2_xmetric =
dynamic_cast<const met_e2*
>(&xmetric);
959 const met_e3* met_e3_xmetric =
dynamic_cast<const met_e3*
>(&xmetric);
961 const e1* e1_xvector =
dynamic_cast<const e1*
>(&xvector);
962 const e2* e2_xvector =
dynamic_cast<const e2*
>(&xvector);
963 const e3* e3_xvector =
dynamic_cast<const e3*
>(&xvector);
965 e1* e1_xresult =
dynamic_cast<e1*
>(&xresult);
966 e2* e2_xresult =
dynamic_cast<e2*
>(&xresult);
967 e3* e3_xresult =
dynamic_cast<e3*
>(&xresult);
969 if(met_e1_xmetric && e1_xvector && e1_xresult)
971 lower(*met_e1_xmetric, *e1_xvector, *e1_xresult, xauto_access);
973 else if(met_e2_xmetric && e2_xvector && e2_xresult, xauto_access)
975 lower(*met_e2_xmetric, *e2_xvector, *e2_xresult, xauto_access);
977 else if(met_e3_xmetric && e3_xvector && e3_xresult, xauto_access)
979 lower(*met_e3_xmetric, *e3_xvector, *e3_xresult, xauto_access);
983 post_fatal_error_message(\
984 "Unsupported argument types in call to lower(...)");
1003 require(xcovector.
d() == xmetric.
dd());
1004 require(xresult.
d() == xmetric.
dd());
1005 require(unexecutable(
"xmetric.is_contravariant())"));
1006 require(unexecutable(
"xcovector.is_covariant())"));
1018 const e1_lite* e1_xcovector =
dynamic_cast<const e1_lite*
>(&xcovector);
1019 const e2_lite* e2_xcovector =
dynamic_cast<const e2_lite*
>(&xcovector);
1020 const e3_lite* e3_xcovector =
dynamic_cast<const e3_lite*
>(&xcovector);
1026 if(met_e1_xmetric && e1_xcovector && e1_xresult)
1028 raise(*met_e1_xmetric, *e1_xcovector, *e1_xresult);
1030 else if(met_e2_xmetric && e2_xcovector && e2_xresult)
1032 raise(*met_e2_xmetric, *e2_xcovector, *e2_xresult);
1034 else if(met_e3_xmetric && e3_xcovector && e3_xresult)
1036 raise(*met_e3_xmetric, *e3_xcovector, *e3_xresult);
1040 post_fatal_error_message(\
1041 "Unsupported argument types in call to raise(...)");
1046 ensure(unexecutable(
"xresult.is_contravariant())"));
1060 require(precondition_of(
raise(xmetric, xcovector, *result)));
1065 raise(xmetric, xcovector, *result);
1069 ensure(postcondition_of(
raise(xmetric, xcovector, *result)));
1083 require(xvector.
d() == xmetric.
dd());
1084 require(xresult.
d() == xmetric.
dd());
1085 require(unexecutable(
"xmetric.is_covariant())"));
1086 require(unexecutable(
"xcovector.is_contravariant())"));
1094 const e1_lite* e1_xvector =
dynamic_cast<const e1_lite*
>(&xvector);
1095 const e2_lite* e2_xvector =
dynamic_cast<const e2_lite*
>(&xvector);
1096 const e3_lite* e3_xvector =
dynamic_cast<const e3_lite*
>(&xvector);
1102 if(met_e1_xmetric && e1_xvector && e1_xresult)
1104 lower(*met_e1_xmetric, *e1_xvector, *e1_xresult);
1106 else if(met_e2_xmetric && e2_xvector && e2_xresult)
1108 lower(*met_e2_xmetric, *e2_xvector, *e2_xresult);
1110 else if(met_e3_xmetric && e3_xvector && e3_xresult)
1112 lower(*met_e3_xmetric, *e3_xvector, *e3_xresult);
1116 post_fatal_error_message(\
1117 "Unsupported argument types in call to lower(...)");
1122 ensure(unexecutable(
"xresult.is_covariant())"));
1136 require(precondition_of(
lower(xmetric, xvector, *result)));
1141 lower(xmetric, xvector, *result);
1145 ensure(postcondition_of(
lower(xmetric, xvector, *result)));
SHEAF_DLL_SPEC void lower(const met &xmetric, const ed &xvector, ed &xresult, bool xauto_access)
Lower vector (pre-allocated version for persistent type).
virtual int dd() const
Dimension of the underlying vector space.
virtual bool is_contravariant(bool xauto_access) const
True if and only if all tensor index positions are contravariant.
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 ...
met()
Default constructor.
virtual int dd() const
Dimension of the underlying vector space.
bool full() const
True if both poset name and member name are not empty.
Euclidean vector space of dimension 3 (volatile version).
A metric tensor over a 1 dimensional Euclidean vector space (volatile version).
Euclidean vector space of dimension 2 (persistent version).
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.
virtual met * clone() const
Make a new handle, no state instance of current.
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.
A metric tensor over a 1 dimensional Euclidean vector space.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
virtual ~met_lite()
Destructor.
bool invariant() const
Class invariant.
A metric tensor over an abstract vector space (volatile version).
Euclidean vector space of dimension 3 (persistent version).
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
virtual bool is_covariant(bool xauto_access) const
True if and only if all tensor index positions are covariant.
Euclidean vector space of dimension 1 (persistent version).
A metric tensor over an abstract vector space (persistent 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...
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).
A metric tensor over a 2 dimensional Euclidean vector space (persistent version). ...
Euclidean vector space of dimension d (volatile version).
A space of scalars viewed as an antisymmetric tensor space of degree 0.
Euclidean vector space of dimension 2 (volatile 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...
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)
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
An index within the external ("client") scope of a given id space.
static const std::string & static_class_name()
The name of this class.
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
met_lite & operator=(const met_lite &xother)
Assignment operator.
A metric tensor over a 1 dimensional Euclidean vector space (volatile version).
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. ...
bool is_ancestor_of(const any *xother) const
True if other conforms to current.
int p(int xd, int xdd) const
Tensor degree as a function of tensor dimension xd and domain dimension xdd.
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
virtual int d() const
Dimension of this as a vector space.
bool empty() const
True if both poset name and member name are empty.
virtual met_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
A metric tensor over a 3 dimensional Euclidean vector space (persistent version). ...
bool contains_poset(pod_index_type xhub_id, bool xauto_access=true) const
True if this contains a poset with hub id xhub_id..
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...
bool invariant() const
Class invariant.
virtual const std::string & class_name() const
The name of this class.
Euclidean vector space of dimension d (peresistent version).
met_lite()
Default constructor.
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.
int dd() const
The dimension of the underlying ("domain") vector space.
virtual met & operator=(const abstract_poset_member &xother)
Assignment operator; synonym for attach_to_state(&xother).
Euclidean vector space of dimension 1 (volatile version).
virtual int d() const
Dimension of this as a vector space.
virtual const std::string & class_name() const
The name of this class.
An abstract client handle for a member of a poset.
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
A metric tensor over a 2 dimensional Euclidean vector space (volatile version).
An abstract symmetric tensor space of degree p.
virtual volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
Namespace for the fiber_bundles component of the sheaf system.
SHEAF_DLL_SPEC void raise(const met &xmetric, const ed &xcovector, ed &xresult, bool xauto_access)
Raise covector (pre-allocated version for persistent type).
Row dofs type for class vd.
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.
static const std::string & static_class_name()
The name of this class.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.