20 #include "SheafSystem/at3_e3.impl.h" 22 #include "SheafSystem/abstract_poset_member.impl.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/at0.h" 25 #include "SheafSystem/at1_space.h" 26 #include "SheafSystem/fiber_bundles_namespace.h" 27 #include "SheafSystem/schema_poset_member.h" 28 #include "SheafSystem/wsv_block.h" 134 _row_dofs = xrow_dofs;
146 fiber_bundle::at3_e3_lite::
162 fiber_bundle::at3_e3_lite::
186 put_components(xcomp);
201 put_component(0, xcomp);
281 require(precondition_of(e3_lite::static_tp_prototype(xp)));
285 const tp_lite& result = e3_lite::static_tp_prototype(xp);
289 ensure(postcondition_of(e3_lite::static_tp_prototype(xp)));
302 require(precondition_of(e3_lite::static_atp_prototype(xp)));
306 const atp_lite& result = e3_lite::static_atp_prototype(xp);
310 ensure(postcondition_of(e3_lite::static_atp_prototype(xp)));
323 require(precondition_of(e3_lite::static_stp_prototype(xp)));
327 const stp_lite& result = e3_lite::static_stp_prototype(xp);
331 ensure(postcondition_of(e3_lite::static_stp_prototype(xp)));
368 const string& result = static_class_name();
372 ensure(!result.empty());
387 static const string result(
"at3_e3_lite");
391 ensure(!result.empty());
413 ensure(is_same_type(*result));
437 require(&xother != 0);
443 bool result =
dynamic_cast<const at3_e3_lite*
>(&xother) != 0;
456 if(invariant_check())
460 disable_invariant_check();
464 invariance(at3_lite::invariant());
470 enable_invariant_check();
516 static const poset_path result(standard_schema_poset_name(),
"at3_e3_schema");
538 string lmember_names =
"component DOUBLE false ";
541 standard_schema_path().member_name(),
542 at3::standard_schema_path(),
571 require(!xhost_path.
empty());
574 require(xschema_path.
full());
576 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
577 require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 1);
587 host_type::new_table(xns, xhost_path, xschema_path, 3, xvector_space_path, xauto_access);
591 ensure(xns.
owns(result, xauto_access));
592 ensure(result.path(
true) == xhost_path);
593 ensure(result.state_is_not_read_accessible());
594 ensure(result.schema(
true).path(xauto_access) == xschema_path);
596 ensure(result.factor_ct(
true) == 1);
597 ensure(result.d(
true) == 1);
599 ensure(result.p(
true) == 3);
600 ensure(result.dd(
true) == 3);
601 ensure(result.vector_space_path(
true) == xvector_space_path);
619 require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
620 require(standard_host_is_available<at3_e3>(xns, xsuffix, xauto_access));
630 poset_path lvector_space_path = vector_space_type::standard_host(xns, xsuffix, xauto_access).
path(
true);
632 poset_path lpath(standard_host_path<at3_e3>(xsuffix));
641 result_ptr = &new_host(xns, lpath, standard_schema_path(), lvector_space_path, xauto_access);
648 ensure(xns.
owns(result, xauto_access));
649 ensure(result.
path(
true) == standard_host_path<at3_e3>(xsuffix));
651 ensure(result.
schema(
true).
path(xauto_access) == standard_schema_path());
654 ensure(result.
d(
true) == 1);
655 ensure(result.
scalar_space_path(
true) == standard_host_path<vector_space_type::scalar_type>(xsuffix) );
656 ensure(result.
p(
true) == 3);
657 ensure(result.
dd(
true) == 3);
658 ensure(result.
vector_space_path(
true) == standard_host_path<vector_space_type>(xsuffix) );
701 attach_to_state(xhost, xhub_id);
707 ensure(index() == xhub_id);
708 ensure(is_attached());
722 attach_to_state(xhost, xid.
hub_pod());
728 ensure(index() ==~ xid);
729 ensure(is_attached());
740 require(!xname.empty());
745 attach_to_state(xhost, xname);
751 ensure(name() == xname);
752 ensure(is_attached());
762 require(xother != 0);
766 attach_to_state(xother);
771 ensure(is_attached());
772 ensure(is_same_state(xother));
782 require(precondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
786 new_jim_state(xhost, 0,
false, xauto_access);
790 ensure(postcondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
805 require(precondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
809 new_jim_state(&xhost, 0,
false, xauto_access);
825 ensure(postcondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
839 require(state_is_read_write_accessible());
847 ensure_for_all(i, 0, d(), component(i) == xrdt.
components[i]);
862 require(is_ancestor_of(&xother));
863 require(precondition_of(attach_to_state(&xother)));
867 attach_to_state(&xother);
871 ensure(postcondition_of(attach_to_state(&xother)));
885 require(precondition_of(attach_to_state(&xother)));
889 attach_to_state(&xother);
893 ensure(postcondition_of(attach_to_state(&xother)));
954 require(state_is_read_write_accessible());
958 put_component(0, xcomp);
970 fiber_bundle::at3_e3::
986 fiber_bundle::at3_e3::
1058 require(precondition_of(e3::new_tp(vector_space(xauto_access), xp)));
1062 tp* result = e3::new_tp(vector_space(xauto_access), xp);
1066 ensure(postcondition_of(e3::new_tp(vector_space(xauto_access), xp)));
1079 require(precondition_of(e3::new_atp(vector_space(xauto_access), xp)));
1083 atp* result = e3::new_atp(vector_space(xauto_access), xp);
1087 ensure(postcondition_of(e3::new_atp(vector_space(xauto_access), xp)));
1100 require(precondition_of(e3::new_stp(vector_space(xauto_access), xp)));
1104 stp* result = e3::new_stp(vector_space(xauto_access), xp);
1108 ensure(postcondition_of(e3::new_stp(vector_space(xauto_access), xp)));
1134 const string& result = static_class_name();
1138 ensure(!result.empty());
1153 static const string result(
"at3_e3");
1157 ensure(!result.empty());
1179 ensure(result != 0);
1204 require(xother != 0);
1208 bool result =
dynamic_cast<const at3_e3*
>(xother) != 0;
1227 if(invariant_check())
1231 disable_invariant_check();
1235 invariance(at3::invariant());
1239 invariance((state_is_read_accessible() ? dd() == 3 :
true));
1243 enable_invariant_check();
1260 #include "SheafSystem/at0.h" 1261 #include "SheafSystem/at2_e3.h" 1445 ensure(result != 0);
1473 define_old_variable(
bool old_xresult_is_p_form = xresult.
is_p_form(
false));
1483 ensure(xresult.
is_p_form(xauto_access) == old_xresult_is_p_form);
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 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 ...
An antisymmetric rank 3 tensor over an abstract vector space (volatile version).
virtual tp * new_tp(int xp, bool xauto_access) const
Virtual constructor for general tensors of degree xp over vector space xvector_space.
virtual at3_e3 * clone() const
Make a new handle, no state instance of current.
A symmetric tensor of degree p over an abstract vector space.
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
virtual volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
virtual void put_component(int xrow, int xcolumn, value_type xcomp)
Sets value of a component in a specified row and column.
bool full() const
True if both poset name and member name are not empty.
virtual void * row_dofs()
The row dofs for this instance (mutable version).
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
virtual const tp_lite & tp_prototype(int xp) const
Prototype for general tensors of degree xp over this vector space.
An antisymmetric tensor of degree p.
virtual const std::string & class_name() const
The name of this class.
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...
value_type component() const
Value of (the only) component.
T components[1]
There is only one component (dof) for at3_e3.
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)...
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.
virtual const stp_lite & stp_prototype(int xp) const
Prototype for symmetric tensors of degree xp over this vector space.
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.
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
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".
static host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path<at3_e3>(xsuffix). Returns the host if it already exists...
value_type component(int xindex) const
The xindex-th component.
bool invariant() const
Class invariant.
virtual value_type component(int xi, int xj, int xk) const
The value of component with indices xi, xj, xk.
bool is_ancestor_of(const any *xother) const
True if xother conforms to current.
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.
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).
An antisymmetric tensor of degree p over an abstract vector space (volatile version).
A general tensor of "degree" p and given "variance" over an abstract vector space.
at3_e3_lite & operator=(const at3_e3_lite &xother)
Assignment operator.
bool invariant() const
Class invariant.
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 ~at3_e3_lite()
Destructor.
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.
virtual value_type component(int xi, int xj, int xk) const
The value of component with indices xi, xj, xk.
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)...
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
virtual const std::string & class_name() const
The name of this class.
virtual atp * new_atp(int xp, bool xauto_access) const
Virtual constructor for antisymmetric tensors of degree xp over vector space xvector_space.
An abstract antisymmetric tensor space of degree p.
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...
virtual void put_component(int xi, int xj, int xk, value_type xvalue)
Sets the component with indices xi, xj, xk to xvalue.
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)
at3_e3 & operator=(const row_dofs_type &xrdt)
Assignment to an instance of the associated row dofs type.
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.
A scalar viewed as an antisymmetric tensor of degree 0. As the degree is 0 there is nothing to be sym...
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 stp * new_stp(int xp, bool xauto_access) const
Virtual constructor for symmetric tensors of degree xp over vector space xvector_space.
virtual value_type component(int xindex) const
The value of the xi-th component.
at3_e3_lite()
Default constructor.
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 bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
row_dofs_type _row_dofs
Row_dofs_type.
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
at3_e3()
Default constructor.
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.
static const std::string & static_class_name()
The name of this class.
poset_path scalar_space_path() const
The path of the underlying space of scalars.
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
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...
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
virtual void put_component(value_type xcomp)
Set value of (the only) component to xcomp.
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.
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...
virtual void put_components(const value_type &xcomp)
Set the value of the component to xcomp.
int dd() const
The dimension of the underlying ("domain") vector space.
virtual int dd() const
Dimension of the underlying vector space.
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 3. (volatile version)...
virtual void put_component(int xi, int xj, int xk, value_type xvalue)
Sets the component with indices xi, xj, xk to xvalue.
virtual value_type component(int xrow, int xcolumn) const
The value of the component in a specified row and column.
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 atp_lite & atp_prototype(int xp) const
Prototype for antisymmetric tensors of degree xp over this vector space.
virtual at3_e3_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
value_type component(int xrow, int xcolumn) const
The component with row index xrow and column index xcolumn.
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).
void put_component(int xrow, int xcolumn, value_type xvalue)
Sets the component with row index xrow and column index xcolumn to xvalue.
A symmetric tensor of degree p over an abstract vector space (volatile version).
Namespace for the fiber_bundles component of the sheaf system.
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.
virtual void put_components(dof_type xcomp)
Sets the value of the component to xcomp.
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.