21 #include "SheafSystem/jcb_e33.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/e3.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" 95 ensure_for_all(i, 0, d(), component(i) == xother[i]);
155 _row_dofs = xrow_dofs;
188 fiber_bundle::jcb_e33_lite::
204 fiber_bundle::jcb_e33_lite::
220 fiber_bundle::jcb_e33_lite::
236 fiber_bundle::jcb_e33_lite::
264 put_components(dxdu, dxdv, dxdw, dydu, dydv, dydw, dzdu, dzdv, dzdw);
298 put_component(0, dxdu);
299 put_component(1, dxdv);
300 put_component(2, dxdw);
301 put_component(3, dydu);
302 put_component(4, dydv);
303 put_component(5, dydw);
304 put_component(6, dzdu);
305 put_component(7, dzdv);
306 put_component(8, dzdw);
429 const string& result = static_class_name();
433 ensure(!result.empty());
448 static const string result(
"jcb_e33_lite");
452 ensure(!result.empty());
474 ensure(is_same_type(*result));
498 require(&xother != 0);
504 bool result =
dynamic_cast<const jcb_e33_lite*
>(&xother) != 0;
517 if(invariant_check())
521 disable_invariant_check();
525 invariance(jcb_ed_lite::invariant());
531 enable_invariant_check();
577 static const poset_path result(standard_schema_poset_name(),
"jcb_e33_schema");
598 string lmember_names =
"dxdu DOUBLE false ";
599 lmember_names +=
"dxdv DOUBLE false ";
600 lmember_names +=
"dxdw DOUBLE false ";
601 lmember_names +=
"dydu DOUBLE false ";
602 lmember_names +=
"dydv DOUBLE false ";
603 lmember_names +=
"dydw DOUBLE false ";
604 lmember_names +=
"dzdu DOUBLE false ";
605 lmember_names +=
"dzdv DOUBLE false ";
606 lmember_names +=
"dzdw DOUBLE false";
609 standard_schema_path().member_name(),
610 jcb_ed::standard_schema_path(),
640 require(!xhost_path.
empty());
643 require(xschema_path.
full());
645 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
646 require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 9);
658 require(host_type::d(xns, xschema_path, xauto_access) == host_type::d(xns, xdomain_path, xrange_path, xauto_access));
666 host_type::new_table(xns, xhost_path, xschema_path, xdomain_path, xrange_path, xauto_access);
670 ensure(xns.
owns(result, xauto_access));
671 ensure(result.path(
true) == xhost_path);
672 ensure(result.state_is_not_read_accessible());
673 ensure(result.schema(
true).path(xauto_access) == xschema_path);
675 ensure(result.factor_ct(
true) == 9);
676 ensure(result.d(
true) == 9);
677 ensure(result.dd(
true) == 3);
678 ensure(result.dr(
true) == 3);
679 ensure(result.domain_path(
true) == xdomain_path);
680 ensure(result.range_path(
true) == xrange_path);
682 ensure(result.scalar_space_path(
true) ==
684 ensure(result.scalar_space_path(
true) ==
703 require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
704 require(standard_host_is_available<jcb_e33>(xns, xsuffix, xauto_access));
715 poset_path ldomain_space_path = domain_type::standard_host(xns, xsuffix, xauto_access).
path(
true);
719 poset_path lrange_space_path = range_type::standard_host(xns, xsuffix, xauto_access).
path(
true);
721 poset_path lpath(standard_host_path<jcb_e33>(xsuffix));
730 result_ptr = &new_host(xns, lpath, standard_schema_path(), ldomain_space_path, lrange_space_path, xauto_access);
737 ensure(xns.
owns(result, xauto_access));
738 ensure(result.
path(
true) == standard_host_path<jcb_e33>(xsuffix));
740 ensure(result.
schema(
true).
path(xauto_access) == standard_schema_path());
743 ensure(result.
d(
true) == 9);
744 ensure(result.
dd(
true) == 3);
745 ensure(result.
dr(
true) == 3);
746 ensure(result.
domain_path(
true) == standard_host_path<domain_type>(xsuffix));
747 ensure(result.
range_path(
true) == standard_host_path<range_type>(xsuffix));
749 ensure(result.
scalar_space_path(
true) == standard_host_path<domain_type::scalar_type>(xsuffix));
750 ensure(result.
scalar_space_path(
true) == standard_host_path<domain_type::scalar_type>(xsuffix));
793 attach_to_state(xhost, xhub_id);
799 ensure(index() == xhub_id);
800 ensure(is_attached());
814 attach_to_state(xhost, xid.
hub_pod());
820 ensure(index() ==~ xid);
821 ensure(is_attached());
832 require(!xname.empty());
837 attach_to_state(xhost, xname);
843 ensure(name() == xname);
844 ensure(is_attached());
854 require(xother != 0);
858 attach_to_state(xother);
863 ensure(is_attached());
864 ensure(is_same_state(xother));
874 require(precondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
878 new_jim_state(xhost, 0,
false, xauto_access);
882 ensure(postcondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
897 require(precondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
901 new_jim_state(&xhost, 0,
false, xauto_access);
917 ensure(postcondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
930 require(state_is_read_write_accessible());
935 for(
int i=0; i<ld; ++i)
942 ensure_for_all(i, 0, d(), component(i) == xrdt.
components[i]);
957 require(is_ancestor_of(&xother));
958 require(precondition_of(attach_to_state(&xother)));
962 attach_to_state(&xother);
966 ensure(postcondition_of(attach_to_state(&xother)));
980 require(precondition_of(attach_to_state(&xother)));
984 attach_to_state(&xother);
988 ensure(postcondition_of(attach_to_state(&xother)));
1047 fiber_bundle::jcb_e33::
1063 fiber_bundle::jcb_e33::
1142 const string& result = static_class_name();
1146 ensure(!result.empty());
1161 static const string result(
"jcb_e33");
1165 ensure(!result.empty());
1187 ensure(result != 0);
1214 require(xother != 0);
1221 bool result =
dynamic_cast<const jcb_e33*
>(xother) != 0;
1245 invariance(jcb_ed::invariant());
1247 if (invariant_check())
1251 disable_invariant_check();
1253 invariance(is_attached() ? (dr() == 3) :
true);
1254 invariance(is_attached() ? (dd() == 3) :
true);
1258 enable_invariant_check();
1263 ensure(is_derived_query);
1288 require(xvector.
d(xauto_access) == xjcb.
dd(xauto_access));
1289 require(xresult.
d(xauto_access) == xjcb.
dr(xauto_access));
1306 int num_rows = xjcb.
dr();
1307 int num_cols = xjcb.
dd();
1309 for(
int i=0; i<num_rows; ++i)
1312 for(
int j=0; j<num_cols; ++j)
1353 require(xvector.
d() == xjcb.
dd());
1354 require(xresult.
d() == xjcb.
dr());
1358 require(unexecutable(
"xvector.is_contravariant())"));
1359 require(unexecutable(
"xresult.is_contravariant())"));
1365 int num_rows = xjcb.
dr();
1366 int num_cols = xjcb.
dd();
1368 for(
int i=0; i<num_rows; ++i)
1371 for(
int j=0; j<num_cols; ++j)
1392 require(precondition_of(
push(xjcb, xvector, *result)));
1398 push(xjcb, xvector, *result);
1402 ensure(postcondition_of(
push(xjcb, xvector, *result)));
1419 require(xcovector.
d(xauto_access) == xjcb.
dr(xauto_access));
1420 require(xresult.
d(xauto_access) == xjcb.
dd(xauto_access));
1437 int num_rows = xjcb.
dd();
1438 int num_cols = xjcb.
dr();
1440 for(
int i=0; i<num_rows; ++i)
1443 for(
int j=0; j<num_cols; ++j)
1485 require(xcovector.
d() == xjcb.
dr());
1486 require(xresult.
d() == xjcb.
dd());
1490 require(unexecutable(
"xcovector.is_covariant())"));
1491 require(unexecutable(
"xresult.is_covariant())"));
1497 int num_rows = xjcb.
dd();
1498 int num_cols = xjcb.
dr();
1500 for(
int i=0; i<num_rows; ++i)
1503 for(
int j=0; j<num_cols; ++j)
1525 require(precondition_of(
pull(xjcb, xcovector, *result)));
1531 pull(xjcb, xcovector, *result);
1535 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 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 ...
value_type component(int xrow, int xcolumn) const
The value of the component in a specified row and column (const version).
Jacobian of a map from a 3 dimensional domain (u, v, w) to a 3 dimensional Euclidean space (x...
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...
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).
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...
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.
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...
virtual jcb_e33_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
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 const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
virtual volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
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 invariant() const
Class invariant.
virtual ~jcb_e33_lite()
Destructor.
virtual bool is_covariant(bool xauto_access) const
True if and only if all tensor index positions are covariant.
bool is_ancestor_of(const any *xother) const
True if xother conforms to current.
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.
jcb_e33 & operator=(const row_dofs_type &xrdt)
Assignment to an instance of the associated row dofs type.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
jcb_e33()
Default constructor.
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
virtual const std::string & class_name() const
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.
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.
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.
row_dofs_type _row_dofs
Row_dofs_type.
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...
virtual int dd() const
Dimension of the domain.
virtual void put_components(const value_type &dxdu, const value_type &dxdv, const value_type &dxdw, const value_type &dydu, const value_type &dydv, const value_type &dydw, const value_type &dzdu, const value_type &dzdv, const value_type &dzdw)
Set values of the components to the given arguments.
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).
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
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.
static const std::string & static_class_name()
The name of this class.
jcb_e33_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
jcb_e33_lite & operator=(const jcb_e33_lite &xother)
Assignment operator.
Jacobian of a map from a 3 dimensional domain (u, v, w) to a 3 dimensional Euclidean space (x...
virtual const std::string & class_name() const
The name of this class.
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 jcb_e33 * 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.
poset_path range_path() const
The path of the range vector space.
virtual int dr() const
Dimension of the range.
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.
T components[9]
The dofs in the following order: components[0] => dx/du components[1] => dx/dv components[2] => dx/dw...
bool invariant() const
Class invariant.
virtual int d() const
Dimension of this as a vector space.
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 * row_dofs()
The row dofs for this instance (mutable version).
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).
jcb_e33_lite()
Default constructor.
Namespace for the fiber_bundles component of the sheaf system.
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.
static host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path<jcb_e33>(xsuffix). Returns the host if it already exists...
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.