21 #include "SheafSystem/jcb_e13.impl.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/jcb_space.h" 28 #include "SheafSystem/fiber_bundles_namespace.h" 29 #include "SheafSystem/schema_poset_member.h" 30 #include "SheafSystem/wsv_block.h" 91 for(
int i=0; i<ld; ++i)
93 put_component(i, xother[i]);
99 ensure_for_all(i, 0, d(), component(i) == xother[i]);
143 _row_dofs = xrow_dofs;
192 fiber_bundle::jcb_e13_lite::
208 fiber_bundle::jcb_e13_lite::
224 fiber_bundle::jcb_e13_lite::
240 fiber_bundle::jcb_e13_lite::
266 put_components(dxdu, dydu, dzdu);
288 put_component(0, dxdu);
289 put_component(1, dydu);
290 put_component(2, dzdu);
407 const string& result = static_class_name();
411 ensure(!result.empty());
426 static const string result(
"jcb_e13_lite");
430 ensure(!result.empty());
452 ensure(is_same_type(*result));
476 require(&xother != 0);
482 bool result =
dynamic_cast<const jcb_e13_lite*
>(&xother) != 0;
495 if(invariant_check())
499 disable_invariant_check();
503 invariance(jcb_ed_lite::invariant());
509 enable_invariant_check();
555 static const poset_path result(standard_schema_poset_name(),
"jcb_e13_schema");
576 string lmember_names =
"dxdu DOUBLE false ";
577 lmember_names +=
"dydu DOUBLE false ";
578 lmember_names +=
"dzdu DOUBLE false";
581 standard_schema_path().member_name(),
582 jcb_ed::standard_schema_path(),
612 require(!xhost_path.
empty());
615 require(xschema_path.
full());
617 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
618 require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 3);
630 require(host_type::d(xns, xschema_path, xauto_access) == host_type::d(xns, xdomain_path, xrange_path, xauto_access));
638 host_type::new_table(xns, xhost_path, xschema_path, xdomain_path, xrange_path, xauto_access);
642 ensure(xns.
owns(result, xauto_access));
643 ensure(result.path(
true) == xhost_path);
644 ensure(result.state_is_not_read_accessible());
645 ensure(result.schema(
true).path(xauto_access) == xschema_path);
647 ensure(result.factor_ct(
true) == 3);
648 ensure(result.d(
true) == 3);
649 ensure(result.dd(
true) == 1);
650 ensure(result.dr(
true) == 3);
651 ensure(result.domain_path(
true) == xdomain_path);
652 ensure(result.range_path(
true) == xrange_path);
654 ensure(result.scalar_space_path(
true) ==
656 ensure(result.scalar_space_path(
true) ==
675 require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
676 require(standard_host_is_available<jcb_e13>(xns, xsuffix, xauto_access));
687 poset_path ldomain_space_path = domain_type::standard_host(xns, xsuffix, xauto_access).
path(
true);
691 poset_path lrange_space_path = range_type::standard_host(xns, xsuffix, xauto_access).
path(
true);
693 poset_path lpath(standard_host_path<jcb_e13>(xsuffix));
702 result_ptr = &new_host(xns, lpath, standard_schema_path(), ldomain_space_path, lrange_space_path, xauto_access);
709 ensure(xns.
owns(result, xauto_access));
710 ensure(result.
path(
true) == standard_host_path<jcb_e13>(xsuffix));
712 ensure(result.
schema(
true).
path(xauto_access) == standard_schema_path());
715 ensure(result.
d(
true) == 3);
716 ensure(result.
dd(
true) == 1);
717 ensure(result.
dr(
true) == 3);
718 ensure(result.
domain_path(
true) == standard_host_path<domain_type>(xsuffix));
719 ensure(result.
range_path(
true) == standard_host_path<range_type>(xsuffix));
721 ensure(result.
scalar_space_path(
true) == standard_host_path<domain_type::scalar_type>(xsuffix));
722 ensure(result.
scalar_space_path(
true) == standard_host_path<range_type::scalar_type>(xsuffix));
766 attach_to_state(xhost, xhub_id);
772 ensure(index() == xhub_id);
773 ensure(is_attached());
787 attach_to_state(xhost, xid.
hub_pod());
793 ensure(index() ==~ xid);
794 ensure(is_attached());
805 require(!xname.empty());
810 attach_to_state(xhost, xname);
816 ensure(name() == xname);
817 ensure(is_attached());
827 require(xother != 0);
831 attach_to_state(xother);
836 ensure(is_attached());
837 ensure(is_same_state(xother));
847 require(precondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
851 new_jim_state(xhost, 0,
false, xauto_access);
855 ensure(postcondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
870 require(precondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
874 new_jim_state(&xhost, 0,
false, xauto_access);
890 ensure(postcondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
903 require(state_is_read_write_accessible());
908 for(
int i=0; i<ld; ++i)
915 ensure_for_all(i, 0, d(), component(i) == xrdt.
components[i]);
930 require(is_ancestor_of(&xother));
931 require(precondition_of(attach_to_state(&xother)));
935 attach_to_state(&xother);
939 ensure(postcondition_of(attach_to_state(&xother)));
953 require(precondition_of(attach_to_state(&xother)));
957 attach_to_state(&xother);
961 ensure(postcondition_of(attach_to_state(&xother)));
1027 require(state_is_read_write_accessible());
1031 (*this)[0] = dxdu_comp;
1032 (*this)[1] = dydu_comp;
1033 (*this)[2] = dzdu_comp;
1037 ensure(invariant());
1048 fiber_bundle::jcb_e13::
1064 fiber_bundle::jcb_e13::
1143 const string& result = static_class_name();
1147 ensure(!result.empty());
1162 static const string result(
"jcb_e13");
1166 ensure(!result.empty());
1188 ensure(result != 0);
1215 require(xother != 0);
1222 bool result =
dynamic_cast<const jcb_e13*
>(xother) != 0;
1246 invariance(jcb_ed::invariant());
1248 if (invariant_check())
1252 disable_invariant_check();
1254 invariance((is_attached() ? (dr() == 3) :
true));
1255 invariance((is_attached() ? (dd() == 1) :
true));
1259 enable_invariant_check();
1264 ensure(is_derived_query);
1290 require(xvector.
d(xauto_access) == xjcb.
dd(xauto_access));
1291 require(xresult.
d(xauto_access) == xjcb.
dr(xauto_access));
1308 int num_rows = xjcb.
dr();
1309 int num_cols = xjcb.
dd();
1311 for(
int i=0; i<num_rows; ++i)
1314 for(
int j=0; j<num_cols; ++j)
1348 require(xvector.
d() == xjcb.
dd());
1349 require(xresult.
d() == xjcb.
dr());
1353 require(unexecutable(
"xvector.is_contravariant())"));
1359 int num_rows = xjcb.
dr();
1360 int num_cols = xjcb.
dd();
1362 for(
int i=0; i<num_rows; ++i)
1365 for(
int j=0; j<num_cols; ++j)
1377 ensure(unexecutable(
"xresult.is_contravariant())"));
1390 require(precondition_of(
push(xjcb, xvector, *result)));
1396 push(xjcb, xvector, *result);
1400 ensure(postcondition_of(
push(xjcb, xvector, *result)));
1418 require(xcovector.
d(xauto_access) == xjcb.
dr(xauto_access));
1419 require(xresult.
d(xauto_access) == xjcb.
dd(xauto_access));
1436 int num_rows = xjcb.
dd();
1437 int num_cols = xjcb.
dr();
1439 for(
int i=0; i<num_rows; ++i)
1442 for(
int j=0; j<num_cols; ++j)
1477 require(xcovector.
d() == xjcb.
dr());
1478 require(xresult.
d() == xjcb.
dd());
1482 require(unexecutable(
"xcovector.is_covariant())"));
1488 int num_rows = xjcb.
dd();
1489 int num_cols = xjcb.
dr();
1491 for(
int i=0; i<num_rows; ++i)
1494 for(
int j=0; j<num_cols; ++j)
1505 ensure(unexecutable(
"xresult.is_covariant())"));
1517 require(precondition_of(
pull(xjcb, xcovector, *result)));
1523 pull(xjcb, xcovector, *result);
1527 ensure(postcondition_of(
pull(xjcb, xcovector, *result)));
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 jcb_e13_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
virtual bool is_contravariant(bool xauto_access) const
True if and only if all tensor index positions are contravariant.
virtual const std::string & class_name() const
The name of this class.
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).
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.
void put_is_p_vector(bool xauto_access)
Sets is_p_vector to true; synonym for put_is_contravariant(xauto_access).
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...
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...
jcb_e13()
Default constructor.
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
int dd() const
The dimension of the underlying ("domain") vector space.
Jacobian of a map from a 1 dimensional domain (u) to a 3 dimensional Euclidean space (x...
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.
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 invariant() const
Class invariant.
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...
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".
value_type component(int xindex) const
The xindex-th component.
static const std::string & static_class_name()
The name of this class.
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.
jcb_e13_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
value_type component(int xrow, int xcolumn) const
The component with row index xrow and column index xcolumn.
static host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path<jcb_e13>(xsuffix). Returns the host if it already exists...
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.
virtual void * row_dofs()
The row dofs for this instance (mutable version).
Euclidean vector space of dimension 1 (persistent version).
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
jcb_e13_lite & operator=(const jcb_e13_lite &xother)
Assignment operator.
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.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
virtual ~jcb_e13_lite()
Destructor.
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).
bool is_ancestor_of(const any *xother) const
True if xother conforms to current.
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.
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 void put_components(const value_type &dxdu, const value_type &dydu, const value_type &dzdu)
Set values of the components to the given arguments.
virtual value_type component(int xindex) const
The value of the xi-th component.
Jacobian of a map from a 1 dimensional domain (u) to a 3 dimensional Euclidean space (x...
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...
bool invariant() const
Class invariant.
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.
virtual void put_components(dof_type dxdu_comp, dof_type dydu_comp, dof_type dzdu_comp)
Set values of the components to the given arguments.
poset_path scalar_space_path() const
The path of the underlying space of scalars.
virtual void put_component(dof_type xcomp)
Set value of component.
T components[3]
The dofs in the following order: components[0] => dx/du components[1] => dy/du components[2] => dz/du...
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 dof_type component() const
Get value of component xindex.
virtual volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
poset_path range_path() const
The path of the range vector space.
An abstract space of Jacobians.
virtual jcb_e13 * clone() const
Make a new handle, no state instance of current.
static int factor_ct(int xd)
Factor_ct() as a function of dimension xd.
jcb_e13 & operator=(const row_dofs_type &xrdt)
Assignment to an instance of the associated row dofs type.
int_type pod_index_type
The plain old data index type.
jcb_e13_lite()
Default constructor.
Euclidean vector space of dimension 1 (volatile version).
virtual int dr() const
Dimension of the range.
virtual int d() const
Dimension of this as a vector space.
static const std::string & static_class_name()
The name of this class.
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
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.
vd_dof_type dof_type
The type of the degrees of freedom. Note that although dof_type == value_type in this implementation...
virtual const std::string & class_name() const
The name of this class.
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).
virtual value_type component() const
Value of (the only) component.
Namespace for the fiber_bundles component of the sheaf system.
virtual int dd() const
Dimension of the domain.
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.
virtual void put_component(value_type x_comp)
Set value of (the only) component to x_comp.
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.