21 #include "SheafSystem/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/at0_space.h" 27 #include "SheafSystem/at1_space.h" 28 #include "SheafSystem/fiber_bundles_namespace.h" 29 #include "SheafSystem/schema_poset_member.h" 30 #include "SheafSystem/stp.h" 31 #include "SheafSystem/wsv_block.h" 96 ensure(unexecutable(*
this == xother));
139 _row_dofs = xrow_dofs;
144 ensure(unexecutable(
row_dofs() == xrow_dofs));
169 fiber_bundle::e1_lite::
187 fiber_bundle::e1_lite::
217 ensure(result == component(0));
232 put_component(0, xcomp);
346 require((0 <= xp) && (xp <= 1));
375 ensure(unexecutable(
"result.p() == xp"));
386 require(precondition_of(static_tp_prototype(xp)));
390 const tp_lite& result = static_tp_prototype(xp);
394 ensure(postcondition_of(static_tp_prototype(xp)));
407 require((0 <= xp) && (xp <= 1));
437 ensure(unexecutable(
"result.p() == xp"));
448 require(precondition_of(static_atp_prototype(xp)));
452 const atp_lite& result = static_atp_prototype(xp);
456 ensure(postcondition_of(static_atp_prototype(xp)));
469 require((0 <= xp) && (xp <= 1));
478 ensure(unexecutable(
"result.p() == xp"));
489 require(precondition_of(static_stp_prototype(xp)));
493 const stp_lite& result = static_stp_prototype(xp);
497 ensure(postcondition_of(static_stp_prototype(xp)));
535 const string& result = static_class_name();
539 ensure(!result.empty());
554 static const string result(
"e1_lite");
558 ensure(!result.empty());
580 ensure(is_same_type(*result));
604 require(&xother != 0);
610 bool result =
dynamic_cast<const e1_lite*
>(&xother) != 0;
623 if(invariant_check())
627 disable_invariant_check();
631 invariance(ed_lite::invariant());
637 enable_invariant_check();
683 static const poset_path result(standard_schema_poset_name(),
"e1_schema");
704 string lmember_names =
"x DOUBLE false";
707 standard_schema_path().member_name(),
708 ed::standard_schema_path(),
737 require(!xhost_path.
empty());
740 require(xschema_path.
full());
742 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
743 require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 1);
751 host_type::new_table(xns, xhost_path, xschema_path, xscalar_space_path, xauto_access);
755 ensure(xns.
owns(result, xauto_access));
756 ensure(result.
path(
true) == xhost_path);
758 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
761 ensure(result.
d(
true) == 1);
763 ensure(result.
p(
true) == 1);
764 ensure(result.
dd(
true) == 1);
783 require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
784 require(standard_host_is_available<e1>(xns, xsuffix, xauto_access));
794 poset_path lscalar_space_path = scalar_type::standard_host(xns, xsuffix, xauto_access).
path(
true);
796 poset_path lpath(standard_host_path<e1>(xsuffix));
805 result_ptr = &new_host(xns, lpath, standard_schema_path(), lscalar_space_path, xauto_access);
812 ensure(xns.
owns(result, xauto_access));
813 ensure(result.
path(
true) == standard_host_path<e1>(xsuffix));
815 ensure(result.
schema(
true).
path(xauto_access) == standard_schema_path());
818 ensure(result.
d(
true) == 1);
819 ensure(result.
scalar_space_path(
true) == standard_host_path<scalar_type>(xsuffix) );
820 ensure(result.
p(
true) == 1);
821 ensure(result.
dd(
true) == 1);
866 attach_to_state(xhost, xhub_id);
872 ensure(index() == xhub_id);
873 ensure(is_attached());
887 attach_to_state(xhost, xid.
hub_pod());
893 ensure(index() ==~ xid);
894 ensure(is_attached());
905 require(!xname.empty());
910 attach_to_state(xhost, xname);
916 ensure(name() == xname);
917 ensure(is_attached());
927 require(xother != 0);
931 attach_to_state(xother);
936 ensure(is_attached());
937 ensure(is_same_state(xother));
947 require(precondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
951 new_jim_state(xhost, 0,
false, xauto_access);
955 ensure(postcondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
970 require(precondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
974 new_jim_state(&xhost, 0,
false, xauto_access);
990 ensure(postcondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
1004 require(state_is_read_write_accessible());
1027 require(is_ancestor_of(&xother));
1028 require(precondition_of(attach_to_state(&xother)));
1032 attach_to_state(&xother);
1036 ensure(postcondition_of(attach_to_state(&xother)));
1050 require(precondition_of(attach_to_state(&xother)));
1054 attach_to_state(&xother);
1058 ensure(postcondition_of(attach_to_state(&xother)));
1175 require(state_is_read_accessible());
1183 ensure(invariant());
1196 require(state_is_read_write_accessible());
1200 put_component(0, xcomp);
1204 ensure(invariant());
1262 require((0 <= xp) && (xp <= 1));
1267 const string& lvector_space_name = xvector_space.
name();
1273 const string lname =
1274 create_tensor_space_name(lvector_space_name,
"at0");
1276 at0* result =
new at0(&lhost);
1282 const string lname =
1283 create_tensor_space_name(lvector_space_name,
"e1");
1285 e1* result =
new e1(&lhost);
1296 ensure(unexecutable(
"result.p() == xp"));
1310 require((0 <= xp) && (xp <= 1));
1315 const string& lvector_space_name = xvector_space.
name();
1321 const string lname =
1322 create_tensor_space_name(lvector_space_name,
"at0");
1324 at0* result =
new at0(&lhost);
1330 const string lname =
1331 create_tensor_space_name(lvector_space_name,
"e1");
1333 e1* result =
new e1(&lhost);
1344 ensure(unexecutable(
"result.p() == xp"));
1377 require(precondition_of(e1::new_tp(vector_space(xauto_access), xp)));
1381 tp* result = e1::new_tp(vector_space(xauto_access), xp);
1385 ensure(postcondition_of(e1::new_tp(vector_space(xauto_access), xp)));
1398 require(precondition_of(e1::new_atp(vector_space(xauto_access), xp)));
1402 atp* result = e1::new_atp(vector_space(xauto_access), xp);
1406 ensure(postcondition_of(e1::new_atp(vector_space(xauto_access), xp)));
1419 require(precondition_of(e1::new_stp(vector_space(xauto_access), xp)));
1423 stp* result = e1::new_stp(vector_space(xauto_access), xp);
1427 ensure(postcondition_of(e1::new_stp(vector_space(xauto_access), xp)));
1454 const string& result = static_class_name();
1458 ensure(!result.empty());
1473 static const string result(
"e1");
1477 ensure(!result.empty());
1495 e1* result =
new e1();
1499 ensure(result != 0);
1526 require(other != 0);
1533 bool result =
dynamic_cast<const e1*
>(other) != 0;
1557 invariance(ed::invariant());
1559 if (invariant_check())
1563 disable_invariant_check();
1565 invariance((is_attached() ? d() == 1 :
true));
1569 enable_invariant_check();
1574 ensure(is_derived_query);
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 ...
static const std::string & static_class_name()
The name of this class.
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.
bool full() const
True if both poset name and member name are not empty.
virtual ~e1_lite()
Destructor.
virtual e1_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
virtual const stp_lite & stp_prototype(int xp) const
Prototype for symmetric tensors of degree xp over this vector space.
e1_lite & operator=(const e1_lite &xother)
Assignment operator.
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, const poset_path &xscalar_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...
An antisymmetric tensor of degree p.
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.
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.
e1 & operator=(const row_dofs_type &xrdt)
Assignment to an instance of the associated row dofs type.
A general antisymmetric tensor of degree 1 over an abstract vector space (volatile version)...
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...
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 stp * new_stp(tp_space &xvector_space, int xp)
Static constructor for symmetric tensors of degree xp over this vector space.
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.
T components[1]
The components (row_dofs).
static const atp_lite & static_atp_prototype(int xp)
Static prototype for antisymmetric tensors of degree xp over this vector space.
virtual const std::string & class_name() const
The name of this class.
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
static host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path<e1>(xsuffix). Returns the host if it already exists...
Euclidean vector space of dimension 1 (persistent 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.
bool is_ancestor_of(const any *other) const
True if other conforms to current.
bool invariant() const
Class invariant.
bool invariant() const
Class invariant.
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).
A space of scalars viewed as an antisymmetric tensor space of degree 0.
static atp * new_atp(tp_space &xvector_space, int xp)
Static constructor for antisymmetric tensors of degree xp over this vector space. ...
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)
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 poset_path & standard_schema_path()
The path to the standard schema for this class.
virtual void * row_dofs()
The row dofs for this instance (mutable version).
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.
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.
e1_lite()
Default constructor.
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
virtual std::string name() const
The name of this poset.
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 ...
bool contains_poset(pod_index_type xhub_id, bool xauto_access=true) const
True if this contains a poset with hub id xhub_id..
static const tp_lite & static_tp_prototype(int xp)
Static prototype for general tensors of degree xp over this vector space.
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 const std::string & class_name() const
The name of this class.
virtual void put_component(dof_type xcomp)
Set value of component.
namespace_poset * name_space() const
The namespace this poset resides in.
virtual e1 * clone() const
Make a new handle, no state instance of current.
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
virtual dof_type component() const
Get value of component xindex.
static const stp_lite & static_stp_prototype(int xp)
Static prototype for symmetric tensors of degree xp over this vector space.
static int factor_ct(int xd)
Factor_ct() as a function of dimension xd.
virtual const atp_lite & atp_prototype(int xp) const
Prototype for antisymmetric tensors of degree xp over this vector space.
static const std::string & static_class_name()
The name of this class.
int_type pod_index_type
The plain old data index type.
virtual int dd() const
Dimension of the underlying vector space.
int dd() const
The dimension of the underlying ("domain") vector space.
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
bool operator==(const e1_lite &xother) const
True if this has the same components as xother.
Euclidean vector space of dimension 1 (volatile version).
virtual const tp_lite & tp_prototype(int xp) const
Prototype for general tensors of degree xp over this vector space.
static tp * new_tp(tp_space &xvector_space, int xp)
Static constructor for general tensors of degree xp over this vector space.
virtual volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
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...
An abstract tensor space of degree p.
virtual value_type component() const
Value of (the only) component.
row_dofs_type _row_dofs
Row_dofs_type.
A symmetric tensor of degree p over an abstract vector space (volatile version).
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.
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
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.