21 #include "SheafSystem/sec_e3.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/base_space_poset.h" 25 #include "SheafSystem/binary_section_space_schema_member.impl.h" 26 #include "SheafSystem/e3.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_tuple.impl.h" 34 #include "SheafSystem/sec_tuple_space.impl.h" 35 #include "SheafSystem/sec_vd.impl.h" 36 #include "SheafSystem/std_iomanip.h" 65 require(!xhost_path.
empty());
68 require(xschema_path.
full());
70 require(host_type::fiber_space_conforms<fiber_type::host_type>(xns, xschema_path, xauto_access));
74 require(host_type::same_scalar_fiber_space(xns, xschema_path, xscalar_space_path, xauto_access));
78 host_type& result = host_type::new_table(xns, xhost_path, xschema_path, xscalar_space_path, xauto_access);
82 ensure(xns.
owns(result, xauto_access));
83 ensure(result.
path(
true) == xhost_path);
85 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
89 ensure(result.
d(
true) == result.
dd(
true));
92 ensure(result.
p(
true) == 1);
107 const std::string& xsection_suffix,
108 const std::string& xfiber_suffix,
117 require(xbase_path.
full());
120 require(xrep_path.
empty() || xrep_path.
full());
123 require(xsection_suffix.empty() || poset_path::is_valid_name(xsection_suffix));
125 require(xfiber_suffix.empty() || poset_path::is_valid_name(xfiber_suffix));
127 require(standard_host_is_available<sec_e3>(xns, xbase_path, xrep_path, xsection_suffix, xfiber_suffix, xauto_access));
128 require(fiber_type::standard_host_is_available<fiber_type>(xns, xfiber_suffix, xauto_access));
129 require(schema_type::standard_host_is_available<sec_e3>(xns, xbase_path, xrep_path, xfiber_suffix, xauto_access));
133 poset_path lstd_path = standard_host_path<sec_e3>(xbase_path, xrep_path, xsection_suffix, xfiber_suffix);
149 poset_path lrep_path = (!xrep_path.empty() ? xrep_path : standard_rep_path());
154 schema_type::standard_member<sec_e3>(xns, xbase_path, lrep_path, xfiber_suffix, xauto_access);
159 scalar_type::standard_host(xns, xbase_path, lrep_path, xsection_suffix, xfiber_suffix, xauto_access).
path(xauto_access);
163 lresult_ptr = &new_host(xns, lstd_path, lstd_schema_path, lscalar_space_path, xauto_access);
170 ensure(xns.
owns(result, xauto_access));
171 ensure(result.
path(
true) == standard_host_path<sec_e3>(xbase_path, xrep_path, xsection_suffix, xfiber_suffix));
173 ensure(result.
schema(
true).
path(xauto_access) ==
174 schema_type::standard_member_path<sec_e3>(xbase_path, xrep_path, xfiber_suffix));
178 ensure(result.
d(
true) == result.
dd(
true));
180 scalar_type::standard_host_path<scalar_type>(xbase_path, result.
rep().
path(xauto_access), xsection_suffix, xfiber_suffix));
182 ensure(result.
p(
true) == 1);
226 attach_to_state(xhost, xhub_id);
232 ensure(index() == xhub_id);
233 ensure(is_attached());
234 ensure(!is_restricted());
248 attach_to_state(xhost, xid.
hub_pod());
254 ensure(index() ==~ xid);
255 ensure(is_attached());
256 ensure(!is_restricted());
266 require(!xname.empty());
271 attach_to_state(xhost, xname);
277 ensure(name() == xname);
278 ensure(is_attached());
279 ensure(!is_restricted());
290 require(precondition_of(attach_to_state(same args)));
294 attach_to_state(xnamespace, xpath, xauto_access);
298 ensure(postcondition_of(attach_to_state(same args)));
310 require(xother != 0);
314 attach_to_state(xother);
319 ensure(is_attached());
320 ensure(is_same_state(xother));
321 ensure(is_same_restriction(xother));
330 require(precondition_of(new_jim_state(xhost, xdof_map,
false, xauto_access)));
334 new_jim_state(xhost, xdof_map,
false, xauto_access);
338 ensure(postcondition_of(new_jim_state(xhost, xdof_map,
false, xauto_access)));
348 int xbase_version,
bool xauto_access)
352 require(precondition_of(new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access)));
356 new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access);
360 ensure(postcondition_of(new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access)));
372 require(precondition_of(new_jim_state(xhost, xbase_parts, xauto_access)));
376 new_jrm_state(xhost, xbase_parts, xauto_access);
380 require(postcondition_of(new_jim_state(xhost, xbase_parts, xauto_access)));
393 require(is_ancestor_of(&xother));
394 require(precondition_of(attach_to_state(&xother)));
398 attach_to_state(&xother);
402 ensure(postcondition_of(attach_to_state(&xother)));
415 require(precondition_of(attach_to_state(&xother)));
419 attach_to_state(&xother);
423 ensure(postcondition_of(attach_to_state(&xother)));
436 require(precondition_of(sec_vd::operator=(xfiber)));
440 sec_vd::operator=(xfiber);
444 ensure(postcondition_of(sec_vd::operator=(xfiber)));
457 require(precondition_of(sec_vd::operator=(xfiber)));
461 sec_vd::operator=(xfiber);
465 ensure(postcondition_of(sec_vd::operator=(xfiber)));
585 const string& result = static_class_name();
589 ensure(!result.empty());
604 static const string result(
"sec_e3");
608 ensure(!result.empty());
655 require(xother != 0);
662 bool result =
dynamic_cast<const e3*
>(xother) != 0;
681 require(xother != 0);
688 bool result =
dynamic_cast<const sec_e3*
>(xother) != 0;
710 invariance(sec_ed::invariant());
712 if (invariant_check())
716 disable_invariant_check();
718 invariance(is_attached() ? df() == 3 :
true);
722 enable_invariant_check();
727 ensure(is_derived_query);
751 xos <<
"sec_e3 " << xv. name() <<
" dofs:" << endl;
780 cross(x0, x1, xresult);
801 binary_op(x0, x1, xresult, cross_functor(), xauto_access);
811 ensure(unexecutable(
"xresult == x0 cross x1"));
825 require(precondition_of(sec_cross(xresult, xother, xresult, xauto_access)));
829 cross(xresult, xother, xresult, xauto_access);
833 ensure(postcondition_of(sec_cross(xresult, xother, xresult, 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 ...
A client handle for a subposet.
SHEAF_DLL_SPEC void cross_equal(sec_e3 &xresult, const sec_e3 &xother, bool xauto_access)
The 3D Euclidean vector "cross" product of xresult with xother; synonym for cross(xresult, xother, xresult, xauto_access).
void put_is_p_vector(bool xauto_access)
Sets is_p_vector to true.
bool full() const
True if both poset name and member name are not empty.
A Cartesian product section space.
const index_space_handle & row_dof_id_space() const
The row dof id space for the schema defined by this.
Euclidean vector space of dimension 3 (volatile version).
The abstract map from section dof ids to section dof values of heterogeneous type.
An abstract iterator over the ids of an 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...
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.
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...
primitive_value dof(pod_index_type xdof_id) const
The dof referred to by xdof_id.
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 fiber_type & fiber_prototype() const
Virtual constructor for the associated fiber type.
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 void next()=0
Makes id() the next id in the iteration.
The poset for sec_rep_descriptors.
Euclidean vector space of dimension 3 (persistent version).
virtual sec_e3 * clone() const
Make a new handle, no state instance of current.
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).
virtual section_space_schema_member & schema()
The schema for this poset (mutable version)
bool is_done() const
True if iteration is finished.
Namespace containing the 3D Euclidean vector algebra functions for the fiber_bundles component of the...
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)
virtual void release_iterator(index_space_iterator &xitr) const =0
Returns the id space iterator xitr to the iterator pool.
An index within the external ("client") scope of a given id 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. ...
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...
static const std::string & static_class_name()
The name of this class.
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.
virtual pod_type index() const =0
Index of this space.
virtual index_space_iterator & get_iterator() const =0
Allocates an id space iterator from the iterator pool.
virtual sec_e3 & operator=(const abstract_poset_member &xother)
Assignment operator; synonym for attach_to_state(&xother).
void SHEAF_DLL_SPEC cross(const e3 &x0, const e3 &x1, e3 &xresult, bool xauto_access)
The 3D Euclidean vector "cross" product of x0 with x1 (pre-allocated version).
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
virtual section_space_schema_member & schema()
The restricted schema for this (mutable version).
int_type pod_index_type
The plain old data index type.
bool fiber_is_ancestor_of(const any *xother) const
True if xother conforms to an instance of the fiber of current.
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).
sec_vd_dof_type dof_type
The type of degree of freedom.
virtual const std::string & class_name() const
The name of this class.
Namespace containing the algrebra functions for a a section of a fiber bundle with a d-dimensional ve...
void put_is_p_form(bool xauto_access)
Sets is_p_form to true.
sec_e3()
Creates a new sec_e3 handle not attached to any state.
An abstract client handle for a member of a poset.
std::string path() const
The full path as a string.
Namespace for the fiber_bundles component of the sheaf system.
bool invariant() const
class invariant
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...
SHEAF_DLL_SPEC void cross(const sec_e3 &x0, const sec_e3 &x1, sec_e3 &xresult, bool xauto_access)
The 3D Euclidean vector "cross" product of x0 with x1 (pre-allocated version).
virtual section_dof_map & dof_map(bool xrequire_write_access=false)
The map from client_ids to dof values for this poset member (mutable version)
bool is_ancestor_of(const any *other) const
true if other conforms to current
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const binary_index &xbi)
Insert binary_index& xbi into ostream& os.
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...