21 #include "SheafSystem/atp.h" 23 #include "SheafSystem/abstract_poset_member.impl.h" 24 #include "SheafSystem/assert_contract.h" 25 #include "SheafSystem/at1.h" 26 #include "SheafSystem/at1_space.h" 27 #include "SheafSystem/atp_space.h" 28 #include "SheafSystem/fiber_bundles_namespace.h" 29 #include "SheafSystem/schema_poset_member.h" 30 #include "SheafSystem/wsv_block.h" 130 vd_lite::operator=(xrow_dofs);
134 postcondition_of(vd_lite::operator=(xrow_dofs));
174 if(!(dd() == 0 && p() == 0))
176 if(dd() >= p() && p() >= 0)
213 static const poset_path result(standard_schema_poset_name(),
"atp_schema");
217 ensure(result.
full());
218 ensure(result.
poset_name() == standard_schema_poset_name());
238 standard_schema_path().member_name(),
239 tp::standard_schema_path(),
243 lschema.detach_from_state();
269 require(!xhost_path.
empty());
272 require(xschema_path.
full());
274 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
281 require(host_type::d(xns, xschema_path, xauto_access) == host_type::d(xns, xp, xvector_space_path, xauto_access));
286 host_type::new_table(xns, xhost_path, xschema_path, xp, xvector_space_path, xauto_access);
290 ensure(xns.
owns(result, xauto_access));
291 ensure(result.
path(
true) == xhost_path);
293 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
295 ensure(result.
factor_ct(
true) == result.
d(
true));
296 ensure(result.
d(
true) == host_type::d(xns, xschema_path, xauto_access));
298 ensure(result.
p(
true) == xp);
327 const string& result = static_class_name();
331 ensure(!result.empty());
346 static const string result(
"atp_lite");
350 ensure(!result.empty());
372 ensure(is_same_type(*result));
396 require(&xother != 0);
402 bool result =
dynamic_cast<const atp_lite*
>(&xother) != 0;
415 if(invariant_check())
419 disable_invariant_check();
423 invariance(tp_lite::invariant());
429 enable_invariant_check();
487 attach_to_state(xhost, xhub_id);
493 ensure(index() == xhub_id);
494 ensure(is_attached());
508 attach_to_state(xhost, xid.
hub_pod());
514 ensure(index() ==~ xid);
515 ensure(is_attached());
526 require(!xname.empty());
531 attach_to_state(xhost, xname);
537 ensure(name() == xname);
538 ensure(is_attached());
548 require(xother != 0);
552 attach_to_state(xother);
557 ensure(is_attached());
558 ensure(is_same_state(xother));
568 require(precondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
572 new_jim_state(xhost, 0,
false, xauto_access);
576 ensure(postcondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
590 require(is_ancestor_of(&xother));
591 require(precondition_of(attach_to_state(&xother)));
595 attach_to_state(&xother);
599 ensure(postcondition_of(attach_to_state(&xother)));
613 require(precondition_of(attach_to_state(&xother)));
617 attach_to_state(&xother);
621 ensure(postcondition_of(attach_to_state(&xother)));
682 require(state_is_auto_read_accessible(xauto_access));
683 require(host()->contains_variance_subposets(xauto_access));
687 bool result = host()->is_p_form(_index, xauto_access);
703 require(state_is_auto_read_write_accessible(xauto_access));
704 require(host()->contains_variance_subposets(xauto_access));
708 host()->put_is_p_form(_index, xauto_access);
712 ensure(is_p_form(xauto_access));
727 require(state_is_auto_read_accessible(xauto_access));
728 require(host()->contains_variance_subposets(xauto_access));
732 bool result = host()->is_p_vector(_index, xauto_access);
747 require(state_is_auto_read_write_accessible(xauto_access));
748 require(host()->contains_variance_subposets(xauto_access));
752 host()->put_is_p_vector(_index, xauto_access);
756 ensure(is_p_vector(xauto_access));
804 const string& result = static_class_name();
808 ensure(!result.empty());
823 static const string result(
"atp");
827 ensure(!result.empty());
849 return reinterpret_cast<host_type*
>(_host);
856 return dynamic_cast<const host_type*
>(xother) != 0;
877 require(xother != 0);
884 bool result =
dynamic_cast<const atp*
>(xother) != 0;
933 invariance(tp::invariant());
935 if(invariant_check())
939 disable_invariant_check();
941 invariance(state_is_read_accessible() ? is_covariant(
false) || is_contravariant(
false) :
true);
945 enable_invariant_check();
950 ensure(is_derived_query);
961 #include "SheafSystem/error_message.h" 962 #include "SheafSystem/at0.h" 963 #include "SheafSystem/e2.h" 964 #include "SheafSystem/e3.h" 965 #include "SheafSystem/at2_e2.h" 966 #include "SheafSystem/at2_e3.h" 967 #include "SheafSystem/at3_e3.h" 984 const e2* e2_x0 =
dynamic_cast<const e2*
>(&x0);
985 const e3* e3_x0 =
dynamic_cast<const e3*
>(&x0);
986 const at2_e2* at2_e2_x0 =
dynamic_cast<const at2_e2*
>(&x0);
987 const at2_e3* at2_e3_x0 =
dynamic_cast<const at2_e3*
>(&x0);
988 const at3_e3* at3_e3_x0 =
dynamic_cast<const at3_e3*
>(&x0);
990 const e2* e2_x1 =
dynamic_cast<const e2*
>(&x1);
991 const e3* e3_x1 =
dynamic_cast<const e3*
>(&x1);
993 at0* at0_xresult =
dynamic_cast<at0*
>(&xresult);
994 e2* e2_xresult =
dynamic_cast<e2*
>(&xresult);
995 e3* e3_xresult =
dynamic_cast<e3*
>(&xresult);
996 at2_e3* at2_e3_xresult =
dynamic_cast<at2_e3*
>(&xresult);
998 if(e2_x0 && e2_x1 && at0_xresult)
1000 hook(*e2_x0, *e2_x1, *at0_xresult, xauto_access);
1002 else if(at2_e2_x0 && e2_x1 && e2_xresult)
1004 hook(*at2_e2_x0, *e2_x1, *e2_xresult, xauto_access);
1006 else if(e3_x0 && e3_x1 && at0_xresult)
1008 hook(*e3_x0, *e3_x1, *at0_xresult, xauto_access);
1010 else if(at2_e3_x0 && e3_x1 && e3_xresult)
1012 hook(*at2_e3_x0, *e3_x1, *e3_xresult, xauto_access);
1014 else if(at3_e3_x0 && e3_x1 && at2_e3_xresult)
1016 hook(*at3_e3_x0, *e3_x1, *at2_e3_xresult, xauto_access);
1020 post_fatal_error_message(\
1021 "Unsupported argument types in call to hook(...)");
1065 if(e2_x0 && e2_x1 && at0_xresult)
1067 hook(*e2_x0, *e2_x1, *at0_xresult);
1069 else if(at2_e2_x0 && e2_x1 && e2_xresult)
1071 hook(*at2_e2_x0, *e2_x1, *e2_xresult);
1073 else if(e3_x0 && e3_x1 && at0_xresult)
1075 hook(*e3_x0, *e3_x1, *at0_xresult);
1077 else if(at2_e3_x0 && e3_x1 && e3_xresult)
1079 hook(*at2_e3_x0, *e3_x1, *e3_xresult);
1081 else if(at3_e3_x0 && e3_x1 && at2_e3_xresult)
1083 hook(*at3_e3_x0, *e3_x1, *at2_e3_xresult);
1087 post_fatal_error_message(\
1088 "Unsupported argument types in call to hook(...)");
1112 require(x0.
dd(xauto_access) == xresult.
dd(xauto_access));
1116 const at2_e2* at2_e2_x0 =
dynamic_cast<const at2_e2*
>(&x0);
1117 const at0* at0_x0 =
dynamic_cast<const at0*
>(&x0);
1118 const e2* e2_x0 =
dynamic_cast<const e2*
>(&x0);
1119 const at2_e3* at2_e3_x0 =
dynamic_cast<const at2_e3*
>(&x0);
1120 const e3* e3_x0 =
dynamic_cast<const e3*
>(&x0);
1121 const at3_e3* at3_e3_x0 =
dynamic_cast<const at3_e3*
>(&x0);
1123 at0* at0_xresult =
dynamic_cast<at0*
>(&xresult);
1124 at2_e2* at2_e2_xresult =
dynamic_cast<at2_e2*
>(&xresult);
1125 e2* e2_xresult =
dynamic_cast<e2*
>(&xresult);
1126 e3* e3_xresult =
dynamic_cast<e3*
>(&xresult);
1127 at2_e3* at2_e3_xresult =
dynamic_cast<at2_e3*
>(&xresult);
1128 at3_e3* at3_e3_xresult =
dynamic_cast<at3_e3*
>(&xresult);
1130 if(at2_e2_x0 && at0_xresult)
1132 star(*at2_e2_x0, *at0_xresult, xauto_access);
1134 else if(at0_x0 && at2_e2_xresult)
1136 star(*at0_x0, *at2_e2_xresult, xauto_access);
1138 else if(e2_x0 && e2_xresult)
1140 star(*e2_x0, *e2_xresult, xauto_access);
1142 else if(at2_e3_x0 && e3_xresult)
1144 star(*at2_e3_x0, *e3_xresult, xauto_access);
1146 else if(e3_x0 && at2_e3_xresult)
1148 star(*e3_x0, *at2_e3_xresult, xauto_access);
1150 else if(at3_e3_x0 && at0_xresult)
1152 star(*at3_e3_x0, *at0_xresult, xauto_access);
1154 else if(at0_x0 && at3_e3_xresult)
1156 star(*at0_x0, *at3_e3_xresult, xauto_access);
1160 post_fatal_error_message(\
1161 "Unsupported argument types in call to star(...)");
1200 if(at2_e2_x0 && at0_xresult)
1202 star(*at2_e2_x0, *at0_xresult);
1204 else if(at0_x0 && at2_e2_xresult)
1206 star(*at0_x0, *at2_e2_xresult);
1208 else if(e2_x0 && e2_xresult)
1210 star(*e2_x0, *e2_xresult);
1212 else if(at2_e3_x0 && e3_xresult)
1214 star(*at2_e3_x0, *e3_xresult);
1216 else if(e3_x0 && at2_e3_xresult)
1218 star(*e3_x0, *at2_e3_xresult);
1220 else if(at3_e3_x0 && at0_xresult)
1222 star(*at3_e3_x0, *at0_xresult);
1224 else if(at0_x0 && at3_e3_xresult)
1226 star(*at0_x0, *at3_e3_xresult);
1230 post_fatal_error_message(\
1231 "Unsupported argument types in call to star(...)");
1252 require(precondition_of(
star(x0, *result)));
1262 ensure(postcondition_of(
star(x0, *result)));
1279 require(x0.
dd(xauto_access) >= xresult.
dd(xauto_access));
1280 require(x1.
dd(xauto_access) >= xresult.
dd(xauto_access));
1281 require(xresult.
p(xauto_access) == x0.
p(xauto_access) + x1.
p(xauto_access));
1285 const e2* e2_x0 =
dynamic_cast<const e2*
>(&x0);
1286 const e3* e3_x0 =
dynamic_cast<const e3*
>(&x0);
1287 const at2_e3* at2_e3_x0 =
dynamic_cast<const at2_e3*
>(&x0);
1289 const e2* e2_x1 =
dynamic_cast<const e2*
>(&x1);
1290 const e3* e3_x1 =
dynamic_cast<const e3*
>(&x1);
1292 at2_e2* at2_e2_xresult =
dynamic_cast<at2_e2*
>(&xresult);
1293 at2_e3* at2_e3_xresult =
dynamic_cast<at2_e3*
>(&xresult);
1294 at3_e3* at3_e3_xresult =
dynamic_cast<at3_e3*
>(&xresult);
1296 if(e2_x0 && e2_x1 && at2_e2_xresult)
1298 wedge(*e2_x0, *e2_x1, *at2_e2_xresult, xauto_access);
1300 else if(e3_x0 && e3_x1 && at2_e3_xresult)
1302 wedge(*e3_x0, *e3_x1, *at2_e3_xresult, xauto_access);
1304 else if(at2_e3_x0 && e3_x1 && at3_e3_xresult)
1306 wedge(*at2_e3_x0, *e3_x1, *at3_e3_xresult, xauto_access);
1310 post_fatal_error_message(\
1311 "Unsupported argument types in call to wedge(...)");
1332 require(x0.
dd() == x1.
dd());
1333 require(x0.
dd() == xresult.
dd());
1334 require(xresult.
p() == x0.
p() + x1.
p());
1353 if(e2_x0 && e2_x1 && at2_e2_xresult)
1355 wedge(*e2_x0, *e2_x1, *at2_e2_xresult);
1357 else if(e3_x0 && e3_x1 && at2_e3_xresult)
1359 wedge(*e3_x0, *e3_x1, *at2_e3_xresult);
1361 else if(at2_e3_x0 && e3_x1 && at3_e3_xresult)
1363 wedge(*at2_e3_x0, *e3_x1, *at3_e3_xresult);
1367 post_fatal_error_message(\
1368 "Unsupported argument types in call to hook(...)");
virtual int dd() const
Dimension of the underlying vector space.
atp_lite & operator=(const atp_lite &xother)
Assignment operator.
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 int dd() const
Dimension of the underlying vector space.
bool full() const
True if both poset name and member name are not empty.
virtual int p() const
The degree of the tensors in host(); the sum of the contravariant and covariant degrees.
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 2 (persistent version)...
An antisymmetric tensor of degree p.
void put_is_p_vector(bool xauto_access)
Sets is_p_vector to true; synonym for put_is_contravariant(xauto_access).
Euclidean vector space of dimension 3 (volatile version).
static const std::string & static_class_name()
The name of this class.
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 host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, int xp, 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 ~atp()
Destructor.
Euclidean vector space of dimension 2 (persistent version).
An antisymmetric rank 3 tensor over a Euclidean vector space of dimension 3. (volatile version)...
poset_path path(bool xauto_access=true) const
A path to this component.
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 3. (persistent version)...
virtual ~atp_lite()
Destructor.
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 bool host_is_ancestor_of(const poset_state_handle *other) const
True if other conforms to host.
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 path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
bool is_ancestor_of(const any *xother) const
True if xother 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.
SHEAF_DLL_SPEC unsigned int binomial_coefficient(unsigned int xi, unsigned int xj)
Binomial coefficient (xi, xj).
host_type * host() const
The poset this is a member of.
bool invariant() const
Class invariant.
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 2 (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 int p() const
The degree of the tensor; the sum of the contravariant and covariant degrees.
An antisymmetric tensor of degree p over an abstract vector space (volatile version).
Abstract base class with useful features for all volatile objects.
An antisymmetric rank 3 tensor over a 3D Euclidean vector space.
Abstract base class with useful features for all objects.
SHEAF_DLL_SPEC void wedge(const e2 &x0, const e2 &x1, at2_e2 &xresult, bool xauto_access)
The exterior (wedge) product of two antisymmetric tensors (pre-allocated version for persistent types...
SHEAF_DLL_SPEC void hook(const e2 &x0, const e2 &x1, at0 &xresult, bool xauto_access)
The interior (hook) product of two antisymmetric tensors (pre-allocated version for persistent types)...
static const std::string & static_class_name()
The name of this class.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
virtual atp & operator=(const abstract_poset_member &xother)
Assignment operator; synonym for attach_to_state(&xother).
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
Euclidean vector space of dimension 2 (volatile version).
An abstract antisymmetric tensor space of degree p.
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...
atp_lite()
Default constructor.
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)
atp()
Default constructor.
An index within the external ("client") scope of a given id space.
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...
std::string poset_name() const
The poset name part of the path.
virtual const std::string & class_name() const
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.
bool is_p_form(bool xauto_access) const
True if this is a p-form; synonym for is_covariant(xauto_access).
Antisymetric tensor of degree 0 (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. ...
int p(int xd, int xdd) const
Tensor degree as a function of tensor dimension xd and domain dimension xdd.
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 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..
poset_path scalar_space_path() const
The path of the underlying space of scalars.
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
virtual atp_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
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 volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
bool is_p_vector(bool xauto_access) const
True if this is a p-vector; synonym for is_contravariant(xauto_access).
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 3. (volatile version)...
virtual atp * clone() const
Make a new handle, no state instance of current.
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
An abstract client handle for a member of a poset.
void put_is_p_form(bool xauto_access)
Sets is_p_form to true; synonym for put_is_covariant(xauto_access).
Namespace containing the vector algrebra functions for the fiber_bundles component of the sheaf syste...
Namespace for the fiber_bundles component of the sheaf system.
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
Row dofs type for class vd.
SHEAF_DLL_SPEC void star(const at2_e2 &x0, at0 &xresult, bool xauto_access)
The Hodge star operator for antisymmetric tensors (pre-allocated version persistent types)...
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 poset_path & standard_schema_path()
The path to the standard schema for this class.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.