21 #include "SheafSystem/sec_t3.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/binary_section_space_schema_member.impl.h" 25 #include "SheafSystem/binary_section_space_schema_poset.h" 26 #include "SheafSystem/fiber_bundles_namespace.h" 27 #include "SheafSystem/sec_at0.h" 28 #include "SheafSystem/sec_at0_space.h" 29 #include "SheafSystem/sec_tuple_space.impl.h" 30 #include "SheafSystem/section_space_schema_member.impl.h" 31 #include "SheafSystem/section_space_schema_poset.h" 32 #include "SheafSystem/tp.h" 33 #include "SheafSystem/tp_space.h" 62 require(!xhost_path.
empty());
65 require(xschema_path.
full());
67 require(host_type::fiber_space_conforms<fiber_type::host_type>(xns, xschema_path, xauto_access));
71 require(host_type::same_scalar_fiber_space(xns, xschema_path, xscalar_space_path, xauto_access));
75 host_type& result = host_type::new_table(xns, xhost_path, xschema_path, xscalar_space_path, xauto_access);
79 ensure(xns.
owns(result, xauto_access));
80 ensure(result.
path(
true) == xhost_path);
82 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
86 ensure(result.
d(
true) == result.
dd(
true));
89 ensure(result.
p(
true) == 3);
133 attach_to_state(xhost, xhub_id);
139 ensure(index() == xhub_id);
140 ensure(is_attached());
141 ensure(!is_restricted());
155 attach_to_state(xhost, xid.
hub_pod());
161 ensure(index() ==~ xid);
162 ensure(is_attached());
163 ensure(!is_restricted());
174 require(!xname.empty());
179 attach_to_state(xhost, xname);
185 ensure(name() == xname);
186 ensure(is_attached());
187 ensure(!is_restricted());
200 require(precondition_of(attach_to_state(same args)));
204 attach_to_state(xnamespace, xpath, xauto_access);
208 ensure(postcondition_of(attach_to_state(same args)));
222 require(xother != 0);
226 attach_to_state(xother);
231 ensure(is_attached());
232 ensure(is_same_state(xother));
233 ensure(is_same_restriction(xother));
243 require(precondition_of(new_jim_state(xhost, xdof_map,
false, xauto_access)));
247 new_jim_state(xhost, xdof_map,
false, xauto_access);
251 ensure(postcondition_of(new_jim_state(xhost, xdof_map,
false, xauto_access)));
261 int xbase_version,
bool xauto_access)
266 require(precondition_of(new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access)));
270 new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access);
274 ensure(postcondition_of(new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access)));
287 require(is_ancestor_of(&xother));
288 require(precondition_of(attach_to_state(&xother)));
292 attach_to_state(&xother);
296 ensure(postcondition_of(attach_to_state(&xother)));
309 require(precondition_of(attach_to_state(&xother)));
313 attach_to_state(&xother);
317 ensure(postcondition_of(attach_to_state(&xother)));
330 require(precondition_of(sec_vd::operator=(xfiber)));
334 sec_vd::operator=(xfiber);
338 ensure(postcondition_of(sec_vd::operator=(xfiber)));
351 require(precondition_of(sec_vd::operator=(xfiber)));
355 sec_vd::operator=(xfiber);
359 ensure(postcondition_of(sec_vd::operator=(xfiber)));
455 const string& result = static_class_name();
459 ensure(!result.empty());
474 static const string result(
"sec_t3");
478 ensure(!result.empty());
527 require(xother != 0);
534 bool result =
dynamic_cast<const t3*
>(xother) != 0;
553 require(xother != 0);
560 bool result =
dynamic_cast<const sec_t3*
>(xother) != 0;
584 invariance(sec_tp::invariant());
586 if (invariant_check())
590 disable_invariant_check();
592 invariance(is_attached() ? p() == 3 :
true);
596 enable_invariant_check();
601 ensure(is_derived_query);
649 class contract_functor
652 contract_functor(
int xp,
int xq) : _p(xp), _q(xq) {}
668 tensor(xl0, xl1, xlresult);
674 tensor(xl0, xl1, xlresult);
680 tensor(xl0, xl1, xlresult);
686 tensor(xl0, xl1, xlresult);
692 tensor(xl0, xl1, xlresult);
698 tensor(xl0, xl1, xlresult);
707 #include "SheafSystem/sec_at1.h" 708 #include "SheafSystem/sec_at2.h" 709 #include "SheafSystem/sec_at3.h" 710 #include "SheafSystem/sec_st2.h" 711 #include "SheafSystem/sec_st3.h" 712 #include "SheafSystem/sec_t2.h" 713 #include "SheafSystem/sec_t3.h" 714 #include "SheafSystem/sec_vd.impl.h" 726 require(x0.
dd(xauto_access) == xresult.
dd(xauto_access));
731 unary_op(x0, xresult, alt_functor(), xauto_access);
740 ensure(unexecutable(
"xresult is equal to the antisymmetric part of x0"));
755 require(x0.
dd(xauto_access) == xresult.
dd(xauto_access));
760 unary_op(x0, xresult, alt_functor(), xauto_access);
769 ensure(unexecutable(
"xresult is equal to the antisymmetric part of x0"));
784 require(x0.
dd(xauto_access) == xresult.
dd(xauto_access));
789 unary_op(x0, xresult, sym_functor(), xauto_access);
798 ensure(unexecutable(
"xresult is equal to the symmetric part of x0"));
813 require(x0.
dd(xauto_access) == xresult.
dd(xauto_access));
818 unary_op(x0, xresult, sym_functor(), xauto_access);
827 ensure(unexecutable(
"xresult is equal to the symmetric part of x0"));
844 require(xp >= 0 && xp < x0.
p(xauto_access));
845 require(xq >= 0 && xq < x0.
p(xauto_access));
847 x0.is_contravariant(xq, xauto_access));
851 unary_op(x0, xresult, contract_functor(xp, xq), xauto_access);
855 ensure(unexecutable(
"xresult is the contraction of x0 on indices xp and xq"));
872 require(x1.
dd(xauto_access) == x0.
dd(xauto_access));
873 require(xresult.
dd(xauto_access) == x0.
dd(xauto_access));
877 binary_op(x0, x1, xresult, tensor_functor(), xauto_access);
887 ensure(xresult.
variance(xauto_access) == \
904 require(x1.
dd(xauto_access) == x0.
dd(xauto_access));
905 require(xresult.
dd(xauto_access) == x0.
dd(xauto_access));
909 binary_op(x0, x1, xresult, tensor_functor(), xauto_access);
919 ensure(xresult.
variance(xauto_access) == \
936 require(x1.
dd(xauto_access) == x0.
dd(xauto_access));
937 require(xresult.
dd(xauto_access) == x0.
dd(xauto_access));
941 binary_op(x0, x1, xresult, tensor_functor(), xauto_access);
951 ensure(xresult.
variance(xauto_access) == \
968 require(x1.
dd(xauto_access) == x0.
dd(xauto_access));
969 require(xresult.
dd(xauto_access) == x0.
dd(xauto_access));
973 binary_op(x0, x1, xresult, tensor_functor(), xauto_access);
983 ensure(xresult.
variance(xauto_access) == \
1000 require(x1.
dd(xauto_access) == x0.
dd(xauto_access));
1001 require(xresult.
dd(xauto_access) == x0.
dd(xauto_access));
1005 binary_op(x0, x1, xresult, tensor_functor(), xauto_access);
1015 ensure(xresult.
variance(xauto_access) == \
1032 require(x1.
dd(xauto_access) == x0.
dd(xauto_access));
1033 require(xresult.
dd(xauto_access) == x0.
dd(xauto_access));
1037 binary_op(x0, x1, xresult, tensor_functor(), xauto_access);
1047 ensure(xresult.
variance(xauto_access) == \
A tensor of degree 3 over an abstract vector space (volatile version).
virtual bool invariant() const
Class invariant, intended to be redefined in each descendant. See below for template for invariant in...
static int factor_ct(int xd)
Factor_ct() as a function of dimension xd.
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 const std::string & class_name() const
The name of this class.
SHEAF_DLL_SPEC void sym(const sec_t2 &x0, sec_st2 &xresult, bool xauto_access)
The symmetric part of tensor x0 (pre-allocated version).
SHEAF_DLL_SPEC void alt(const t2_lite &x0, at2_lite &xresult)
The alternating (antisymmetric) part of tensor x0 (pre-allocated version for volatile types)...
sec_t3()
Default constructor.
bool full() const
True if both poset name and member name are not empty.
A Cartesian product section space.
The abstract map from section dof ids to section dof values of heterogeneous type.
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...
void unary_op(const S0 &x0, SR &xresult, F xfunctor, bool xauto_access)
Unary operator.
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...
A tensor of degree 3 over an abstract vector space (persistent version).
bool invariant() const
Class invariant.
A general antisymmetric tensor of degree 1 over an abstract vector space (volatile version)...
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...
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...
SHEAF_DLL_SPEC void sym(const t2_lite &x0, st2_lite &xresult)
The symmetric part of tensor x0 (pre-allocated version for volatile types).
SHEAF_DLL_SPEC void alt(const sec_t2 &x0, sec_at2 &xresult, bool xauto_access)
The alternating (antisymmetric) part of tensor x0 (pre-allocated version).
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
A member of a sec_rep_space; a section.
poset_path vector_space_path() const
The path of the underlying vector space.
A schema poset for a section space. A binary Cartesian product subspace of the binary tensor product ...
A section of a bundle with fiber type at1.
virtual tensor_variance variance(bool xauto_access) const
The variance.
void put_variance(const tensor_variance &xvariance, bool xauto_access)
Sets the variance to xvariance.
SHEAF_DLL_SPEC tensor_variance tensor_product(const tensor_variance &x0, const tensor_variance &x1)
The variance of the tensor product of tensors with variance x0 and x1.
virtual int p() const
The degree of the tensors in host(); the sum of the contravariant and covariant degrees.
bool is_mixed() const
True if and only if there exists at least one index that is covariant and at least one that is contra...
A tensor of degree 2 over an abstract vector space (volatile version).
bool is_ancestor_of(const any *xother) const
True if xother conforms to current.
A section of a bundle with fiber type t3.
Abstract base class with useful features for all objects.
int p() const
The tensor degree of this space.
A general symmetric tensor of degree 2 over an abstract vector space (volatile version).
virtual section_space_schema_member & schema()
The schema for this poset (mutable version)
bool fiber_is_ancestor_of(const any *xother) const
True if xother conforms to an instance of the fiber of current.
static const std::string & static_class_name()
The name of this class.
virtual bool is_contravariant(bool xauto_access) const
True if and only if all tensor index positions are contravariant.
An abstract tensor section space of degree p.
void binary_op(const S0 &x0, const S1 &x1, SR &xresult, F xfunctor, bool xauto_access)
Binary operator.
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)
An index within the external ("client") scope of a given id space.
A section of a bundle with fiber type at2.
virtual int dd() const
Dimension of the underlying vector space.
A section of a bundle with fiber type st2.
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
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. ...
A section of a bundle with fiber type at3.
int dd() const
The dimension of the underlying ("domain") vector space.
A symmetric rank 3 tensor over an abstract vector space. (volatile version).
bool empty() const
True if both poset name and member name are empty.
A section of a bundle with fiber type st3.
virtual const fiber_type & fiber_prototype() const
Virtual constructor for the associated fiber type.
virtual sec_t3 & operator=(const abstract_poset_member &xother)
Assignment operator; synonym for attach_to_state(&xother).
A section of a bundle with fiber type tp.
SHEAF_DLL_SPEC void contract(const sec_t2 &x0, int xp, int xq, sec_at0 &xresult, bool xauto_access)
Contraction on contravariant index xp and covariant index xq (pre-allocated version).
Namespace containing the general tensor algrebra functions for the fiber_bundles component of the she...
int_type pod_index_type
The plain old data index type.
poset_path scalar_space_path() const
The path of the underlying space of scalars.
poset & fiber_space()
The fiber space for section spaces on this schema (mutable version).
SHEAF_DLL_SPEC void tensor(const sec_at1 &x0, const sec_at1 &x1, sec_t2 &xresult, bool xauto_access)
virtual int d(int xp, int xdd) const
Dimension d() as a function of degree xp and domain dimension xdd.
Namespace containing the algrebra functions for a a section of a fiber bundle with a d-dimensional ve...
A general antisymmetric tensor of degree 2 over an abstract vector space (volatile version)...
An abstract client handle for a member of a poset.
An abstract tensor space of degree p.
SHEAF_DLL_SPEC void tensor(const at1_lite &x0, const at1_lite &x1, t2_lite &xresult)
Tensor product (pre-allocated version for volatile types).
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...
virtual sec_t3 * clone() const
Make a new handle, no state instance of current.
SHEAF_DLL_SPEC void contract(const t2_lite &x0, int xp, int xq, at0_lite &xresult)
Contraction on contravariant index xp and covariant index xq (pre-allocated version for volatime type...
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
A handle for a poset whose members are numerical representations of sections of a fiber bundle...