21 #include "SheafSystem/at0.impl.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/at0_space.h" 25 #include "SheafSystem/at1_space.h" 26 #include "SheafSystem/fiber_bundles_namespace.h" 27 #include "SheafSystem/schema_poset_member.h" 28 #include "SheafSystem/stp.h" 29 #include "SheafSystem/wsv_block.h" 88 put_component(0, xother[0]);
174 put_component(xcomp);
193 bool result = (component() == xother);
204 fiber_bundle::at0_lite::
220 fiber_bundle::at0_lite::
236 fiber_bundle::at0_lite::
252 fiber_bundle::at0_lite::
276 put_component(0, xcomp);
321 ensure(unexecutable(
"result.p() == xp"));
336 require(precondition_of(static_tp_prototype(xp)));
340 const tp_lite& result = static_tp_prototype(xp);
344 ensure(postcondition_of(static_tp_prototype(xp)));
367 ensure(unexecutable(
"result.p() == xp"));
379 require(precondition_of(static_atp_prototype(xp)));
383 const atp_lite& result = static_atp_prototype(xp);
387 ensure(postcondition_of(static_atp_prototype(xp)));
410 ensure(unexecutable(
"result.p() == xp"));
421 require(precondition_of(static_stp_prototype(xp)));
425 const stp_lite& result = static_stp_prototype(xp);
429 ensure(postcondition_of(static_stp_prototype(xp)));
539 const string& result = static_class_name();
543 ensure(!result.empty());
558 static const string result(
"at0_lite");
562 ensure(!result.empty());
584 ensure(is_same_type(*result));
608 require(&xother != 0);
614 bool result =
dynamic_cast<const at0_lite*
>(&xother) != 0;
627 if(invariant_check())
631 disable_invariant_check();
635 invariance(atp_lite::invariant());
641 enable_invariant_check();
688 static const poset_path result(standard_schema_poset_name(),
"at0_schema");
710 string lmember_names =
"value DOUBLE false";
713 standard_schema_path().member_name(),
714 atp::standard_schema_path(),
739 require(!xhost_path.
empty());
742 require(xschema_path.
full());
744 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
745 require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 1);
749 host_type& result = host_type::new_table(xns, xhost_path, xschema_path, xauto_access);
753 ensure(xns.
owns(result, xauto_access));
754 ensure(result.
path(
true) == xhost_path);
756 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
759 ensure(result.
d(
true) == 1);
761 ensure(result.
p(
true) == 0);
762 ensure(result.
dd(
true) == 1);
781 require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
782 require(standard_host_is_available<at0>(xns, xsuffix, xauto_access));
788 poset_path lpath(standard_host_path<at0>(xsuffix));
797 result_ptr = &new_host(xns, lpath, standard_schema_path(), xauto_access);
804 ensure(xns.
owns(result, xauto_access));
805 ensure(result.
path(
true) == standard_host_path<at0>(xsuffix));
807 ensure(result.
schema(
true).
path(xauto_access) == standard_schema_path());
810 ensure(result.
d(
true) == 1);
812 ensure(result.
p(
true) == 0);
813 ensure(result.
dd(
true) == 1);
859 attach_to_state(xhost, xhub_id);
865 ensure(index() == xhub_id);
866 ensure(is_attached());
882 attach_to_state(xhost, xid.
hub_pod());
888 ensure(index() ==~ xid);
889 ensure(is_attached());
901 require(!xname.empty());
906 attach_to_state(xhost, xname);
912 ensure(name() == xname);
913 ensure(is_attached());
923 require(xother != 0);
927 attach_to_state(xother);
932 ensure(is_attached());
933 ensure(is_same_state(xother));
943 require(precondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
947 new_jim_state(xhost, 0,
false, xauto_access);
951 ensure(postcondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
966 require(precondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
970 new_jim_state(&xhost, 0,
false, xauto_access);
986 ensure(postcondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
999 require(state_is_read_write_accessible());
1022 require(is_ancestor_of(&xother));
1023 require(precondition_of(attach_to_state(&xother)));
1027 attach_to_state(&xother);
1031 ensure(postcondition_of(attach_to_state(&xother)));
1045 require(precondition_of(attach_to_state(&xother)));
1049 attach_to_state(&xother);
1053 ensure(postcondition_of(attach_to_state(&xother)));
1113 require(state_is_read_accessible());
1121 ensure(invariant());
1134 require(state_is_read_write_accessible());
1138 put_component(0, xvalue);
1142 ensure(value() == xvalue);
1143 ensure(invariant());
1234 ensure(invariant());
1235 ensure(result == 1);
1261 const string& result = static_class_name();
1265 ensure(!result.empty());
1280 static const string result(
"at0");
1284 ensure(!result.empty());
1307 return reinterpret_cast<host_type*
>(_host);
1314 return dynamic_cast<const host_type*
>(xother) != 0;
1335 require(xother != 0);
1342 bool result =
dynamic_cast<const at0*
>(xother) != 0;
1370 ensure(result != 0);
1389 invariance(atp::invariant());
1394 if (invariant_check())
1398 disable_invariant_check();
1400 invariance((is_attached() ? p() == 0 :
true));
1401 invariance((is_attached() ? d() == 1 :
true));
1402 invariance((is_attached() ? dof_ct() == 1 :
true));
1406 enable_invariant_check();
static const std::string & static_class_name()
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...
at0_lite & operator=(const at0_lite &xother)
Assignment operator.
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 ...
bool invariant() const
Class invariant.
virtual int factor_ct() const
Number of factors (components) in tuple.
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 const tp_lite & tp_prototype(int xp) const
Virtual constructor for general tensors of degree xp over this vector space.
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
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.
virtual value_type value() const
The value of this as a POD ("plain old data") type.
poset_path path(bool xauto_access=true) const
A path to this component.
bool invariant() const
Class invariant.
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...
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".
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::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
T components[1]
The components (row_dofs), only one in this case.
An antisymmetric tensor of degree p over an abstract vector space (volatile version).
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
Abstract base class with useful features for all volatile objects.
Abstract base class with useful features for all objects.
virtual ~at0_lite()
Destructor.
virtual const std::string & class_name() const
The name of this class.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
at0_lite()
Default constructor.
A space of scalars viewed as an antisymmetric tensor space of degree 0.
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.
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.
static const std::string & static_class_name()
The name of this class.
at0 & operator=(const row_dofs_type &xrdt)
Assignment to an instance of the associated row dofs type.
Antisymetric tensor of degree 0 (volatile version).
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
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.
at0()
Default constructor.
virtual const stp_lite & stp_prototype(int xp) const
Prototype for symmetric tensors of degree xp over this vector space.
virtual void * row_dofs()
The row dofs for this instance (mutable version).
virtual volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
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 const std::string & class_name() const
The name of this class.
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
static const stp_lite & static_stp_prototype(int xp)
Static prototype for symmetric tensors of degree xp over this 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..
poset_path scalar_space_path() const
The path of the underlying space of scalars.
static host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path(xsuffix). Returns the host if it already exists, otherwise, creates it in namespace xns with schema specified by standard_schema_path() and standard paths for prerequisites, which are also created if needed.
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
host_type * host() const
The poset this is a member of.
virtual int p() const
Degree of this as an antisymmetric tensor space.
bool operator==(const vd_value_type &xother) const
Equality operator.
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.
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, bool xauto_access)
Creates a new host table for members of this type. The poset is created in namespace xns with path xh...
int_type pod_index_type
The plain old data index type.
static const tp_lite & static_tp_prototype(int xp)
Static prototype for general tensors of degree xp over this vector space.
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.
virtual const atp_lite & atp_prototype(int xp) const
Prototype for antisymmetric tensors of degree xp over this vector space.
virtual bool host_is_ancestor_of(const poset_state_handle *other) const
True if other conforms to host.
An abstract client handle for a member of a poset.
virtual at0 * clone() const
Make a new handle, no state instance of current.
virtual at0_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
A symmetric tensor of degree p over an abstract vector space (volatile version).
Namespace for the fiber_bundles component of the sheaf system.
static const atp_lite & static_atp_prototype(int xp)
Static prototype for antisymmetric tensors of degree xp over this vector space.
void put_value(value_type xvalue)
Sets value to xvalue.
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.
bool is_ancestor_of(const any *xother) const
True if other conforms to current.
double vd_value_type
The type of component in the fiber; the scalar type in the fiber vector space.
virtual int dd() const
Degree of this as an antisymmetric tensor 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.