21 #include "SheafSystem/sec_jcb.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/section_space_schema_member.impl.h" 28 #include "SheafSystem/section_space_schema_poset.h" 29 #include "SheafSystem/sec_at0.h" 30 #include "SheafSystem/sec_at1.h" 31 #include "SheafSystem/sec_at1_space.h" 32 #include "SheafSystem/sec_jcb_space.h" 33 #include "SheafSystem/sec_tuple_space.impl.h" 34 #include "SheafSystem/jcb.h" 35 #include "SheafSystem/jcb_space.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));
75 require(host_type::same_vector_fiber_space(xns, xschema_path, xdomain_path, xrange_path, xauto_access));
79 host_type& result = host_type::new_table(xns, xhost_path, xschema_path, xdomain_path, xrange_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);
97 ensure(result.
range_path(
true) == xrange_path);
140 attach_to_state(xhost, xhub_id);
146 ensure(index() == xhub_id);
147 ensure(is_attached());
148 ensure(!is_restricted());
162 attach_to_state(xhost, xid.
hub_pod());
168 ensure(index() ==~ xid);
169 ensure(is_attached());
170 ensure(!is_restricted());
181 require(!xname.empty());
186 attach_to_state(xhost, xname);
192 ensure(name() == xname);
193 ensure(is_attached());
194 ensure(!is_restricted());
207 require(precondition_of(attach_to_state(same args)));
211 attach_to_state(xnamespace, xpath, xauto_access);
215 ensure(postcondition_of(attach_to_state(same args)));
229 require(xother != 0);
233 attach_to_state(xother);
238 ensure(is_attached());
239 ensure(is_same_state(xother));
240 ensure(is_same_restriction(xother));
250 require(precondition_of(new_jim_state(xhost, xdof_map,
false, xauto_access)));
254 new_jim_state(xhost, xdof_map,
false, xauto_access);
258 ensure(postcondition_of(new_jim_state(xhost, xdof_map,
false, xauto_access)));
271 require(is_ancestor_of(&xother));
272 require(precondition_of(attach_to_state(&xother)));
276 attach_to_state(&xother);
280 ensure(postcondition_of(attach_to_state(&xother)));
293 require(precondition_of(attach_to_state(&xother)));
297 attach_to_state(&xother);
301 ensure(postcondition_of(attach_to_state(&xother)));
314 require(precondition_of(sec_vd::operator=(xfiber)));
318 sec_vd::operator=(xfiber);
322 ensure(postcondition_of(sec_vd::operator=(xfiber)));
335 require(precondition_of(sec_vd::operator=(xfiber)));
339 sec_vd::operator=(xfiber);
343 ensure(postcondition_of(sec_vd::operator=(xfiber)));
386 require(state_is_read_accessible());
390 int result = host()->dd();
403 dd(
bool xauto_access)
const 407 require(state_is_auto_read_accessible(xauto_access));
411 int result = host()->dd(xauto_access);
428 require(state_is_read_accessible());
436 ensure(!result.
empty());
449 require(state_is_auto_read_accessible(xauto_access));
453 poset_path result(host()->domain_path(xauto_access));
457 ensure(!result.
empty());
470 require(state_is_read_accessible());
474 int result = host()->dr();
487 dr(
bool xauto_access)
const 491 require(state_is_auto_read_accessible(xauto_access));
495 int result = host()->dr(xauto_access);
512 require(state_is_read_accessible());
520 ensure(!result.
empty());
533 require(state_is_auto_read_accessible(xauto_access));
537 poset_path result(host()->range_path(xauto_access));
541 ensure(!result.
empty());
589 const string& result = static_class_name();
593 ensure(!result.empty());
608 static const string result(
"sec_jcb");
612 ensure(!result.empty());
658 return reinterpret_cast<host_type*
>(_host);
665 return dynamic_cast<const host_type*
>(xother) != 0;
686 require(xother != 0);
693 bool result =
dynamic_cast<const jcb*
>(xother) != 0;
712 require(xother != 0);
719 bool result =
dynamic_cast<const sec_jcb*
>(xother) != 0;
743 invariance(sec_vd::invariant());
745 if(invariant_check())
749 disable_invariant_check();
751 invariance(is_attached() ? df() == dd()*dr() :
true);
752 invariance(is_attached() ? dr() == db() :
true);
756 enable_invariant_check();
761 ensure(is_derived_query);
786 require(0 <= row && row <= dd());
787 require(0 <= col && col <= dr());
794 sec_at0 *result = comp(row * dr() + col);
815 require(0 <= row && row <= dd());
816 require(0 <= col && col <= dr());
817 require(new_comp != 0);
824 set_comp(row * dr() + col, new_comp);
836 #include "SheafSystem/error_message.h" 837 #include "SheafSystem/sec_at1.h" 838 #include "SheafSystem/sec_e1.h" 839 #include "SheafSystem/sec_e2.h" 840 #include "SheafSystem/sec_e3.h" 841 #include "SheafSystem/sec_jcb_e13.h" 842 #include "SheafSystem/sec_jcb_e23.h" 843 #include "SheafSystem/sec_jcb_e33.h" 866 const sec_e1* e1_xvector =
dynamic_cast<const sec_e1*
>(&xvector);
867 const sec_e2* e2_xvector =
dynamic_cast<const sec_e2*
>(&xvector);
868 const sec_e3* e3_xvector =
dynamic_cast<const sec_e3*
>(&xvector);
872 if(jcb_e13_xjcb && e1_xvector && e3_xresult)
874 push(*jcb_e13_xjcb, *e1_xvector, *e3_xresult, xauto_access);
876 else if(jcb_e23_xjcb && e2_xvector && e3_xresult)
878 push(*jcb_e23_xjcb, *e2_xvector, *e3_xresult, xauto_access);
880 else if(jcb_e33_xjcb && e3_xvector && e3_xresult)
882 push(*jcb_e33_xjcb, *e3_xvector, *e3_xresult, xauto_access);
886 post_fatal_error_message(\
887 "Unsupported argument types in call to push(...)");
920 const sec_e3* e3_xcovector =
dynamic_cast<const sec_e3*
>(&xcovector);
926 if(jcb_e13_xjcb && e3_xcovector && e1_xresult)
928 pull(*jcb_e13_xjcb, *e3_xcovector, *e1_xresult, xauto_access);
930 else if(jcb_e23_xjcb && e3_xcovector && e2_xresult)
932 pull(*jcb_e23_xjcb, *e3_xcovector, *e2_xresult, xauto_access);
934 else if(jcb_e33_xjcb && e3_xcovector && e3_xresult)
936 pull(*jcb_e33_xjcb, *e3_xcovector, *e3_xresult, xauto_access);
940 post_fatal_error_message(\
941 "Unsupported argument types in call to pull(...)");
static int d(int xdd, int xdr)
Dimension d() as a function of domain dimension xdd and range dimension xdr.
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 ...
sec_at0 * comp2(int row, int col) const
Component indexed by row and col.
static const std::string & static_class_name()
The name of this class.
bool full() const
True if both poset name and member name are not empty.
poset_path range_path() const
The path of the range vector space.
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 domain_path() const
The path of the domain vector space.
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...
virtual int dd() const
Dimension of the domain.
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.
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.
virtual sec_jcb & operator=(const abstract_poset_member &xother)
Assignment operator; synonym for attach_to_state(&xother).
A schema poset for a section space. A binary Cartesian product subspace of the binary tensor product ...
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, const poset_path &xdomain_space_path, const poset_path &xrange_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...
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.
A section of a bundle with fiber type at1.
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
virtual const fiber_type & fiber_prototype() const
Virtual constructor for the associated fiber type.
poset_path domain_path() const
The path of the domain vector space.
Abstract base class with useful features for all objects.
A section of a bundle with fiber type jcb_e13.
virtual section_space_schema_member & schema()
The schema for this poset (mutable version)
virtual int dr() const
Dimension of the range.
virtual bool is_contravariant(bool xauto_access) const
True if and only if all tensor index positions are contravariant.
int dd() const
The dimension of the underlying ("domain") vector space.
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)
SHEAF_DLL_SPEC void push(const sec_jcb &xjcb, const sec_at1 &xvector, sec_at1 &xresult, bool xauto_access)
Push vector forward (pre-allocated version).
Abstract jacobian class (volatile version).
An index within the external ("client") scope of a given id space.
A section of a bundle with fiber type jcb_e33.
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. ...
poset_path range_path() const
The path of the range 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.
SHEAF_DLL_SPEC void pull(const jcb &xjcb, const at1 &xcovector, at1 &xresult, bool xauto_access)
Pull covector back (pre-allocated version for persistent types).
void set_comp2(int row, int col, sec_at0 *new_comp)
Sets component by row and col.
A section of a bundle with fiber type jcb.
virtual bool host_is_ancestor_of(const poset_state_handle *other) const
True if other conforms to host.
SHEAF_DLL_SPEC void pull(const sec_jcb &xjcb, const sec_at1 &xcovector, sec_at1 &xresult, bool xauto_access)
Pull covector back (pre-allocated version).
sec_jcb()
Default constructor.
An abstract space of Jacobians.
bool invariant() const
Class invariant.
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 const std::string & class_name() const
The name of this class.
An abstract section space of Jacobians.
host_type * host() const
The poset this is a member of.
virtual bool is_covariant(bool xauto_access) const
True if and only if all tensor index positions are covariant.
A section of a bundle with fiber type jcb_e23.
virtual int dr() const
Dimension of the range.
An abstract client handle for a member of a poset.
virtual sec_jcb * clone() const
Make a new handle, no state instance of current.
SHEAF_DLL_SPEC void push(const jcb &xjcb, const at1 &xvector, at1 &xresult, bool xauto_access)
Push vector forward (pre-allocated version for persistent types).
bool invariant() const
Class invariant.
Namespace for the fiber_bundles component of the sheaf system.
Antisymetric tensor of degree 0. As the degree is 0 there is nothing to be symmetric or antisymmetric...
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...