22 #include "SheafSystem/sec_at2_e3.h" 24 #include "SheafSystem/assert_contract.h" 25 #include "SheafSystem/base_space_poset.h" 26 #include "SheafSystem/binary_section_space_schema_member.impl.h" 27 #include "SheafSystem/at1_space.h" 28 #include "SheafSystem/fiber_bundles_namespace.h" 29 #include "SheafSystem/index_space_iterator.h" 30 #include "SheafSystem/sec_at0.h" 31 #include "SheafSystem/sec_at0_space.h" 32 #include "SheafSystem/sec_at1_space.h" 33 #include "SheafSystem/sec_e3.h" 34 #include "SheafSystem/sec_tuple.impl.h" 35 #include "SheafSystem/sec_tuple_space.impl.h" 36 #include "SheafSystem/sec_vd.impl.h" 37 #include "SheafSystem/at2_e3.h" 66 require(!xhost_path.
empty());
69 require(xschema_path.
full());
71 require(host_type::fiber_space_conforms<fiber_type::host_type>(xns, xschema_path, xauto_access));
75 require(host_type::same_vector_fiber_space(xns, xschema_path, xvector_space_path, xauto_access));
79 host_type& result = host_type::new_table(xns, xhost_path, xschema_path, xvector_space_path, xauto_access);
83 ensure(xns.
owns(result, xauto_access));
84 ensure(result.
path(
true) == xhost_path);
86 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
93 ensure(result.
p(
true) == 2);
108 const std::string& xsection_suffix,
109 const std::string& xfiber_suffix,
118 require(xbase_path.
full());
121 require(xrep_path.
empty() || xrep_path.
full());
124 require(xsection_suffix.empty() || poset_path::is_valid_name(xsection_suffix));
126 require(xfiber_suffix.empty() || poset_path::is_valid_name(xfiber_suffix));
128 require(standard_host_is_available<sec_at2_e3>(xns, xbase_path, xrep_path, xsection_suffix, xfiber_suffix, xauto_access));
129 require(fiber_type::standard_host_is_available<fiber_type>(xns, xfiber_suffix, xauto_access));
130 require(schema_type::standard_host_is_available<sec_at2_e3>(xns, xbase_path, xrep_path, xfiber_suffix, xauto_access));
134 poset_path lstd_path = standard_host_path<sec_at2_e3>(xbase_path, xrep_path, xsection_suffix, xfiber_suffix);
150 poset_path lrep_path = (!xrep_path.empty() ? xrep_path : standard_rep_path());
155 schema_type::standard_member<sec_at2_e3>(xns, xbase_path, lrep_path, xfiber_suffix, xauto_access);
160 vector_space_type::standard_host(xns, xbase_path, lrep_path, xsection_suffix, xfiber_suffix, xauto_access).
path(xauto_access);
164 lresult_ptr = &new_host(xns, lstd_path, lstd_schema_path, lvector_space_path, xauto_access);
171 ensure(xns.
owns(result, xauto_access));
172 ensure(result.
path(
true) == standard_host_path<sec_at2_e3>(xbase_path, xrep_path, xsection_suffix, xfiber_suffix));
174 ensure(result.
schema(
true).
path(xauto_access) ==
175 schema_type::standard_member_path<sec_at2_e3>(xbase_path, xrep_path, xfiber_suffix));
180 scalar_type::standard_host_path<scalar_type>(xbase_path, result.
rep().
path(xauto_access), xsection_suffix, xfiber_suffix));
182 ensure(result.
p(
true) == 2);
185 vector_space_type::standard_host_path<vector_space_type>(xbase_path, result.
rep().
path(xauto_access), xsection_suffix, xfiber_suffix));
227 attach_to_state(&xother);
233 ensure(is_same_state(&xother));
234 ensure(is_same_restriction(&xother));
241 int xbase_version,
bool xauto_access)
246 require(precondition_of(new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access)));
250 new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access);
254 ensure(postcondition_of(new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access)));
267 require(precondition_of(new_jim_state(xhost, xdof_map,
false, xauto_access)));
271 new_jim_state(xhost, xdof_map,
false, xauto_access);
275 ensure(postcondition_of(new_jim_state(xhost, xdof_map,
false, xauto_access)));
293 attach_to_state(xhost, xhub_id);
299 ensure(index() == xhub_id);
300 ensure(is_attached());
301 ensure(!is_restricted());
315 attach_to_state(xhost, xid.
hub_pod());
321 ensure(index() ==~ xid);
322 ensure(is_attached());
323 ensure(!is_restricted());
334 require(!xname.empty());
339 attach_to_state(xhost, xname);
345 ensure(name() == xname);
346 ensure(is_attached());
347 ensure(!is_restricted());
359 require(precondition_of(attach_to_state(same args)));
363 attach_to_state(xnamespace, xpath, xauto_access);
367 ensure(postcondition_of(attach_to_state(same args)));
380 require(is_ancestor_of(&xother));
381 require(precondition_of(attach_to_state(&xother)));
385 attach_to_state(&xother);
389 ensure(postcondition_of(attach_to_state(&xother)));
402 require(precondition_of(attach_to_state(&xother)));
406 attach_to_state(&xother);
410 ensure(postcondition_of(attach_to_state(&xother)));
423 require(precondition_of(sec_vd::operator=(xfiber)));
427 sec_vd::operator=(xfiber);
431 ensure(postcondition_of(sec_vd::operator=(xfiber)));
444 require(precondition_of(sec_vd::operator=(xfiber)));
448 sec_vd::operator=(xfiber);
452 ensure(postcondition_of(sec_vd::operator=(xfiber)));
550 const string& result = static_class_name();
554 ensure(!result.empty());
569 static const string result(
"sec_at2_e3");
573 ensure(!result.empty());
623 require(xother != 0);
627 bool result =
dynamic_cast<const at2_e3*
>(xother) != 0;
647 require(xother != 0);
651 bool result =
dynamic_cast<const sec_at2_e3*
>(xother) != 0;
671 if (invariant_check())
675 disable_invariant_check();
679 invariance(sec_atp::invariant());
683 invariance(state_is_read_accessible() ? dd() == 3 :
true);
687 enable_invariant_check();
714 hook(x0, x1, xresult);
720 hook(x0, x1, xresult);
744 wedge(x0, x1, xresult);
752 #include "SheafSystem/sec_vd.impl.h" 753 #include "SheafSystem/sec_e3.h" 754 #include "SheafSystem/sec_at0.h" 768 require(x1.
dd(xauto_access) == x0.
dd(xauto_access));
770 require(xresult.
p(xauto_access) == x0.
p(xauto_access) - 1);
774 binary_op(x0, x1, xresult, hook_functor(), xauto_access);
799 require(x1.
dd(xauto_access) == x0.
dd(xauto_access));
801 require(xresult.
p(xauto_access) == x0.
p(xauto_access) - 1);
805 binary_op(x0, x1, xresult, hook_functor(), xauto_access);
832 unary_op(x0, xresult, star_functor(), xauto_access);
840 define_old_variable(\
841 bool old_xresult_is_p_form = xresult.
is_p_form(xauto_access));
843 if(x0.
p(xauto_access) > 0)
851 ensure((x0.
p(xauto_access)>0) \
853 ensure((x0.
p(xauto_access)==0) \
854 ? (xresult.
is_p_form(xauto_access) == old_xresult_is_p_form):
true );
872 unary_op(x0, xresult, star_functor(), xauto_access);
880 define_old_variable(\
881 bool old_xresult_is_p_form = xresult.
is_p_form(xauto_access));
883 if(x0.
p(xauto_access) > 0)
891 ensure((x0.
p(xauto_access)>0) \
893 ensure((x0.
p(xauto_access)==0) \
894 ? (xresult.
is_p_form(xauto_access) == old_xresult_is_p_form):
true );
912 require(x0.
dd(xauto_access) >= xresult.
dd(xauto_access));
913 require(x1.
dd(xauto_access) >= xresult.
dd(xauto_access));
914 require(xresult.
p(xauto_access) == x0.
p(xauto_access) + x1.
p(xauto_access));
919 binary_op(x0, x1, xresult, wedge_functor(), xauto_access);
924 x1.
variance(xauto_access)), xauto_access);
928 ensure(xresult.
variance(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 ...
static const std::string & static_class_name()
The name of this class.
A section of a bundle with fiber type at2_e3.
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.
Euclidean vector space of dimension 3 (volatile version).
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.
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 3. (persistent version)...
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...
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.
virtual const std::string & class_name() const
The name of this class.
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.
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...
void put_variance(const tensor_variance &xvariance, bool xauto_access)
Sets the variance to xvariance.
The poset for sec_rep_descriptors.
virtual int p() const
The degree of the tensors in host(); the sum of the contravariant and covariant degrees.
sec_at2_e3()
Default constructor; creates an unattached handle.
Abstract base class with useful features for all objects.
int p() const
The tensor degree of this space.
The lattice of closed cells of a cellular space; a lattice representation of a computational mesh...
sec_rep_descriptor & rep()
A representation descriptor for this sec rep space (mutable version).
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)...
An abstract antisymmetric tensor 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.
virtual const fiber_type & fiber_prototype() const
Virtual constructor for the associated fiber type.
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).
virtual bool is_attached() const
True if this handle is attached to a non-void state.
Namespace containing the antisymmetric tensor algrebra functions for the fiber_bundles component of t...
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.
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.
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)...
static host_type & standard_host(namespace_type &xns, const poset_path &xbase_path, const poset_path &xrep_path, const std::string &xsection_suffix, const std::string &xfiber_suffix, bool xauto_access)
The standard host for sections of this type with base space xbase_path, representation xrep_path...
virtual sec_at2_e3 * clone() const
Make a new handle, no state instance of current.
virtual sec_at2_e3 & 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).
Namespace containing the algrebra functions for a a section of a fiber bundle with a d-dimensional ve...
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 3. (volatile version)...
An abstract client handle for a member of a poset.
std::string path() const
The full path as a string.
bool fiber_is_ancestor_of(const any *xother) const
True if xother conforms to an instance of the fiber of current.
Namespace for the fiber_bundles component of the sheaf system.
bool is_ancestor_of(const any *other) const
True if other conforms to current.
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...
A general antisymmetric tensor of degree 2 over an abstract vector space.
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...
bool invariant() const
Class invariant.
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...