21 #include "SheafSystem/sec_met.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_stp_space.h" 30 #include "SheafSystem/sec_tuple_space.impl.h" 31 #include "SheafSystem/section_space_schema_member.impl.h" 32 #include "SheafSystem/section_space_schema_poset.h" 33 #include "SheafSystem/stp.h" 34 #include "SheafSystem/stp_space.h" 63 require(!xhost_path.
empty());
66 require(xschema_path.
full());
68 require(host_type::fiber_space_conforms<fiber_type::host_type>(xns, xschema_path, xauto_access));
72 require(host_type::same_scalar_fiber_space(xns, xschema_path, xscalar_space_path, xauto_access));
76 host_type& result = host_type::new_table(xns, xhost_path, xschema_path, xscalar_space_path, xauto_access);
80 ensure(xns.
owns(result, xauto_access));
81 ensure(result.
path(
true) == xhost_path);
83 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
87 ensure(result.
d(
true) == result.
dd(
true));
90 ensure(result.
p(
true) == 2);
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)));
264 require(is_ancestor_of(&xother));
265 require(precondition_of(attach_to_state(&xother)));
269 attach_to_state(&xother);
273 ensure(postcondition_of(attach_to_state(&xother)));
286 require(precondition_of(attach_to_state(&xother)));
290 attach_to_state(&xother);
294 ensure(postcondition_of(attach_to_state(&xother)));
307 require(precondition_of(sec_vd::operator=(xfiber)));
311 sec_vd::operator=(xfiber);
315 ensure(postcondition_of(sec_vd::operator=(xfiber)));
328 require(precondition_of(sec_vd::operator=(xfiber)));
332 sec_vd::operator=(xfiber);
336 ensure(postcondition_of(sec_vd::operator=(xfiber)));
445 const string& result = static_class_name();
449 ensure(!result.empty());
464 static const string result(
"sec_met");
468 ensure(!result.empty());
517 require(xother != 0);
524 bool result =
dynamic_cast<const met*
>(xother) != 0;
544 require(xother != 0);
551 bool result =
dynamic_cast<const sec_met*
>(xother) != 0;
576 invariance(sec_st2::invariant());
578 if (invariant_check())
582 disable_invariant_check();
586 enable_invariant_check();
591 ensure(is_derived_query);
658 #include "SheafSystem/error_message.h" 659 #include "SheafSystem/sec_e1.h" 660 #include "SheafSystem/sec_e2.h" 661 #include "SheafSystem/sec_e3.h" 662 #include "SheafSystem/sec_met_e1.h" 663 #include "SheafSystem/sec_met_e2.h" 664 #include "SheafSystem/sec_met_e3.h" 685 const sec_e1* e1_xvector =
dynamic_cast<const sec_e1*
>(&xvector);
686 const sec_e2* e2_xvector =
dynamic_cast<const sec_e2*
>(&xvector);
687 const sec_e3* e3_xvector =
dynamic_cast<const sec_e3*
>(&xvector);
693 if(met_e1_xmetric && e1_xvector && e1_xresult)
695 lower(*met_e1_xmetric, *e1_xvector, *e1_xresult, xauto_access);
697 else if(met_e2_xmetric && e2_xvector && e2_xresult)
699 lower(*met_e2_xmetric, *e2_xvector, *e2_xresult, xauto_access);
701 else if(met_e3_xmetric && e3_xvector && e3_xresult)
703 lower(*met_e3_xmetric, *e3_xvector, *e3_xresult, xauto_access);
707 post_fatal_error_message(\
708 "Unsupported argument types in call to lower(...)");
739 const sec_e1* e1_xcovector =
dynamic_cast<const sec_e1*
>(&xcovector);
740 const sec_e2* e2_xcovector =
dynamic_cast<const sec_e2*
>(&xcovector);
741 const sec_e3* e3_xcovector =
dynamic_cast<const sec_e3*
>(&xcovector);
747 if(met_e1_xmetric && e1_xcovector && e1_xresult)
749 lower(*met_e1_xmetric, *e1_xcovector, *e1_xresult, xauto_access);
751 else if(met_e2_xmetric && e2_xcovector && e2_xresult)
753 lower(*met_e2_xmetric, *e2_xcovector, *e2_xresult, xauto_access);
755 else if(met_e3_xmetric && e3_xcovector && e3_xresult)
757 lower(*met_e3_xmetric, *e3_xcovector, *e3_xresult, xauto_access);
761 post_fatal_error_message(\
762 "Unsupported argument types in call to lower(...)");
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 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 abstract symmetric tensor section space of degree p.
virtual const fiber_type & fiber_prototype() const
Virtual constructor for the associated fiber type.
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.
A section of a bundle with fiber type met_e1.
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...
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 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.
SHEAF_DLL_SPEC void lower(const sec_met &xmetric, const sec_ed &xvector, sec_ed &xresult, bool xauto_access)
Lower vector (pre-allocated version).
A schema poset for a section space. A binary Cartesian product subspace of the binary tensor product ...
bool invariant() const
Class invariant.
A metric tensor over an abstract vector space (volatile version).
virtual sec_met & operator=(const abstract_poset_member &xother)
Assignment operator; synonym for attach_to_state(&xother).
static const std::string & static_class_name()
The name of this class.
A metric tensor over an abstract vector space (persistent version).
virtual sec_met * clone() const
Make a new handle, no state instance of current.
A section of a bundle with fiber type met.
A section of a fiber bundle with a d-dimensional Euclidean vector space fiber.
Abstract base class with useful features for all objects.
int p() const
The tensor degree of this space.
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.
virtual bool is_contravariant(bool xauto_access) const
True if and only if all tensor index positions are contravariant.
virtual int d(int xp, int xdd) const
Dimension d() as a function of degree xp and domain dimension xdd.
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.
virtual const std::string & class_name() const
The name of this class.
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 met_e3.
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...
int dd() const
The dimension of the underlying ("domain") vector space.
bool empty() const
True if both poset name and member name are empty.
A section of a fiber bundle with a 3-dimensional Euclidean vector space fiber.
sec_met()
Default constructor.
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).
A section of a fiber bundle with a 1-dimensional Euclidean vector space fiber.
virtual bool is_covariant(bool xauto_access) const
True if and only if all tensor index positions are covariant.
An abstract client handle for a member of a poset.
SHEAF_DLL_SPEC void raise(const sec_met &xmetric, const sec_ed &xcovector, sec_ed &xresult, bool xauto_access)
Raise covector (pre-allocated version).
A section of a bundle with fiber type met_e2.
An abstract symmetric tensor space of degree p.
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...
bool is_ancestor_of(const any *xother) const
True if xother conforms to current.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
A section of a fiber bundle with a 2-dimensional Euclidean vector space fiber.
A handle for a poset whose members are numerical representations of sections of a fiber bundle...