21 #include "SheafSystem/met_e1.impl.h" 23 #include "SheafSystem/abstract_poset_member.impl.h" 24 #include "SheafSystem/assert_contract.h" 25 #include "SheafSystem/at0.h" 26 #include "SheafSystem/at1_space.h" 27 #include "SheafSystem/stp_space.h" 28 #include "SheafSystem/fiber_bundles_namespace.h" 29 #include "SheafSystem/schema_poset_member.h" 30 #include "SheafSystem/wsv_block.h" 136 _row_dofs = xrow_dofs;
148 fiber_bundle::met_e1_lite::
164 fiber_bundle::met_e1_lite::
224 put_component(0, xcomp);
286 require(precondition_of(e1_lite::static_tp_prototype(xp)));
290 const tp_lite& result = e1_lite::static_tp_prototype(xp);
294 ensure(postcondition_of(e1_lite::static_tp_prototype(xp)));
307 require(precondition_of(e1_lite::static_atp_prototype(xp)));
311 const atp_lite& result = e1_lite::static_atp_prototype(xp);
315 ensure(postcondition_of(e1_lite::static_atp_prototype(xp)));
328 require(precondition_of(e1_lite::static_stp_prototype(xp)));
332 const stp_lite& result = e1_lite::static_stp_prototype(xp);
336 ensure(postcondition_of(e1_lite::static_stp_prototype(xp)));
415 const string& result = static_class_name();
419 ensure(!result.empty());
434 static const string result(
"met_e1_lite");
438 ensure(!result.empty());
460 ensure(is_same_type(*result));
484 require(&xother != 0);
490 bool result =
dynamic_cast<const met_e1_lite*
>(&xother) != 0;
503 if(invariant_check())
507 disable_invariant_check();
511 invariance(met_ed_lite::invariant());
517 enable_invariant_check();
563 static const poset_path result(standard_schema_poset_name(),
"met_e1_schema");
585 string lmember_names =
"xx DOUBLE false";
588 standard_schema_path().member_name(),
589 met_ed::standard_schema_path(),
618 require(!xhost_path.
empty());
621 require(xschema_path.
full());
623 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
624 require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 1);
634 host_type::new_table(xns, xhost_path, xschema_path, 2, xvector_space_path, xauto_access);
638 ensure(xns.
owns(result, xauto_access));
639 ensure(result.path(
true) == xhost_path);
640 ensure(result.state_is_not_read_accessible());
641 ensure(result.schema(
true).path(xauto_access) == xschema_path);
643 ensure(result.factor_ct(
true) == 1);
644 ensure(result.d(
true) == 1);
646 ensure(result.p(
true) == 2);
647 ensure(result.dd(
true) == 1);
648 ensure(result.vector_space_path(
true) == xvector_space_path);
666 require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
667 require(standard_host_is_available<met_e1>(xns, xsuffix, xauto_access));
677 poset_path lvector_space_path = vector_space_type::standard_host(xns, xsuffix, xauto_access).
path(
true);
679 poset_path lpath(standard_host_path<met_e1>(xsuffix));
688 result_ptr = &new_host(xns, lpath, standard_schema_path(), lvector_space_path, xauto_access);
695 ensure(xns.
owns(result, xauto_access));
696 ensure(result.
path(
true) == standard_host_path<met_e1>(xsuffix));
698 ensure(result.
schema(
true).
path(xauto_access) == standard_schema_path());
701 ensure(result.
d(
true) == 1);
702 ensure(result.
scalar_space_path(
true) == standard_host_path<vector_space_type::scalar_type>(xsuffix) );
703 ensure(result.
p(
true) == 2);
704 ensure(result.
dd(
true) == 1);
705 ensure(result.
vector_space_path(
true) == standard_host_path<vector_space_type>(xsuffix) );
748 attach_to_state(xhost, xhub_id);
754 ensure(index() == xhub_id);
755 ensure(is_attached());
769 attach_to_state(xhost, xid.
hub_pod());
775 ensure(index() ==~ xid);
776 ensure(is_attached());
787 require(!xname.empty());
792 attach_to_state(xhost, xname);
798 ensure(name() == xname);
799 ensure(is_attached());
809 require(xother != 0);
813 attach_to_state(xother);
818 ensure(is_attached());
819 ensure(is_same_state(xother));
829 require(precondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
833 new_jim_state(xhost, 0,
false, xauto_access);
837 ensure(postcondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
852 require(precondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
856 new_jim_state(&xhost, 0,
false, xauto_access);
872 ensure(postcondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
885 require(state_is_read_write_accessible());
908 require(is_ancestor_of(&xother));
909 require(precondition_of(attach_to_state(&xother)));
913 attach_to_state(&xother);
917 ensure(postcondition_of(attach_to_state(&xother)));
931 require(precondition_of(attach_to_state(&xother)));
935 attach_to_state(&xother);
939 ensure(postcondition_of(attach_to_state(&xother)));
993 fiber_bundle::met_e1::
998 require(state_is_read_write_accessible());
1011 fiber_bundle::met_e1::
1016 require(state_is_read_accessible());
1112 require(precondition_of(e1::new_tp(vector_space(xauto_access), xp)));
1116 tp* result = e1::new_tp(vector_space(xauto_access), xp);
1120 ensure(postcondition_of(e1::new_tp(vector_space(xauto_access), xp)));
1133 require(precondition_of(e1::new_atp(vector_space(xauto_access), xp)));
1137 atp* result = e1::new_atp(vector_space(xauto_access), xp);
1141 ensure(postcondition_of(e1::new_atp(vector_space(xauto_access), xp)));
1154 require(precondition_of(e1::new_stp(vector_space(xauto_access), xp)));
1158 stp* result = e1::new_stp(vector_space(xauto_access), xp);
1162 ensure(postcondition_of(e1::new_stp(vector_space(xauto_access), xp)));
1188 const string& result = static_class_name();
1192 ensure(!result.empty());
1207 static const string result(
"met_e1");
1211 ensure(!result.empty());
1233 ensure(result != 0);
1260 require(xother != 0);
1267 bool result =
dynamic_cast<const met_e1*
>(xother) != 0;
1291 invariance(met_ed::invariant());
1293 if (invariant_check())
1297 disable_invariant_check();
1301 invariance(is_attached() ? (d() == 1) :
true);
1305 enable_invariant_check();
1310 ensure(is_derived_query);
1336 require(unexecutable(
"xmetric.is_contravariant())"));
1337 require(unexecutable(
"xcovector.is_covariant())"));
1351 value_type comp0 = xcovector.
component(0);
1353 value_type result_comp = m00*comp0;
1359 ensure(unexecutable(
"xresult.is_contravariant())"));
1371 require(precondition_of(
raise(xmetric, xcovector, *result)));
1377 raise(xmetric, xcovector, *result);
1381 ensure(result != 0);
1382 ensure(postcondition_of(
raise(xmetric, xcovector, *result)));
1395 require(unexecutable(
"xmetric.is_covariant())"));
1396 require(unexecutable(
"xcovector.is_contravariant())"));
1410 value_type comp0 = xvector.
component(0);
1412 value_type result_comp = m00*comp0;
1418 ensure(unexecutable(
"xresult.is_covariant())"));
1429 require(precondition_of(
lower(xmetric, xvector, *result)));
1435 lower(xmetric, xvector, *result);
1439 ensure(result != 0);
1440 ensure(postcondition_of(
lower(xmetric, xvector, *result)));
1475 value_type comp0 = xcovector.
component(0);
1477 value_type result_comp = m00*comp0;
1530 value_type comp0 = xvector.
component(0);
1532 value_type result_comp = m00*comp0;
SHEAF_DLL_SPEC void lower(const met &xmetric, const ed &xvector, ed &xresult, bool xauto_access)
Lower vector (pre-allocated version for persistent 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...
bool invariant() const
Class invariant.
virtual const std::string & class_name() const
The name of this class.
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 ...
A symmetric tensor of degree p over an abstract vector space.
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).
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).
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
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...
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...
poset_path vector_space_path() const
The path of the underlying vector 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.
virtual int dd() const
Dimension of the underlying vector space.
A metric tensor over a 1 dimensional Euclidean vector space.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
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.
virtual volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
virtual const tp_lite & tp_prototype(int xp) const
Prototype for general tensors of degree xp over this vector space.
virtual const std::string & class_name() const
The name of this class.
A metric tensor over an abstract vector space (volatile 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 ~met_e1_lite()
Destructor.
Euclidean vector space of dimension 1 (persistent version).
An antisymmetric tensor of degree p over an abstract vector space (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...
A general tensor of "degree" p and given "variance" over an abstract vector space.
T components[1]
The components (row_dofs).
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 const stp_lite & stp_prototype(int xp) const
Prototype for symmetric tensors of degree xp over this vector space.
bool is_ancestor_of(const any *other) const
True if other conforms to current.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
met_e1_lite()
Default constructor.
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)
static const std::string & static_class_name()
The name of this class.
virtual void detach_from_state()
Detach this handle from its state, if any.
virtual tp * new_tp(int xp, bool xauto_access) const
Virtual constructor for general tensors of degree xp over vector space xvector_space.
An index within the external ("client") scope of a given id space.
virtual const atp_lite & atp_prototype(int xp) const
Prototype for antisymmetric tensors of degree xp over this vector 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.
void put_component(const value_type &x_comp)
Set value of component.
bool is_p_form(bool xauto_access) const
True if this is a p-form; synonym for is_covariant(xauto_access).
A metric tensor over a 1 dimensional Euclidean vector space (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.
value_type component() const
Value of xx component (const version).
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
virtual stp * new_stp(int xp, bool xauto_access) const
Virtual constructor for symmetric tensors of degree xp over vector space xvector_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...
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
static const std::string & static_class_name()
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..
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.
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.
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 dof_type component() const
Get value of component xindex.
static int factor_ct(int xd)
Factor_ct() as a function of dimension xd.
virtual met_e1_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
int_type pod_index_type
The plain old data index type.
vd_value_type value_type
The POD ("plain old data") type of scalar in the vector space of this.
int dd() const
The dimension of the underlying ("domain") vector space.
bool invariant() const
Class invariant.
Euclidean vector space of dimension 1 (volatile version).
bool is_p_vector(bool xauto_access) const
True if this is a p-vector; synonym for is_contravariant(xauto_access).
virtual met_e1 * clone() const
Make a new handle, no state instance of current.
met_e1 & operator=(const row_dofs_type &xrdt)
Assignment to an instance of the associated row dofs type.
met_e1_lite & operator=(const met_e1_lite &xother)
Assignment operator.
virtual atp * new_atp(int xp, bool xauto_access) const
Virtual constructor for antisymmetric tensors of degree xp over vector space xvector_space.
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
static host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path<met_e1>(xsuffix). Returns the host if it already exists...
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 bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
An abstract client handle for a member of a poset.
std::string path() const
The full path as a string.
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.
A symmetric tensor of degree p over an abstract vector space (volatile version).
An abstract symmetric tensor space of degree p.
Namespace for the fiber_bundles component of the sheaf system.
value_type component(int xrow, int xcolumn) const
The component with row index xrow and column index xcolumn.
SHEAF_DLL_SPEC void raise(const met &xmetric, const ed &xcovector, ed &xresult, bool xauto_access)
Raise covector (pre-allocated version for persistent type).
met_e1()
Default constructor.
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...
row_dofs_type _row_dofs
Row_dofs_type.
A client handle for a poset member which has been prepared for use as a schema.
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.