22 #include "SheafSystem/section_dof_map.h" 24 #include "SheafSystem/assert_contract.h" 25 #include "SheafSystem/binary_section_space_schema_member.h" 26 #include "SheafSystem/poset_type.h" 42 const string& result = static_class_name();
46 ensure(!result.empty());
62 static const string result(
"section_dof_map");
66 ensure(!result.empty());
67 ensure(result ==
"section_dof_map");
89 poset_dof_map::operator=(xother);
128 result = result && poset_dof_map::invariant();
130 if(invariant_check())
134 disable_invariant_check();
139 (_host != 0 ?
dynamic_cast<sec_rep_space*
>(_host) != 0 :
true);
147 enable_invariant_check();
177 ensure((result == 0) == (poset_dof_map::host() == 0));
191 require(is_initialized());
212 require(is_initialized());
281 require(schema().state_is_read_accessible());
282 require(schema().discretization_id_space().contains(xdisc_id));
283 require(schema().fiber_schema_id_space(
false).contains(xfiber_dof_id));
284 require(unexecutable(
"xdof points to buffer of size xdof_size"));
285 require(xdof_size >= schema().size(xdisc_id, xfiber_dof_id,
false));
310 require(schema().state_is_read_accessible());
311 require(schema().discretization_id_space().contains(xdisc_id));
312 require(schema().fiber_schema_id_space(
false).contains(xfiber_dof_id));
313 require(unexecutable(
"dof_in_bounds(xdisc_id, xfiber_dof_id, false)"));
314 require(unexecutable(
"xdof points to buffer of size xdof_size"));
315 require(xdof_size >= schema().size(xdisc_id, xfiber_dof_id,
false,
false));
321 schema().discretization_id_space().pod(xdisc_id);
323 schema().fiber_schema_id_space(
false).pod(xfiber_dof_id);
325 get_dof(ldisc_id, lfiber_dof_id, xdof, xdof_size);
341 require(schema().state_is_read_accessible());
342 require(schema().discretization_id_space().contains(xdisc_id));
343 require(schema().fiber_schema_id_space(
false).contains(xfiber_dof_id));
344 require(dof_in_bounds(xdisc_id, xfiber_dof_id,
false));
345 require(unexecutable(
"xdof points to buffer of size xdof_size"));
346 require(xdof_size >= schema().size(xdisc_id, xfiber_dof_id,
false));
370 require(schema().state_is_read_accessible());
371 require(schema().discretization_id_space().contains(xdisc_id));
372 require(schema().fiber_schema_id_space(
false).contains(xfiber_dof_id));
373 require(unexecutable(
"dof_in_bounds(xdisc_id, xfiber_dof_id, false)"));
374 require(unexecutable(
"xdof points to buffer of size xdof_size"));
375 require(xdof_size >= schema().size(xdisc_id, xfiber_dof_id,
false,
false));
381 schema().discretization_id_space().pod(xdisc_id);
383 schema().fiber_schema_id_space(
false).pod(xfiber_dof_id);
385 put_dof(ldisc_id, lfiber_dof_id, xdof, xdof_size);
424 require(schema().state_is_read_accessible());
425 require(schema().discretization_id_space().contains(xdisc_id));
426 require(fiber_in_bounds(xdisc_id,
false));
427 require(unexecutable(
"xfiber points to buffer of size xfiber_size"));
428 require(xfiber_size >= schema().fiber_size());
449 require(schema().state_is_read_accessible());
450 require(schema().discretization_id_space().contains(xdisc_id));
451 require(unexecutable(
"fiber_in_bounds(xdisc_id, false)"));
452 require(unexecutable(
"xfiber points to buffer of size xfiber_size"));
453 require(xfiber_size >= schema().fiber_size());
457 pod_index_type ldisc_id = schema().discretization_id_space().pod(xdisc_id);
459 get_fiber(ldisc_id, xfiber, xfiber_size);
475 require(schema().state_is_read_accessible());
476 require(schema().discretization_id_space().contains(xdisc_id));
477 require(fiber_in_bounds(xdisc_id,
false));
478 require(unexecutable(
"xfiber points to buffer of size xfiber_size"));
479 require(xfiber_size >= schema().fiber_size());
500 require(schema().state_is_read_accessible());
501 require(schema().discretization_id_space().contains(xdisc_id));
502 require(unexecutable(
"fiber_in_bounds(xdisc_id, false)"));
503 require(unexecutable(
"xfiber points to buffer of size xfiber_size"));
504 require(xfiber_size >= schema().fiber_size());
508 pod_index_type ldisc_id = schema().discretization_id_space().pod(xdisc_id);
510 put_fiber(ldisc_id, xfiber, xfiber_size);
526 require(schema().state_is_read_accessible());
527 require(schema().discretization_id_space().contains(xdisc_id));
528 require(unexecutable(
"xfiber points to buffer of size xfiber_size"));
529 require(xfiber_size >= schema().fiber_size());
537 put_fiber(xdisc_id, xfiber, xfiber_size);
553 require(schema().state_is_read_accessible());
554 require(schema().discretization_id_space().contains(xdisc_id));
555 require(unexecutable(
"xfiber points to buffer of size xfiber_size"));
556 require(xfiber_size >= schema().fiber_size());
560 pod_index_type ldisc_id = schema().discretization_id_space().pod(xdisc_id);
562 force_fiber(ldisc_id, xfiber, xfiber_size);
578 require(schema().state_is_read_accessible());
579 require(schema().fiber_schema_id_space(
false).contains(xfiber_dof_id));
580 require(unexecutable(
"xcomponent points to buffer of size xcomponent_size"));
581 require(xcomponent_size >= schema().component_size(xfiber_dof_id));
602 require(schema().state_is_read_accessible());
603 require(schema().fiber_schema_id_space(
false).contains(xfiber_dof_id));
604 require(unexecutable(
"xcomponent points to buffer of size xcomponent_size"));
605 require(xcomponent_size >= schema().component_size(xfiber_dof_id,
false));
610 schema().fiber_schema_id_space(
false).pod(xfiber_dof_id);
612 get_component(lfiber_id, xcomponent, xcomponent_size);
628 require(schema().state_is_read_accessible());
629 require(schema().fiber_schema_id_space(
false).contains(xfiber_dof_id));
630 require(unexecutable(
"xcomponent points to buffer of size xcomponent_size"));
631 require(xcomponent_size >= schema().component_size(xfiber_dof_id));
652 require(schema().state_is_read_accessible());
653 require(schema().fiber_schema_id_space(
false).contains(xfiber_dof_id));
654 require(unexecutable(
"xcomponent points to buffer of size xcomponent_size"));
655 require(xcomponent_size >= schema().component_size(xfiber_dof_id,
false));
660 schema().fiber_schema_id_space(
false).pod(xfiber_dof_id);
662 put_component(lfiber_id, xcomponent, xcomponent_size);
737 require(xhost->
base().
geqv(xbase_id));
756 if(lschema->
name(
true).empty())
782 ensure(
host() == xhost);
784 ensure(
schema().base_space_id() == xbase_id);
virtual void put_fiber(pod_index_type xdisc_id, const void *xfiber, size_type xfiber_size)=0
Sets the fiber referred to by discretization id xdisc_id to xfiber.
void put_standard_name(bool xunique, bool xauto_access)
Sets the name of this member to a standard name; if xunique, make xname the only name.
bool geqv(pod_index_type xother_index) const
True if this is greater than or equivalent to the member with index xother_index. ...
int unaliased_version(int xversion) const
The actual version associated with (possibly aliased) version xversion in this.
section_space_schema_poset * host() const
The poset which this is a handle to a component of.
The abstract map from section dof ids to section dof values of heterogeneous type.
virtual void get_dof(pod_index_type xdisc_id, pod_index_type xfiber_dof_id, void *xdof, size_type xdof_size) const =0
Copies the dof referred to by xdisc_id, xfiber_dof_id into xdof.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
int version() const
The version of the host of the schema this is defined on.
unsigned int _ref_ct
The number of references to this map /.
virtual section_space_schema_member & schema()
The schema on which this is allocated (mutable version).
static int dof_ct(const namespace_poset &xns, const poset_path &xpath, bool xis_table_dof, bool xauto_access=true)
The number of table dofs (xis_table_dof true) or row dofs defined by the schema specified by xns and ...
bool _is_table_dof_map
True if this is a table dof map.
bool is_initialized() const
True if this has been initialized, that is, if the schema has been set and the dof map storage alloca...
void invalidate()
Make this id invalid.
The general, abstract map from dof ids to dof values.
virtual bool fiber_in_bounds(pod_index_type xdisc_id, bool xis_table_dofs) const
True if and only if the fiber asociated with discretization id xdisc_id is within the current capacit...
abstract_poset_member & base()
The base space for this section space (mutable version)
bool has_version(int xversion) const
True if xversion is a valid version.
section_dof_map()
Default constructor.
virtual const std::string & class_name() const
The name of the actual (possibly derived) class of this instance.
size_t _dof_tuple_ub
The size of the dof tuple.
virtual bool supports_xfr_opt() const
True if this dof map type supports dof tuple transfer optimization. /.
virtual ~section_dof_map()
Destructor.
pod_index_type fiber_schema_id() const
The member id of the fiber schema component of this.
virtual section_space_schema_member & schema()
The schema for this poset (mutable version)
static const std::string & static_class_name()
The name of this class.
virtual bool invariant() const
The class invariant.
size_t dof_tuple_ub() const
The size of the dof tuple in bytes.
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.
std::string name(pod_index_type xdof_id, bool xis_table_dof) const
The name of the table dof (xis_table_dof true) or row dof referred to by xdof_id in the schema define...
scoped_index _index
The poset member for which this stores the dofs.
int _dof_ct
The number of dofs in this map.
section_dof_map & operator=(const section_dof_map &xother)
Assignment operator.
virtual void put_version(int xversion, bool xunalias=false)
Sets version to (possibly aliased) xversion. If unalias == true, set version to the actual version al...
int dof_ct() const
The number of dofs in this map.
size_t dof_tuple_ub(bool xis_table_dof) const
The size in bytes of the table dof tuple (xis_table_dof true) or the row dof tuple defined by this sc...
schema_poset_member * _schema
The schema on which this is instantiated.
int_type pod_index_type
The plain old data index type.
virtual bool dof_in_bounds(pod_index_type xdof_id, bool xis_table_dofs) const
True if and only if the dof asociated with id xdof_id is within the current capacity of the dofs stor...
virtual void put_component(pod_index_type xfiber_dof_id, const void *xcomponent, size_type xcomponent_size)=0
Sets the component referred to by fiber id xfiber_dof_id to xcomponent.
virtual void put_dof(pod_index_type xdisc_id, pod_index_type xfiber_dof_id, const void *xdof, size_type xdof_size)=0
Sets the dof referred to by xdof_id to the value at xdof.
A client handle for a poset member which has been prepared for use as a schema for a section space...
virtual void force_fiber(pod_index_type xdisc_id, const void *xfiber, size_type xfiber_size)
Sets the fiber referred to by discretization id xdisc_id to xfiber; allocates additional memory if ne...
poset_state_handle * _host
The host of the poset member for which this stores the dofs.
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
Namespace for the fiber_bundles component of the sheaf system.
virtual void attach_to_state(pod_index_type xbase_space_id, pod_index_type xfiber_schema_id)=0
Attach to the state in host() with component ids xbase_id and xfiber_schema_id.
virtual void get_fiber(pod_index_type xdisc_id, void *xfiber, size_type xfiber_size) const
Sets xfiber to the fiber referred to by discretization id xdisc_id.
unsigned int ref_ct() const
The number of references to this map.
virtual sec_rep_space * host() const
The poset which hosts member()
const scoped_index & index() const
The index of this in host() dof tuple table.
section_space_schema_member * clone(bool xnew_state, bool xauto_access=true) const
Make a new handle instance of current. Attach the new instance to a new state if xnew_state is true...
virtual void get_component(pod_index_type xfiber_dof_id, void *xcomponent, size_type xcomponent_size) const =0
Sets xcomponent to the component referred to by fiber id xfiber_dof_id.
A handle for a poset whose members are numerical representations of sections of a fiber bundle...