20 #include "SheafSystem/atp_space.h" 22 #include "SheafSystem/abstract_poset_member.impl.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/at1_space.h" 25 #include "SheafSystem/atp.h" 26 #include "SheafSystem/fiber_bundles_namespace.h" 27 #include "SheafSystem/namespace_poset.impl.h" 28 #include "SheafSystem/namespace_poset_member.h" 29 #include "SheafSystem/poset_handle_factory.h" 51 static const string& result = atp::standard_schema_poset_name();
55 ensure(!result.empty());
72 static const poset_path& result = atp::standard_schema_path();
76 ensure(result.
full());
77 ensure(result.
poset_name() == standard_schema_poset_name());
99 int result = ltmp.
d(xp, ldd);
125 require(!xpath.
empty());
128 require(xschema_path.
full());
130 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path(), xauto_access));
136 require(d(xns, xschema_path, xauto_access) == d(xns, xp, xvector_space_path, xauto_access));
144 table_type* ltable =
new table_type();
171 lmap->
put_dof(
"factor_ct", ld);
173 lmap->
put_dof(
"scalar_space_path", lscalar_space_path);
176 lmap->
put_dof(
"vector_space_path", xvector_space_path);
180 ltable->new_state(xns, xpath, lschema, *lmap);
191 ensure(xns.
owns(result, xauto_access));
192 ensure(result.
path(
true) == xpath);
194 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
196 ensure(result.
factor_ct(
true) == result.
d(
true));
197 ensure(result.
d(
true) == d(xns, xschema_path, xauto_access));
199 ensure(result.
p(
true) == xp);
216 require(state_is_auto_read_accessible(xauto_access));
217 require(contains_member(xmbr_id, xauto_access));
218 require(contains_variance_subposets(xauto_access));
222 bool result = is_covariant(xmbr_id, xauto_access);
239 require(state_is_auto_read_accessible(xauto_access));
240 require(contains_member(xmbr_id, xauto_access));
241 require(contains_variance_subposets(xauto_access));
245 return is_p_form(xmbr_id.
hub_pod(), xauto_access);
254 require(state_is_auto_read_write_accessible(xauto_access));
255 require(contains_member(xmbr_id, xauto_access));
256 require(contains_variance_subposets(xauto_access));
260 put_is_covariant(xmbr_id, xauto_access);
264 ensure(is_p_form(xmbr_id, xauto_access));
277 require(state_is_auto_read_write_accessible(xauto_access));
278 require(contains_member(xmbr_id, xauto_access));
279 require(contains_variance_subposets(xauto_access));
283 put_is_p_form(xmbr_id.
hub_pod(), xauto_access);
287 ensure(is_p_form(xmbr_id, xauto_access));
301 require(state_is_auto_read_accessible(xauto_access));
302 require(contains_member(xmbr_id, xauto_access));
303 require(contains_variance_subposets(xauto_access));
307 bool result = is_contravariant(xmbr_id, xauto_access);
323 require(state_is_auto_read_accessible(xauto_access));
324 require(contains_member(xmbr_id, xauto_access));
325 require(contains_variance_subposets(xauto_access));
329 return is_p_vector(xmbr_id.
hub_pod(), xauto_access);
338 require(state_is_auto_read_write_accessible(xauto_access));
339 require(contains_member(xmbr_id, xauto_access));
340 require(contains_variance_subposets(xauto_access));
344 put_is_contravariant(xmbr_id, xauto_access);
348 ensure(is_p_vector(xmbr_id, xauto_access));
361 require(state_is_auto_read_write_accessible(xauto_access));
362 require(contains_member(xmbr_id, xauto_access));
363 require(contains_variance_subposets(xauto_access));
367 put_is_p_vector(xmbr_id.
hub_pod(), xauto_access);
371 ensure(is_p_vector(xmbr_id, xauto_access));
418 require(xbottom != 0);
439 d(
int xp,
int xdd)
const 484 fiber_bundle::atp_space::
532 static const char* result =
"atp_space";
555 result =
dynamic_cast<const atp_space*
>(xother) != 0;
virtual const char * class_name() const
The name of this class.
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 is_pure() const
True if and only if all indices are covariant or all indices are contravariant.
void insert_prototype(const poset_state_handle *xprototype)
Sets xprototype as the prototype for its client class.
bool full() const
True if both poset name and member name are not empty.
int p() const
The tensor degree.
The "type" of a tensor; specifies the degree and the co- or contra-variance for each index of a tenso...
An antisymmetric tensor of degree p.
static int d(const namespace_poset &xns, int xp, const poset_path &xvector_space_path, bool xauto_access)
The tensor dimension implied by tensor degree xp and the dimension of the domain vector space specifi...
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 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_path vector_space_path() const
The path of the underlying vector space.
poset_type
Identifiers for poset types.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
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.
SHEAF_DLL_SPEC unsigned int binomial_coefficient(unsigned int xi, unsigned int xj)
Binomial coefficient (xi, xj).
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...
Abstract base class with useful features for all objects.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
An abstract antisymmetric tensor space of degree p.
static atp_space & new_table(namespace_type &xhost, const poset_path &xpath, const poset_path &xschema_path, int xp, const poset_path &xvector_space_path, bool xauto_access)
Creates a new atp_space in namespace xns with path xpath, schema specified by xschema_path, and table attributes p and vector_space_path specified by xp and xvector_space_path, respectively.
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 bool invariant() const
Class invariant.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
std::string poset_name() const
The poset name part of the path.
bool is_p_form(pod_index_type xmbr_id, bool xauto_access) const
True if the member with id xmbr_id is a p-form; synonym for is_covariant(xmbr_id, xauto_access)...
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
int p(int xd, int xdd) const
Tensor degree as a function of tensor dimension xd and domain dimension xdd.
void put_is_p_form(pod_index_type xmbr_id, bool xauto_access)
Sets is_p_form for the member with id xmbr_id to true; synonym for put_is_covariant(xmbr_id, xauto_access).
static const std::string & standard_schema_poset_name()
The name of the standard schema poset for this class.
static int row_dof_ct(const namespace_poset &xns, const poset_path &xpath, bool xauto_access=true)
The number of row dofs defined by the schema specified by xns and xpath. Synonym for dof_ct(xns...
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...
atp_space()
Default constructor; creates a new atp_space handle not attached to any state.
void put_is_p_vector(pod_index_type xmbr_id, bool xauto_access)
Sets is_p_vector for the member with id xmbr_id to true. synonym for put_is_contravariant(xmbr_id, xauto_access).
poset_state_handle()
Default constructor.
poset_path scalar_space_path() const
The path of the underlying space of scalars.
virtual bool is_ancestor_of(const any *xother) const
True if other conforms to this.
static poset_handle_factory & factory()
The poset handle factory.
int d() const
The dimension.
virtual bool is_attached() const
True if this is attached to a state.
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
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.
static int factor_ct(int xd)
Factor_ct() as a function of dimension xd.
int_type pod_index_type
The plain old data index type.
virtual atp_space * clone() const
Virtual constructor; creates a new handle of the same actual type as this, attached to the same state...
virtual poset_type type_id() const
Identifier for the type of this poset.
int dd() const
The dimension of the underlying ("domain") vector space.
bool variance(int xi) const
The variance of the xi-th index; covariant if true, contravariant if false.
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
tp_space()
Default constructor; creates a new tp_space handle not attached to any state.
virtual size_type covariant_subposet_ct() const
The number of covariant subposets.
void purify()
Sets all indices the same as index 0.
virtual bool invariant() const
Class invariant.
An array representation of abstract class poset_dof_map.
An abstract tensor space of degree p.
Namespace containing the vector algrebra functions for the fiber_bundles component of the sheaf syste...
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.
void enable_invariant_check() const
Enable invariant checking.
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...
A client handle for a poset member which has been prepared for use as a schema.
virtual tensor_variance round_variance(const tensor_variance &xvariance) const
"Rounds" xvariance up or down to a supported value; either pure covariant or pure contravariant...
virtual ~atp_space()
Destructor.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
bool is_p_vector(pod_index_type xmbr_id, bool xauto_access) const
True if the member with id xmbr_id is a p-vector; synonym for is_contravariant(xmbr_id, xauto_access).