21 #include "SheafSystem/sec_vd_space.h" 23 #include "SheafSystem/abstract_poset_member.impl.h" 24 #include "SheafSystem/assert_contract.h" 25 #include "SheafSystem/binary_section_space_schema_member.impl.h" 26 #include "SheafSystem/binary_section_space_schema_poset.h" 27 #include "SheafSystem/fiber_bundles_namespace.h" 28 #include "SheafSystem/namespace_poset.impl.h" 29 #include "SheafSystem/namespace_poset_member.h" 30 #include "SheafSystem/poset_handle_factory.h" 31 #include "SheafSystem/sec_at0.h" 32 #include "SheafSystem/sec_at0_space.h" 33 #include "SheafSystem/sec_at1.h" 34 #include "SheafSystem/sec_at1_space.h" 35 #include "SheafSystem/sec_tuple_space.impl.h" 36 #include "SheafSystem/sec_vd.h" 37 #include "SheafSystem/section_space_schema_member.impl.h" 38 #include "SheafSystem/section_space_schema_poset.h" 39 #include "SheafSystem/vd.h" 40 #include "SheafSystem/vd_space.h" 77 result = lfiber_space->scalar_space_path(xauto_access) == lscalar_host.
schema().
fiber_space().
path(xauto_access);
104 require(!xpath.
empty());
107 require(xschema_path.
full());
109 require(fiber_space_conforms<fiber_type::host_type>(xns, xschema_path, xauto_access));
113 require(same_scalar_fiber_space(xns, xschema_path, xscalar_space_path, xauto_access));
121 table_type& result = *(
new table_type());
125 schema_type lschema(xns, xschema_path, xauto_access);
145 lmap.
put_dof(
"scalar_space_path", xscalar_space_path);
149 result.new_state(xns, xpath, lschema, lmap);
158 ensure(xns.
owns(result, xauto_access));
159 ensure(result.path(
true) == xpath);
160 ensure(result.state_is_not_read_accessible());
161 ensure(result.schema(
true).path(xauto_access) == xschema_path);
163 ensure(result.factor_ct(
true) == result.schema(
true).fiber_space<
fiber_type::host_type>().factor_ct(xauto_access));
165 ensure(result.scalar_space_path(
true) == xscalar_space_path);
190 require(state_is_read_accessible());
205 d(
bool xauto_access)
const 209 require(state_is_auto_read_accessible(xauto_access));
239 require(!xvector_space_path.
empty());
246 int result = lvector_space.
d(xauto_access);
263 require(state_is_read_accessible());
271 ensure(!result.
empty());
284 require(state_is_auto_read_accessible(xauto_access));
302 ensure(!result.
empty());
317 require(!xvector_space_path.
empty());
324 poset_path result = lvector_space.scalar_space_path(xauto_access);
328 ensure(!result.
empty());
341 require(state_is_auto_read_accessible(xauto_access));
350 int lp = covariant_subposet_ct();
353 for(
int i=0; i<lp && result; ++i)
355 result = includes_subposet(covariant_subposet_name(i),
false);
376 require(state_is_auto_read_accessible(xauto_access));
418 subposet lsp(
this, covariant_subposet_name(0));
441 require(state_is_auto_read_accessible(xauto_access));
445 return is_vector(xmbr_id.
hub_pod(), xauto_access);
454 require(state_is_auto_read_write_accessible(xauto_access));
460 get_read_write_access();
463 subposet lsp(
this, covariant_subposet_name(0));
474 ensure(is_vector(xmbr_id, xauto_access));
487 require(state_is_auto_read_write_accessible(xauto_access));
491 put_is_vector(xmbr_id.
hub_pod(), xauto_access);
495 ensure(is_vector(xmbr_id, xauto_access));
508 require(state_is_auto_read_accessible(xauto_access));
550 subposet lsp(
this, covariant_subposet_name(0));
573 require(state_is_auto_read_accessible(xauto_access));
577 return is_covector(xmbr_id.
hub_pod(), xauto_access);
586 require(state_is_auto_read_write_accessible(xauto_access));
592 get_read_write_access();
595 subposet lsp(
this, covariant_subposet_name(0));
606 ensure(is_covector(xmbr_id, xauto_access));
619 require(state_is_auto_read_write_accessible(xauto_access));
623 put_is_covector(xmbr_id.
hub_pod(), xauto_access);
627 ensure(is_covector(xmbr_id, xauto_access));
644 string result(poset_path::make_reserved_name(
"covariant", xi,
""));
648 ensure(!result.empty());
691 require(xbottom != 0);
718 for(
int i=0; i<lp; ++i)
724 lcovariant.
put_name(lname,
true,
false);
782 fiber_bundle::sec_vd_space::
815 return SEC_VD_SPACE_ID;
829 static const char* result =
"sec_vd_space";
949 result =
dynamic_cast<const sec_vd_space*
>(xother) != 0;
1015 const std::string& xheading,
1016 const std::string& xindent,
1038 xos << xindent << xheading << endl;
1040 string lindent = xindent +
" ";
1042 xos << lindent <<
"path: " << xspace.
path() << endl;
1043 xos << lindent <<
"schema path: " << xspace.
schema().
path() << endl;
1044 xos << lindent <<
"rep path: " << xspace.
schema().
rep().
path() << endl;
1050 if(lscalar_section_space == 0)
1055 print_prereq_paths(xos, lscalar_space,
"scalar section space", lindent, xauto_access);
1057 if((lvector_section_space == 0) && (ltensor_section_space != 0))
1061 lvector_section_space =
1063 print_prereq_paths(xos, *lvector_section_space,
"vector section space", lindent, xauto_access);
virtual void put_is_vector(pod_index_type xmbr_id, bool xauto_access)
Sets is_vector true for the member with id xmbr_id.
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.
void insert_prototype(const poset_state_handle *xprototype)
Sets xprototype as the prototype for its client class.
section_space_schema_poset * host() const
The poset which this is a handle to a component of.
A client handle for a poset member which has been prepared for use as a schema for a section space...
bool full() const
True if both poset name and member name are not empty.
A Cartesian product section space.
const pod_type & pod() const
The "plain old data" storage of this; the value in the external id space.
virtual pod_index_type prereq_id(int xi) const
The id of the xi-th prerequisite poset for this.
const scoped_index & index() const
The member index of this poset within the namespace host()
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.
static sec_vd_space & new_table(namespace_type &xhost, const poset_path &xpath, const poset_path &xschema_path, const poset_path &xscalar_space_path, bool xauto_access)
Creates a new sec_vd_space in namespace xns with path xpath, schema specified by xschema_path, and scalar space specified by xscalar_space_path.
The default name space; a poset which contains other posets as members.
virtual bool is_ancestor_of(const any *xother) const
True if other conforms to this.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
virtual size_type subposet_ct() const
The number of subposets of this poset.
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...
poset_type
Identifiers for poset types.
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...
virtual bool includes_subposet(pod_index_type xsubposet_hub_id, bool xauto_access=true) const
True if this poset includes subposet with hub id xsubposet_hub_id.
virtual void put_is_covector(pod_index_type xmbr_id, bool xauto_access)
Sets is_covector true for the member with id xmbr_id.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
virtual void initialize_standard_subposets(const std::string &xname)
Creates the subposets common to every poset (e.g. whole() and jims()).
virtual bool invariant() const
Class invariant.
virtual bool contains_member(pod_index_type xmbr_hub_id) const
True if this poset contains poset member with hub id xmbr_hub_id.
A schema poset for a section space. A binary Cartesian product subspace of the binary tensor product ...
An abstract vector section space of dimension d.
A Cartesian product space.
void create_variance_subposets()
Create covariant subposets.
virtual void get_read_access() const
Get read access to the state associated with this.
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.
sec_tuple_space()
Default constructor; creates a new sec_tuple_space handle not attached to any state.
void copy_dof_tuple(const poset_dof_map &xother)
Copies the dof tuple of xother into this.
static std::string covariant_subposet_name(int xi)
The name of the covariant subposet for the xi-th index.
void put_standard_subposet_ct(int xct)
Sets the number of standard subposets automatically allocated by the constructor. ...
virtual sec_vd_space * clone() const
Virtual constructor; creates a new handle of the same actual type as this, attached to the same state...
bool contains_variance_subposets(bool xauto_access) const
True if the variance subposets exist.
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
virtual void initialize_standard_subposets(const std::string &xname)
Creates the standard subposets.
Abstract base class with useful features for all objects.
A space of scalars viewed as an antisymmetric tensor section space of degree 0.
poset & fiber_space()
The fiber space for section spaces on this schema.
virtual section_space_schema_member & schema()
The schema for this poset (mutable version)
virtual void put_name(const std::string &xname, bool xunique, bool xauto_access)
Make xname a name for this; if xunique, make xname the only name.
virtual const char * class_name() const
The name of this class.
virtual bool is_vector(pod_index_type xmbr_id, bool xauto_access) const
True if and only if the member with id xmbr_id is a vector (as opposed to a covector).
virtual size_type covariant_subposet_ct() const
The number of covariant subposets.
An abstract tensor section space of degree p.
bool state_is_read_write_accessible() const
True if this is attached and if the state is accessible for read and write or access control is disab...
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.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
virtual void insert_member(pod_index_type xmbr_hub_id)
Inserts the member of host() with hub id xmbr_hub_id.
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
bool empty() const
True if both poset name and member name are empty.
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
poset_state_handle()
Default constructor.
static bool same_scalar_fiber_space(const namespace_poset &xns, const poset_path &xschema_path, const poset_path &xscalar_space_path, bool xauto_access)
True if and only if scalar space of fiber space == fiber space of scalar space. More precisely...
bool contains_poset(pod_index_type xhub_id, bool xauto_access=true) const
True if this contains a poset with hub id xhub_id..
A section of a fiber bundle with a d-dimensional vector space fiber.
sec_vd_space()
Default constructor; creates a new sec_vd_space handle not attached to any state. ...
static poset_handle_factory & factory()
The poset handle factory.
virtual void detach_from_state()
Detach this handle from its state, if any.
namespace_poset * name_space() const
The namespace this poset resides in.
virtual bool is_attached() const
True if this is attached to a state.
int factor_ct() const
The number of factors in this product.
An abstract vector space of dimension d.
An abstract schema poset for a section space. A Cartesian product subspace of the tensor product of a...
virtual void put_dof(pod_index_type xdof_id, const void *xdof, size_type xdof_size)
Sets the dof referred to by xdof_id to the value at xdof.
bool invariant_check() const
True if invariant checking is enabled.
total_poset_member & base_space()
The base space component of this (mutable version).
virtual void remove_member(pod_index_type xmbr_hub_id)
Removes the member of host() with hub id xmbr_hub_id.
T::table_dofs_type & table_dofs(T &x0)
The table dofs pod type for x0 (mutable 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.
virtual ~sec_vd_space()
Destructor.
poset & fiber_space()
The fiber space for section spaces on this schema (mutable version).
static bool is_valid_name(const std::string &xname)
True if xname is not empty and contains only name legal characters.
int d() const
The dimension.
virtual void get_read_access() const
Get read access to the state associated with this.
virtual poset_type type_id() const
Identifier for the type of this poset.
virtual bool is_covector(pod_index_type xmbr_id, bool xauto_access) const
True if and only if the member with id xmbr_id is a covector.
virtual bool invariant() const
Class invariant.
sec_rep_descriptor & rep()
The representation for section spaces on this schema (mutable version).
SHEAF_DLL_SPEC void print_prereq_paths(std::ostream &xos, const vd_space &xspace, const std::string &xheading, const std::string &xindent, bool xauto_access=true)
Print the paths for xspace and its prerequisites: schema, scalar space, etc.
An array representation of abstract class poset_dof_map.
Namespace for the fiber_bundles component of the sheaf system.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
bool is_same_type(const any *other) const
True if other is the same type as this.
void enable_invariant_check() const
Enable invariant checking.
virtual array_poset_dof_map & table_dof_map(bool xrequire_write_access=false)
The map from table dof client_ids to table dof values for this poset (mutable version) ...
virtual const scoped_index & member_id(bool xauto_access) const
An id in the member hub id space; intended for copying to initialize ids to the member id space...
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.