21 #include "SheafSystem/sec_ed.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_at1_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/at1.h" 34 #include "SheafSystem/at1_space.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_scalar_fiber_space(xns, xschema_path, xscalar_space_path, xauto_access));
77 host_type& result = host_type::new_table(xns, xhost_path, xschema_path, xscalar_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);
88 ensure(result.
d(
true) == result.
dd(
true));
91 ensure(result.
p(
true) == 1);
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());
201 require(precondition_of(attach_to_state(same args)));
205 attach_to_state(xnamespace, xpath, xauto_access);
209 ensure(postcondition_of(attach_to_state(same args)));
223 require(xother != 0);
227 attach_to_state(xother);
232 ensure(is_attached());
233 ensure(is_same_state(xother));
234 ensure(is_same_restriction(xother));
244 require(precondition_of(new_jim_state(xhost, xdof_map,
false, xauto_access)));
248 new_jim_state(xhost, xdof_map,
false, xauto_access);
252 ensure(postcondition_of(new_jim_state(xhost, xdof_map,
false, xauto_access)));
262 int xbase_version,
bool xauto_access)
267 require(precondition_of(\
268 new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access)));
272 new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access);
288 require(is_ancestor_of(&xother));
289 require(precondition_of(attach_to_state(&xother)));
293 attach_to_state(&xother);
297 ensure(postcondition_of(attach_to_state(&xother)));
310 require(precondition_of(attach_to_state(&xother)));
314 attach_to_state(&xother);
318 ensure(postcondition_of(attach_to_state(&xother)));
331 require(precondition_of(sec_vd::operator=(xfiber)));
335 sec_vd::operator=(xfiber);
339 ensure(postcondition_of(sec_vd::operator=(xfiber)));
352 require(precondition_of(sec_vd::operator=(xfiber)));
356 sec_vd::operator=(xfiber);
360 ensure(postcondition_of(sec_vd::operator=(xfiber)));
470 const string& result = static_class_name();
474 ensure(!result.empty());
489 static const string result(
"sec_ed");
493 ensure(!result.empty());
542 require(xother != 0);
549 bool result =
dynamic_cast<const ed*
>(xother) != 0;
569 require(xother != 0);
576 bool result =
dynamic_cast<const sec_ed*
>(xother) != 0;
600 invariance(sec_at1::invariant());
602 if (invariant_check())
606 disable_invariant_check();
610 enable_invariant_check();
615 ensure(is_derived_query);
641 xlresult =
dot(xl0, xl1);
654 class put_length_functor
668 class normalize_functor
682 #include "SheafSystem/sec_vd.impl.h" 700 binary_op(x0, x1, xresult, dot_functor(), xauto_access);
721 unary_op(x0, xresult, length_functor(), xauto_access);
738 require(xlength >= 0.0);
742 unary_op(x0, xlength, put_length_functor(), xauto_access);
746 ensure(unexecutable(
"length(x0, xauto_access) == xlength"));
789 unary_op(x0, xresult, normalize_functor(), xauto_access);
794 ensure(unexecutable(
"length(xresult, xauto_access) == 1.0"));
807 require(precondition_of(
normalize(x0, x0, xauto_access)));
815 ensure(postcondition_of(
normalize(x0, x0, xauto_access)));
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 ...
bool full() const
True if both poset name and member name are not empty.
A Cartesian product section space.
Namespace containing the Euclidean vector algebra functions for the fiber_bundles component of the sh...
The abstract map from section dof ids to section dof values of heterogeneous type.
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...
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.
A general antisymmetric tensor of degree 1 over an abstract vector space (persistent version)...
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
SHEAF_DLL_SPEC void length(const sec_ed &x0, sec_at0 &xresult, bool xauto_access)
The Euclidean length (magnitude) of x0.
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 const std::string & static_class_name()
The name of this class.
virtual sec_ed & operator=(const abstract_poset_member &xother)
Assignment operator; synonym for attach_to_state(&xother).
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.
virtual const std::string & class_name() const
The name of this class.
SHEAF_DLL_SPEC void put_length(sec_ed &x0, const vd_value_type &xlength, bool xauto_access)
Set the Euclidean length (magnitude) of x0 to xlength.
A schema poset for a section space. A binary Cartesian product subspace of the binary tensor product ...
SHEAF_DLL_SPEC vd_value_type dot(const ed &x0, const ed &x1, bool xauto_access)
The Euclidean "dot" product of x0 with x1 (version for persistent types).
SHEAF_DLL_SPEC vd_value_type length(const ed &x0, bool xauto_access)
The Euclidean length (magnitude) of x0 (version for persistent types).
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)
SHEAF_DLL_SPEC void put_length(ed &x0, const vd_value_type &xlength, bool xauto_access)
Set the Euclidean length (magnitude) of x0 to xlength. (version for persistent types).
Euclidean vector space of dimension d (volatile version).
void binary_op(const S0 &x0, const S1 &x1, SR &xresult, F xfunctor, bool xauto_access)
Binary operator.
virtual sec_ed * clone() const
Make a new handle, no state instance of current.
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.
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...
bool is_ancestor_of(const any *xother) const
True if xother conforms to current.
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
Antisymetric tensor of degree 0 (volatile version).
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.
SHEAF_DLL_SPEC void normalize(const ed &x0, ed &xresult, bool xauto_access)
Normalize x0 (convert to a unit vector) (pre_allocated version for persistent types).
SHEAF_DLL_SPEC void normalize(const sec_ed &x0, sec_ed &xresult, bool xauto_access)
Normalize x0 (convert to a unit vector).
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
Euclidean vector space of dimension d (peresistent version).
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).
bool invariant() const
Class invariant.
Namespace containing the algrebra functions for a a section of a fiber bundle with a d-dimensional ve...
SHEAF_DLL_SPEC void dot(const sec_ed &x0, const sec_ed &x1, sec_at0 &xresult, bool xauto_access)
The Euclidean "dot" product of x0 with x2.
An abstract client handle for a member of a poset.
Namespace for the fiber_bundles component of the sheaf system.
bool is_same_type(const any *other) const
True if other is the same type as this.
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...
double vd_value_type
The type of component in the fiber; the scalar type in the fiber vector space.
sec_ed()
Default constructor.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
virtual const fiber_type & fiber_prototype() const
Virtual constructor for the associated fiber type.
A handle for a poset whose members are numerical representations of sections of a fiber bundle...