21 #include "SheafSystem/at2_e2.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/fiber_bundles_namespace.h" 28 #include "SheafSystem/schema_poset_member.h" 29 #include "SheafSystem/wsv_block.h" 137 _row_dofs = xrow_dofs;
184 fiber_bundle::at2_e2_lite::
200 fiber_bundle::at2_e2_lite::
216 fiber_bundle::at2_e2_lite::
232 fiber_bundle::at2_e2_lite::
273 put_component(0, xy);
331 require(precondition_of(e2_lite::static_tp_prototype(xp)));
335 const tp_lite& result = e2_lite::static_tp_prototype(xp);
339 ensure(postcondition_of(e2_lite::static_tp_prototype(xp)));
352 require(precondition_of(e2_lite::static_atp_prototype(xp)));
356 const atp_lite& result = e2_lite::static_atp_prototype(xp);
360 ensure(postcondition_of(e2_lite::static_atp_prototype(xp)));
373 require(precondition_of(e2_lite::static_stp_prototype(xp)));
377 const stp_lite& result = e2_lite::static_stp_prototype(xp);
381 ensure(postcondition_of(e2_lite::static_stp_prototype(xp)));
419 const string& result = static_class_name();
423 ensure(!result.empty());
438 static const string result(
"at2_e2_lite");
442 ensure(!result.empty());
464 ensure(is_same_type(*result));
488 require(&xother != 0);
494 bool result =
dynamic_cast<const at2_e2_lite*
>(&xother) != 0;
507 if(invariant_check())
511 disable_invariant_check();
515 invariance(at2_lite::invariant());
521 enable_invariant_check();
567 static const poset_path result(standard_schema_poset_name(),
"at2_e2_schema");
589 string lmember_names =
"xy DOUBLE false";
592 standard_schema_path().member_name(),
593 at2::standard_schema_path(),
622 require(!xhost_path.
empty());
625 require(xschema_path.
full());
627 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
628 require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 1);
638 host_type::new_table(xns, xhost_path, xschema_path, 2, xvector_space_path, xauto_access);
642 ensure(xns.
owns(result, xauto_access));
643 ensure(result.path(
true) == xhost_path);
644 ensure(result.state_is_not_read_accessible());
645 ensure(result.schema(
true).path(xauto_access) == xschema_path);
647 ensure(result.factor_ct(
true) == 1);
648 ensure(result.d(
true) == 1);
650 ensure(result.p(
true) == 2);
651 ensure(result.dd(
true) == 2);
652 ensure(result.vector_space_path(
true) == xvector_space_path);
670 require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
671 require(standard_host_is_available<at2_e2>(xns, xsuffix, xauto_access));
681 poset_path lvector_space_path = vector_space_type::standard_host(xns, xsuffix, xauto_access).
path(
true);
683 poset_path lpath(standard_host_path<at2_e2>(xsuffix));
692 result_ptr = &new_host(xns, lpath, standard_schema_path(), lvector_space_path, xauto_access);
699 ensure(xns.
owns(result, xauto_access));
700 ensure(result.
path(
true) == standard_host_path<at2_e2>(xsuffix));
702 ensure(result.
schema(
true).
path(xauto_access) == standard_schema_path());
705 ensure(result.
d(
true) == 1);
706 ensure(result.
scalar_space_path(
true) == standard_host_path<vector_space_type::scalar_type>(xsuffix) );
707 ensure(result.
p(
true) == 2);
708 ensure(result.
dd(
true) == 2);
709 ensure(result.
vector_space_path(
true) == standard_host_path<vector_space_type>(xsuffix) );
752 attach_to_state(xhost, xhub_id);
758 ensure(index() == xhub_id);
759 ensure(is_attached());
773 attach_to_state(xhost, xid.
hub_pod());
779 ensure(index() ==~ xid);
780 ensure(is_attached());
791 require(!xname.empty());
796 attach_to_state(xhost, xname);
802 ensure(name() == xname);
803 ensure(is_attached());
812 require(xother != 0);
816 attach_to_state(xother);
821 ensure(is_attached());
822 ensure(is_same_state(xother));
831 require(precondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
835 new_jim_state(xhost, 0,
false, xauto_access);
839 ensure(postcondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
854 require(precondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
858 new_jim_state(&xhost, 0,
false, xauto_access);
874 ensure(postcondition_of(new_jim_state(&xhost, 0,
false, xauto_access)));
887 require(state_is_read_write_accessible());
909 require(is_ancestor_of(&xother));
910 require(precondition_of(attach_to_state(&xother)));
914 attach_to_state(&xother);
918 ensure(postcondition_of(attach_to_state(&xother)));
932 require(precondition_of(attach_to_state(&xother)));
936 attach_to_state(&xother);
940 ensure(postcondition_of(attach_to_state(&xother)));
1003 require(state_is_read_write_accessible());
1007 put_component(0, xy_comp);
1012 ensure(invariant());
1020 fiber_bundle::at2_e2::
1037 fiber_bundle::at2_e2::
1115 require(precondition_of(e2::new_tp(vector_space(xauto_access), xp)));
1119 tp* result = e2::new_tp(vector_space(xauto_access), xp);
1123 ensure(postcondition_of(e2::new_tp(vector_space(xauto_access), xp)));
1136 require(precondition_of(e2::new_atp(vector_space(xauto_access), xp)));
1140 atp* result = e2::new_atp(vector_space(xauto_access), xp);
1144 ensure(postcondition_of(e2::new_atp(vector_space(xauto_access), xp)));
1157 require(precondition_of(e2::new_stp(vector_space(xauto_access), xp)));
1161 stp* result = e2::new_stp(vector_space(xauto_access), xp);
1165 ensure(postcondition_of(e2::new_stp(vector_space(xauto_access), xp)));
1193 const string& result = static_class_name();
1197 ensure(!result.empty());
1212 static const string result(
"at2_e2");
1216 ensure(!result.empty());
1238 ensure(result != 0);
1265 require(xother != 0);
1269 bool result =
dynamic_cast<const at2_e2*
>(xother) != 0;
1289 invariance(at2::invariant());
1291 if(invariant_check())
1295 disable_invariant_check();
1299 invariance(at2::invariant());
1303 invariance((state_is_read_accessible() ? dd() == 2 :
true));
1307 enable_invariant_check();
1324 #include "SheafSystem/at0.h" 1575 require(precondition_of(
star(x0, *result)));
1587 ensure(result != 0);
1588 ensure(postcondition_of(
star(x0, *result)));
1615 define_old_variable(
bool old_xresult_is_p_form = xresult.
is_p_form(
false));
1625 ensure(xresult.
is_p_form(xauto_access) == old_xresult_is_p_form);
1659 require(precondition_of(
star(x0, *result)));
1671 ensure(result != 0);
1672 ensure(postcondition_of(
star(x0, *result)));
1770 ensure(result != 0);
1838 require(x0.
dd() == xresult.
dd());
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.
at2_e2 & operator=(const row_dofs_type &xrdt)
Assignment to an instance of the associated row dofs type.
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.
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 2 (persistent version)...
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
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).
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.
Euclidean vector space of dimension 2 (persistent version).
static const std::string & static_class_name()
The name of this class.
static host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path<at2_e3>(xsuffix). Returns the host if it already exists...
bool invariant() const
Class invariant.
poset_path path(bool xauto_access=true) const
A path to this component.
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...
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...
bool is_same_type(const any_lite &xother) const
True if other is the same type as this.
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.
virtual tp * new_tp(int xp, bool xauto_access) const
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 std::string & class_name() const
The name of this class.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
virtual at2_e2_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
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.
virtual volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 2 (volatile 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.
virtual const tp_lite & tp_prototype(int xp) const
Prototype for general tensors of degree xp over this vector space.
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.
at2_e2_lite()
Default constructor.
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).
static const std::string & static_class_name()
The name of this class.
Euclidean vector space of dimension 2 (volatile version).
An abstract antisymmetric tensor space of degree p.
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)
virtual stp * new_stp(int xp, bool xauto_access) const
Virtual constructor for symmetric tensors of degree xp over vector space xvector_space.
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.
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
virtual int dd() const
Dimension of the underlying vector space.
A scalar viewed as an antisymmetric tensor of degree 0. As the degree is 0 there is nothing to be sym...
at2_e2_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
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).
at2_e2()
Default constructor.
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 const atp_lite & atp_prototype(int xp) const
Prototype for antisymmetric tensors of degree xp over this vector space.
virtual value_type component(int xindex) const
The value of the xi-th component.
virtual at2_e2 * clone() const
Make a new handle, no state instance of current.
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 void put_component(value_type xy)
Set value of the xy component to xy_comp.
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
virtual ~at2_e2_lite()
Destructor.
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_components(dof_type xy_comp)
Sets values of the components to the given arguments.
T components[1]
The xy dof.
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...
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.
virtual void put_component(value_type xcomp)
Set value of (the only) component to xcomp.
virtual const stp_lite & stp_prototype(int xp) const
Prototype for symmetric tensors of degree xp over this vector space.
virtual atp * new_atp(int xp, bool xauto_access) const
Virtual constructor for antisymmetric tensors of degree xp over vector space xvector_space.
static int factor_ct(int xd)
Factor_ct() as a function of dimension xd.
row_dofs_type _row_dofs
Row_dofs_type.
int_type pod_index_type
The plain old data index type.
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
int dd() const
The dimension of the underlying ("domain") vector space.
bool is_ancestor_of(const any *xother) const
True if other conforms to current.
A general antisymmetric tensor of degree 2 over an abstract vector space (volatile version)...
virtual void * row_dofs()
The row dofs for this instance (mutable version).
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.
at2_e2_lite & operator=(const at2_e2_lite &xother)
Assignment operator.
std::string path() const
The full path as a string.
bool invariant() const
Class invariant.
vd_dof_type dof_type
The type of the degrees of freedom. Note that although dof_type == value_type in this implementation...
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
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.
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.
virtual int dd() const
Dimension of the underlying vector space.
SHEAF_DLL_SPEC bool isunordered_or_equals(float x1, float x2)
True if isunordered(x1, x2) or x1 == x2.