21 #include "SheafSystem/sec_atp.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/atp.h" 25 #include "SheafSystem/atp_space.h" 26 #include "SheafSystem/binary_section_space_schema_member.impl.h" 27 #include "SheafSystem/binary_section_space_schema_poset.h" 28 #include "SheafSystem/fiber_bundles_namespace.h" 29 #include "SheafSystem/section_space_schema_member.impl.h" 30 #include "SheafSystem/section_space_schema_poset.h" 31 #include "SheafSystem/sec_at1.h" 32 #include "SheafSystem/sec_at1_space.h" 33 #include "SheafSystem/sec_atp_space.h" 34 #include "SheafSystem/sec_tuple_space.impl.h" 64 require(!xhost_path.
empty());
67 require(xschema_path.
full());
69 require(host_type::fiber_space_conforms<fiber_type::host_type>(xns, xschema_path, xauto_access));
73 require(host_type::same_vector_fiber_space(xns, xschema_path, xvector_space_path, xauto_access));
77 host_type& result = host_type::new_table(xns, xhost_path, xschema_path, xvector_space_path, xauto_access);
81 ensure(xns.
owns(result, xauto_access));
82 ensure(result.
path(
true) == xhost_path);
84 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
135 attach_to_state(xhost, xhub_id);
141 ensure(index() == xhub_id);
142 ensure(is_attached());
143 ensure(!is_restricted());
157 attach_to_state(xhost, xid.
hub_pod());
163 ensure(index() ==~ xid);
164 ensure(is_attached());
165 ensure(!is_restricted());
176 require(!xname.empty());
181 attach_to_state(xhost, xname);
187 ensure(name() == xname);
188 ensure(is_attached());
189 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)));
221 require(xother != 0);
225 attach_to_state(xother);
230 ensure(is_attached());
231 ensure(is_same_state(xother));
232 ensure(is_same_restriction(xother));
242 require(precondition_of(new_jim_state(xhost, xdof_map,
false, xauto_access)));
246 new_jim_state(xhost, xdof_map,
false, xauto_access);
250 ensure(postcondition_of(new_jim_state(xhost, xdof_map,
false, xauto_access)));
260 int xbase_version,
bool xauto_access)
265 require(precondition_of(new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access)));
269 new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access);
273 ensure(postcondition_of(new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access)));
286 require(is_ancestor_of(&xother));
287 require(precondition_of(attach_to_state(&xother)));
291 attach_to_state(&xother);
295 ensure(postcondition_of(attach_to_state(&xother)));
308 require(precondition_of(attach_to_state(&xother)));
312 attach_to_state(&xother);
316 ensure(postcondition_of(attach_to_state(&xother)));
329 require(precondition_of(sec_vd::operator=(xfiber)));
333 sec_vd::operator=(xfiber);
337 ensure(postcondition_of(sec_vd::operator=(xfiber)));
350 require(precondition_of(sec_vd::operator=(xfiber)));
354 sec_vd::operator=(xfiber);
358 ensure(postcondition_of(sec_vd::operator=(xfiber)));
400 require(state_is_auto_read_accessible(xauto_access));
401 require(host()->contains_variance_subposets(xauto_access));
405 bool result = host()->is_p_form(_index, xauto_access);
420 require(state_is_auto_read_write_accessible(xauto_access));
421 require(host()->contains_variance_subposets(xauto_access));
425 host()->put_is_p_form(_index, xauto_access);
429 ensure(is_p_form(xauto_access));
443 require(state_is_auto_read_accessible(xauto_access));
444 require(host()->contains_variance_subposets(xauto_access));
448 bool result = host()->is_p_vector(_index, xauto_access);
463 require(state_is_auto_read_write_accessible(xauto_access));
464 require(host()->contains_variance_subposets(xauto_access));
468 host()->put_is_p_vector(_index, xauto_access);
472 ensure(is_p_vector(xauto_access));
531 const string& result = static_class_name();
535 ensure(!result.empty());
550 static const string result(
"sec_atp");
554 ensure(!result.empty());
600 return reinterpret_cast<host_type*
>(_host);
607 return dynamic_cast<const host_type*
>(xother) != 0;
628 require(xother != 0);
635 bool result =
dynamic_cast<const atp*
>(xother) != 0;
654 require(xother != 0);
661 bool result =
dynamic_cast<const sec_atp*
>(xother) != 0;
685 invariance(sec_tp::invariant());
687 if (invariant_check())
691 disable_invariant_check();
698 enable_invariant_check();
703 ensure(is_derived_query);
719 #include "SheafSystem/error_message.h" 720 #include "SheafSystem/sec_at0.h" 721 #include "SheafSystem/sec_e2.h" 722 #include "SheafSystem/sec_e3.h" 723 #include "SheafSystem/sec_at2_e2.h" 724 #include "SheafSystem/sec_at2_e3.h" 725 #include "SheafSystem/sec_at3_e3.h" 737 require(x1.
dd(xauto_access) == x0.
dd(xauto_access));
757 if(e2_x0 && e2_x1 && at0_xresult)
759 hook(*e2_x0, *e2_x1, *at0_xresult, xauto_access);
761 else if(at2_e2_x0 && e2_x1 && e2_xresult)
763 hook(*at2_e2_x0, *e2_x1, *e2_xresult, xauto_access);
765 else if(e3_x0 && e3_x1 && at0_xresult)
767 hook(*e3_x0, *e3_x1, *at0_xresult, xauto_access);
769 else if(at2_e3_x0 && e3_x1 && e3_xresult)
771 hook(*at2_e3_x0, *e3_x1, *e3_xresult, xauto_access);
773 else if(at3_e3_x0 && e3_x1 && at2_e3_xresult)
775 hook(*at3_e3_x0, *e3_x1, *at2_e3_xresult, xauto_access);
779 post_fatal_error_message(\
780 "Unsupported argument types in call to hook(...)");
817 if(at2_e2_x0 && at0_xresult)
819 star(*at2_e2_x0, *at0_xresult, xauto_access);
821 else if(at0_x0 && at2_e2_xresult)
823 star(*at0_x0, *at2_e2_xresult, xauto_access);
825 else if(e2_x0 && e2_xresult)
827 star(*e2_x0, *e2_xresult, xauto_access);
829 else if(at2_e3_x0 && e3_xresult)
831 star(*at2_e3_x0, *e3_xresult, xauto_access);
833 else if(e3_x0 && at2_e3_xresult)
835 star(*e3_x0, *at2_e3_xresult, xauto_access);
837 else if(at3_e3_x0 && at0_xresult)
839 star(*at3_e3_x0, *at0_xresult, xauto_access);
841 else if(at0_x0 && at3_e3_xresult)
843 star(*at0_x0, *at3_e3_xresult, xauto_access);
847 post_fatal_error_message(\
848 "Unsupported argument types in call to star(...)");
874 require(x0.
dd(xauto_access) >= xresult.
dd(xauto_access));
875 require(x1.
dd(xauto_access) >= xresult.
dd(xauto_access));
876 require(xresult.
p(xauto_access) == x0.
p(xauto_access) + x1.
p(xauto_access));
892 if(e2_x0 && e2_x1 && at2_e2_xresult)
894 wedge(*e2_x0, *e2_x1, *at2_e2_xresult, xauto_access);
896 else if(e3_x0 && e3_x1 && at2_e3_xresult)
898 wedge(*e3_x0, *e3_x1, *at2_e3_xresult, xauto_access);
900 else if(at2_e3_x0 && e3_x1 && at3_e3_xresult)
902 wedge(*at2_e3_x0, *e3_x1, *at3_e3_xresult, xauto_access);
906 post_fatal_error_message(\
907 "Unsupported argument types in call to wedge(...)");
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 ...
A section of a bundle with fiber type at2_e3.
void put_is_p_vector(bool xauto_access)
Sets is_p_vector to true.
SHEAF_DLL_SPEC void wedge(const sec_e2 &x0, const sec_e2 &x1, sec_at2_e2 &xresult, bool xauto_access)
The exterior (wedge) product of two antisymmetric tensors (pre-allocated version).
bool full() const
True if both poset name and member name are not empty.
An antisymmetric tensor of degree p.
The abstract map from section dof ids to section dof values of heterogeneous type.
A section of a bundle with fiber type at3_e3.
A space of scalars viewed as an antisymmetric tensor section space of degree 1.
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 client handle for a general, abstract partially order set.
host_type * host() const
The poset this is a member of.
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.
bool fiber_is_ancestor_of(const any *xother) const
True if xother conforms to an instance of the fiber of current.
bool is_ancestor_of(const any *other) const
true if other conforms to current
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...
A schema poset for a section space. A binary Cartesian product subspace of the binary tensor product ...
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 tensor_variance variance(bool xauto_access) const
The variance.
virtual const fiber_type & fiber_prototype() const
Virtual constructor for the associated fiber type.
virtual int p() const
The degree of the tensors in host(); the sum of the contravariant and covariant degrees.
An antisymmetric tensor of degree p over an abstract vector space (volatile version).
Abstract base class with useful features for all objects.
int p() const
The tensor degree of this space.
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...
An abstract antisymmetric tensor section space of degree p.
virtual section_space_schema_member & schema()
The schema for this poset (mutable version)
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)...
A section of a bundle with fiber type at2_e2.
An abstract antisymmetric tensor space of degree p.
bool is_p_vector(bool xauto_access) const
True if this is a p-vector.
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 sec_atp * clone() const
Make a new handle, no state instance of current.
SHEAF_DLL_SPEC void star(const sec_at2_e2 &x0, sec_at0 &xresult, bool xauto_access)
The Hodge star operator for antisymmetric tensors (pre-allocated version).
A section of a bundle with fiber type atp.
virtual int dd() const
Dimension of the underlying vector space.
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. ...
int dd() const
The dimension of the underlying ("domain") vector space.
bool is_p_form(bool xauto_access) const
True if this is a p-form.
bool empty() const
True if both poset name and member name are empty.
virtual const std::string & class_name() const
The name of this class.
bool invariant() const
class invariant
A section of a fiber bundle with a 3-dimensional Euclidean vector space fiber.
SHEAF_DLL_SPEC void hook(const sec_e2 &x0, const sec_e2 &x1, sec_at0 &xresult, bool xauto_access)
The interior (hook) product of two antisymmetric tensors (pre-allocated version for persistent types)...
sec_atp()
Default constructor.
virtual sec_atp & operator=(const abstract_poset_member &xother)
Assignment operator; synonym for attach_to_state(&xother).
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).
void put_is_p_form(bool xauto_access)
Sets is_p_form to true.
An abstract client handle for a member of a poset.
virtual bool host_is_ancestor_of(const poset_state_handle *other) const
True if other conforms to host.
static const std::string & static_class_name()
The name of this class.
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)...
Antisymetric tensor of degree 0. As the degree is 0 there is nothing to be symmetric or antisymmetric...
virtual int d(int xp, int xdd) const
Dimension d() as a function of degree xp and domain dimension xdd.
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...
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...