21 #include "SheafSystem/jcb_e23.impl.h" 23 #include "SheafSystem/abstract_poset_member.impl.h" 24 #include "SheafSystem/assert_contract.h" 25 #include "SheafSystem/at1_space.h" 26 #include "SheafSystem/e2.h" 27 #include "SheafSystem/e3.h" 28 #include "SheafSystem/jcb_space.h" 29 #include "SheafSystem/fiber_bundles_namespace.h" 30 #include "SheafSystem/schema_poset_member.h" 31 #include "SheafSystem/st2_e2.h" 32 #include "SheafSystem/wsv_block.h" 95 ensure_for_all(i, 0, d(), component(i) == xother[i]);
156 _row_dofs = xrow_dofs;
189 fiber_bundle::jcb_e23_lite::
205 fiber_bundle::jcb_e23_lite::
221 fiber_bundle::jcb_e23_lite::
238 fiber_bundle::jcb_e23_lite::
263 put_components(dxdu, dxdv, dydu, dydv, dzdu, dzdv);
288 put_component(0, dxdu);
289 put_component(1, dxdv);
290 put_component(2, dydu);
291 put_component(3, dydv);
292 put_component(4, dzdu);
293 put_component(5, dzdv);
413 const string& result = static_class_name();
417 ensure(!result.empty());
432 static const string result(
"jcb_e23_lite");
436 ensure(!result.empty());
458 ensure(is_same_type(*result));
482 require(&xother != 0);
488 bool result =
dynamic_cast<const jcb_e23_lite*
>(&xother) != 0;
501 if(invariant_check())
505 disable_invariant_check();
509 invariance(jcb_ed_lite::invariant());
515 enable_invariant_check();
561 static const poset_path result(standard_schema_poset_name(),
"jcb_e23_schema");
582 string lmember_names =
"dxdu DOUBLE false ";
583 lmember_names +=
"dxdv DOUBLE false ";
584 lmember_names +=
"dydu DOUBLE false ";
585 lmember_names +=
"dydv DOUBLE false ";
586 lmember_names +=
"dzdu DOUBLE false ";
587 lmember_names +=
"dzdv DOUBLE false";
590 standard_schema_path().member_name(),
591 jcb_ed::standard_schema_path(),
621 require(!xhost_path.
empty());
624 require(xschema_path.
full());
626 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
627 require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 6);
639 require(host_type::d(xns, xschema_path, xauto_access) == host_type::d(xns, xdomain_path, xrange_path, xauto_access));
647 host_type::new_table(xns, xhost_path, xschema_path, xdomain_path, xrange_path, xauto_access);
651 ensure(xns.
owns(result, xauto_access));
652 ensure(result.path(
true) == xhost_path);
653 ensure(result.state_is_not_read_accessible());
654 ensure(result.schema(
true).path(xauto_access) == xschema_path);
656 ensure(result.factor_ct(
true) == 6);
657 ensure(result.d(
true) == 6);
658 ensure(result.dd(
true) == 2);
659 ensure(result.dr(
true) == 3);
660 ensure(result.domain_path(
true) == xdomain_path);
661 ensure(result.range_path(
true) == xrange_path);
663 ensure(result.scalar_space_path(
true) ==
665 ensure(result.scalar_space_path(
true) ==
684 require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
685 require(standard_host_is_available<jcb_e23>(xns, xsuffix, xauto_access));
696 poset_path ldomain_space_path = domain_type::standard_host(xns, xsuffix, xauto_access).
path(
true);
700 poset_path lrange_space_path = range_type::standard_host(xns, xsuffix, xauto_access).
path(
true);
702 poset_path lpath(standard_host_path<jcb_e23>(xsuffix));
711 result_ptr = &new_host(xns, lpath, standard_schema_path(), ldomain_space_path, lrange_space_path, xauto_access);
718 ensure(xns.
owns(result, xauto_access));
719 ensure(result.
path(
true) == standard_host_path<jcb_e23>(xsuffix));
721 ensure(result.
schema(
true).
path(xauto_access) == standard_schema_path());
724 ensure(result.
d(
true) == 6);
725 ensure(result.
dd(
true) == 2);
726 ensure(result.
dr(
true) == 3);
727 ensure(result.
domain_path(
true) == standard_host_path<domain_type>(xsuffix));
728 ensure(result.
range_path(
true) == standard_host_path<range_type>(xsuffix));
730 ensure(result.
scalar_space_path(
true) == standard_host_path<domain_type::scalar_type>(xsuffix));
731 ensure(result.
scalar_space_path(
true) == standard_host_path<domain_type::scalar_type>(xsuffix));
776 attach_to_state(xhost, xhub_id);
782 ensure(index() == xhub_id);
783 ensure(is_attached());
797 attach_to_state(xhost, xid.
hub_pod());
803 ensure(index() ==~ xid);
804 ensure(is_attached());
815 require(!xname.empty());
820 attach_to_state(xhost, xname);
826 ensure(name() == xname);
827 ensure(is_attached());
837 require(xother != 0);
841 attach_to_state(xother);
846 ensure(is_attached());
847 ensure(is_same_state(xother));
857 require(precondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
861 new_jim_state(xhost, 0,
false, xauto_access);
865 ensure(postcondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
880 require(precondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
884 new_jim_state(&xhost, 0,
false, xauto_access);
900 ensure(postcondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
913 require(state_is_read_write_accessible());
921 ensure_for_all(i, 0, d(), component(i) == xrdt.
components[i]);
936 require(is_ancestor_of(&xother));
937 require(precondition_of(attach_to_state(&xother)));
941 attach_to_state(&xother);
945 ensure(postcondition_of(attach_to_state(&xother)));
959 require(precondition_of(attach_to_state(&xother)));
963 attach_to_state(&xother);
967 ensure(postcondition_of(attach_to_state(&xother)));
1026 fiber_bundle::jcb_e23::
1042 fiber_bundle::jcb_e23::
1121 const string& result = static_class_name();
1125 ensure(!result.empty());
1140 static const string result(
"jcb_e23");
1144 ensure(!result.empty());
1166 ensure(result != 0);
1193 require(xother != 0);
1200 bool result =
dynamic_cast<const jcb_e23*
>(xother) != 0;
1224 invariance(jcb_ed::invariant());
1226 if (invariant_check())
1230 disable_invariant_check();
1232 invariance(is_attached() ? (dr() == 3) :
true);
1233 invariance(is_attached() ? (dd() == 2) :
true);
1237 enable_invariant_check();
1242 ensure(is_derived_query);
1268 require(xvector.
d(xauto_access) == xjcb.
dd(xauto_access));
1269 require(xresult.
d(xauto_access) == xjcb.
dr(xauto_access));
1286 int num_rows = xjcb.
dr();
1287 int num_cols = xjcb.
dd();
1289 for(
int i=0; i<num_rows; ++i)
1292 for(
int j=0; j<num_cols; ++j)
1328 require(xvector.
d() == xjcb.
dd());
1329 require(xresult.
d() == xjcb.
dr());
1333 require(unexecutable(
"xvector.is_contravariant())"));
1339 int num_rows = xjcb.
dr();
1340 int num_cols = xjcb.
dd();
1342 for(
int i=0; i<num_rows; ++i)
1345 for(
int j=0; j<num_cols; ++j)
1356 ensure(unexecutable(
"xresult.is_contravariant())"));
1370 require(precondition_of(
push(xjcb, xvector, *result)));
1376 push(xjcb, xvector, *result);
1380 ensure(postcondition_of(
push(xjcb, xvector, *result)));
1398 require(xcovector.
d(xauto_access) == xjcb.
dr(xauto_access));
1399 require(xresult.
d(xauto_access) == xjcb.
dd(xauto_access));
1416 int num_rows = xjcb.
dd();
1417 int num_cols = xjcb.
dr();
1419 for(
int i=0; i<num_rows; ++i)
1422 for(
int j=0; j<num_cols; ++j)
1458 require(xcovector.
d() == xjcb.
dr());
1459 require(xresult.
d() == xjcb.
dd());
1460 require(unexecutable(
"xcovector.is_covariant())"));
1466 int num_rows = xjcb.
dd();
1467 int num_cols = xjcb.
dr();
1469 for(
int i=0; i<num_rows; ++i)
1472 for(
int j=0; j<num_cols; ++j)
1483 ensure(unexecutable(
"xresult.is_covariant())"));
1497 require(precondition_of(
pull(xjcb, xcovector, *result)));
1503 pull(xjcb, xcovector, *result);
1507 ensure(postcondition_of(
pull(xjcb, xcovector, *result)));
1529 xresult[0] = xjcb[0]*xjcb[0] + xjcb[2]*xjcb[2] + xjcb[4]*xjcb[4];
1530 xresult[1] = xjcb[0]*xjcb[1] + xjcb[2]*xjcb[3] + xjcb[4]*xjcb[5];
1531 xresult[2] = xjcb[1]*xjcb[1] + xjcb[3]*xjcb[3] + xjcb[5]*xjcb[5];
1549 xresult[0] = xjcb[0]*xother_jcb[0]+xjcb[2]*xother_jcb[2]+xjcb[4]*xother_jcb[4];
1552 ( xjcb[0]*xother_jcb[1] + xjcb[2]*xother_jcb[3] + xjcb[4]*xother_jcb[5]
1553 + xjcb[1]*xother_jcb[0] + xjcb[3]*xother_jcb[2] + xjcb[5]*xother_jcb[4] )/2;
1555 xresult[2] = xjcb[1]*xother_jcb[1]+xjcb[3]*xother_jcb[3]+xjcb[5]*xother_jcb[5];
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...
jcb_e23 & operator=(const row_dofs_type &xrdt)
Assignment to an instance of the associated row dofs type.
virtual bool is_contravariant(bool xauto_access) const
True if and only if all tensor index positions are contravariant.
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
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 ...
value_type component(int xrow, int xcolumn) const
The value of the component in a specified row and column (const version).
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
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.
jcb_e23_lite & operator=(const jcb_e23_lite &xother)
Assignment operator.
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 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...
row_dofs_type _row_dofs
Row_dofs_type.
Euclidean vector space of dimension 2 (persistent version).
Jacobian of a map from a 2 dimensional domain (u, v) to a 3 dimensional Euclidean space (x...
int dd() const
The dimension of the underlying ("domain") vector 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.
static const std::string & static_class_name()
The name of this class.
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...
T components[6]
The dofs in the following order: components[0] => dx/du components[1] => dx/dv components[2] => dy/du...
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
jcb_e23_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
virtual int dr() const
Dimension of the range.
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.
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
SHEAF_DLL_SPEC void symmetric_dot_push(const jcb_e23_lite &xjcb, const jcb_e23_lite &xother_jcb, st2_e2_lite &xresult)
Transpose of xjcb times xother_jcb, symmetric part.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
value_type component(int xindex) const
The xindex-th component.
virtual void get_read_access() const
Get read access to the state associated with 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.
value_type component(int xrow, int xcolumn) const
The component with row index xrow and column index xcolumn.
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).
bool is_ancestor_of(const any *xother) const
True if xother conforms to current.
virtual const std::string & class_name() const
The name of this class.
virtual bool is_covariant(bool xauto_access) const
True if and only if all tensor index positions are covariant.
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...
Abstract base class with useful features for all volatile objects.
Abstract base class with useful features for all objects.
bool invariant() const
Class invariant.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
virtual volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
virtual void * row_dofs()
The row dofs for this instance (mutable version).
Euclidean vector space of dimension 2 (volatile version).
static host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path<jcbE_e23>(xsuffix). Returns the host if it already exists...
static const std::string & static_class_name()
The name of this class.
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)
Abstract jacobian class (volatile version).
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 jcb_e23_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
virtual int dd() const
Dimension of the domain.
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.
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. ...
virtual value_type component(int xindex) const
The value of the xi-th component.
SHEAF_DLL_SPEC void metric(const jcb_e23_lite &xjcb, st2_e2_lite &xresult)
Compute surface metric.
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 void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
jcb_e23()
Default constructor.
SHEAF_DLL_SPEC void pull(const jcb &xjcb, const at1 &xcovector, at1 &xresult, bool xauto_access)
Pull covector back (pre-allocated version for persistent types).
poset_path domain_path() const
The path of the domain vector 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..
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.
virtual int dd() const
Dimension of the domain.
poset_path scalar_space_path() const
The path of the underlying space of scalars.
Jacobian of a map from a 2 dimensional domain (u, v) to a 3 dimensional Euclidean space (x...
bool invariant() const
Class 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...
void put_component(int xindex, value_type xcomp)
Set the xindex-th component to xcomp.
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 jacobian dimension implied by the schema specified by xschema_path.
virtual void put_components(const value_type &dxdu, const value_type &dxdv, const value_type &dydu, const value_type &dydv, const value_type &dzdu, const value_type &dzdv)
Set values of the components to the given arguments.
poset_path range_path() const
The path of the range vector space.
An abstract space of Jacobians.
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.
jcb_e23_lite()
Default constructor.
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, const poset_path &xdomain_path, const poset_path &xrange_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 jcb_e23 * clone() const
Make a new handle, no state instance of current.
virtual int d() const
Dimension of this as a vector space.
A symmetric tensor of degree 2 over a Euclidean vector space of dimension 2 (volatile version)...
virtual int dr() const
Dimension of the range.
virtual int dr() const
Dimension of the range.
An abstract client handle for a member of a poset.
std::string path() const
The full path as a string.
SHEAF_DLL_SPEC void push(const jcb &xjcb, const at1 &xvector, at1 &xresult, bool xauto_access)
Push vector forward (pre-allocated version for persistent types).
virtual void put_component(int xindex, value_type xvalue)
Sets the value of the xindex-th component to xvalue.
void put_is_p_form(bool xauto_access)
Sets is_p_form to true; synonym for put_is_covariant(xauto_access).
Namespace for the fiber_bundles component of the sheaf system.
virtual ~jcb_e23_lite()
Destructor.
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.
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.
SHEAF_DLL_SPEC bool isunordered_or_equals(float x1, float x2)
True if isunordered(x1, x2) or x1 == x2.