20 #include "SheafSystem/sparse_section_dof_map.h" 22 #include "SheafSystem/assert_contract.h" 23 #include "SheafSystem/dof_map_factory.h" 24 #include "SheafSystem/ij_product_structure.h" 25 #include "SheafSystem/index_space_iterator.h" 26 #include "SheafSystem/primitive_type.h" 27 #include "SheafSystem/sec_rep_space.h" 28 #include "SheafSystem/sec_vd.h" 44 const string& result = static_class_name();
48 ensure(!result.empty());
64 static const string result(
"sparse_section_dof_map");
68 ensure(!result.empty());
69 ensure(result ==
"sparse_section_dof_map");
136 _def_val = xdefault_value;
211 _val_map = xother._val_map;
213 _def_val = xother._def_val;
282 require(
schema().state_is_read_accessible());
284 require(unexecutable(
"xdof points to buffer of size xdof_size"));
291 val_map_type::const_iterator itr = _val_map.find(xdof_id);
293 if(itr != _val_map.end())
316 require(
schema().state_is_read_accessible());
318 require(unexecutable(
"xdof points to buffer of size xdof_size"));
331 _val_map[xdof_id] = ldof;
338 _val_map.erase(xdof_id);
356 require(
schema().state_is_read_accessible());
357 require(
schema().discretization_id_space().contains(xdisc_id));
358 require(
schema().fiber_schema_id_space(
false).contains(xfiber_dof_id));
359 require(unexecutable(
"xdof points to buffer of size xdof_size"));
360 require(xdof_size >=
schema().size(xdisc_id, xfiber_dof_id,
false));
366 ordinal(xdisc_id, xfiber_dof_id, ldof_id);
368 get_dof(ldof_id, xdof, xdof_size);
384 require(
schema().state_is_read_accessible());
385 require(
schema().discretization_id_space().contains(xdisc_id));
386 require(
schema().fiber_schema_id_space(
false).contains(xfiber_dof_id));
387 require(unexecutable(
"xdof points to buffer of size xdof_size"));
388 require(xdof_size >=
schema().size(xdisc_id, xfiber_dof_id,
false));
395 ordinal(xdisc_id, xfiber_dof_id, ldof_id);
397 put_dof(ldof_id, xdof, xdof_size);
414 require(
schema().state_is_read_accessible());
415 require(
schema().discretization_id_space().contains(xdisc_id));
416 require(unexecutable(
"xfiber points to buffer of size xfiber_size"));
417 require(xfiber_size >=
schema().fiber_size());
432 lproduct.
ordinal(xdisc_id, i, ldof_id);
451 require(
schema().state_is_read_accessible());
452 require(
schema().discretization_id_space().contains(xdisc_id));
453 require(unexecutable(
"xfiber points to buffer of size xfiber_size"));
454 require(xfiber_size >=
schema().fiber_size());
470 lproduct.
ordinal(xdisc_id, i, ldof_id);
488 require(
schema().state_is_read_accessible());
489 require(
schema().fiber_schema_id_space(
false).contains(xfiber_dof_id));
490 require(unexecutable(
"xcomponent points to buffer of size xcomponent_size"));
491 require(xcomponent_size >=
schema().component_size(xfiber_dof_id));
506 lproduct.
ordinal(i, xfiber_dof_id, ldof_id);
524 require(
schema().state_is_read_accessible());
525 require(
schema().fiber_schema_id_space(
false).contains(xfiber_dof_id));
526 require(unexecutable(
"xcomponent points to buffer of size xcomponent_size"));
527 require(xcomponent_size >=
schema().component_size(xfiber_dof_id));
543 lproduct.
ordinal(i, xfiber_dof_id, ldof_id);
618 double* lbuf =
reinterpret_cast<double*
>(xbuf);
619 size_t lbuf_len = xbuf_len/
sizeof(double);
634 ensure(unexecutable(
dof tuple copied to xbuf));
656 double* lbuf =
reinterpret_cast<double*
>(
const_cast<void*
>(xbuf));
657 size_t lbuf_len = xbuf_len/
sizeof(double);
671 ensure(unexecutable(xbuf copied to
dof tuple));
761 fiber_bundle::sparse_section_dof_map::
virtual bool supports_xfr_opt() const
True if this dof map type supports dof tuple transfer optimization. /.
bool is_table_dof_map() const
True if this is a table dof map.
virtual void get_component(pod_index_type xfiber_dof_id, void *xcomponent, size_type xcomponent_size) const
Sets xcomponent to the component referred to by fiber id xfiber_dof_id.
sparse_section_dof_map()
Default constructor.
virtual const std::string & class_name() const
The name of the actual (possibly derived) class of this instance.
const index_space_handle & row_dof_id_space() const
The row dof id space for the schema defined by this.
virtual const abstract_product_structure & product_structure() const =0
The product structure for this id space (const version).
The abstract map from section dof ids to section dof values of heterogeneous type.
virtual pod_type end() const =0
Ending id of this space.
An abstract iterator over the ids of an id space.
pod_type pod() const
The current id in the iteration.
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 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.
primitive_value dof(pod_index_type xdof_id) const
The dof referred to by xdof_id.
int version() const
The version of the host of the schema this is defined on.
pod_index_type ordinal(pod_index_type xi, pod_index_type xj, size_type xj_ub)
2-tuple to ordinal conversion.
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.
virtual section_space_schema_member & schema()
The schema on which this is allocated (mutable version).
virtual sparse_section_dof_map * copy() const
Virtual copy constructor.
bool is_initialized() const
True if this has been initialized, that is, if the schema has been set and the dof map storage alloca...
virtual void next()=0
Makes id() the next id in the iteration.
The general, abstract map from dof ids to dof values.
static dof_map_factory & factory()
The dof map factory.
bool is_done() const
True if iteration is finished.
virtual void release_iterator(index_space_iterator &xitr) const =0
Returns the id space iterator xitr to the iterator pool.
size_t dof_tuple_ub() const
The size of the dof tuple in bytes.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
static const std::string & static_class_name()
The name of this class.
int discretization_ct() const
The number of members in the intersection of the discretization subposet and the down set of the base...
virtual void put_component(pod_index_type xfiber_dof_id, const void *xcomponent, size_type xcomponent_size)
Sets the component referred to by fiber id xfiber_dof_id to xcomponent.
dof_tuple_type
Identifiers for dof tuple types.
A member of a Cartesian product space; a tuple of attributes (persistent version).
void ordinal(pod_type xi, pod_type xj, pod_type &xordinal) const
2-tuple to ordinal conversion.
virtual ~sparse_section_dof_map()
Destructor.
virtual index_space_iterator & get_iterator() const =0
Allocates an id space iterator from the iterator pool.
section_dof_map & operator=(const section_dof_map &xother)
Assignment operator.
const index_space_handle & fiber_schema_id_space(bool xis_table_dofs) const
The id space for the dofs in the down set of the fiber schema of this.
A discontiguous tuple, discontiguous fiber representation of the abstract map from section dof ids to...
int_type pod_index_type
The plain old data index type.
A 2D implementation of abstract_product_structure.
virtual void get_dof(pod_index_type xdof_id, void *xdof, size_type xdof_size) const
Copies the dof referred to by xdof_id into xdof.
virtual sparse_section_dof_map * clone() const
Virtual default constructor.
sparse_section_dof_map & operator=(const sparse_section_dof_map &xother)
Assignment operator.
virtual void get_dof_tuple(void *xbuf, size_t xbuflen) const
Copies the entire dof tuple from internal storage into xbuf.
void insert_prototype(const poset_dof_map *xprototype)
Sets xprototype as the prototype for its client class.
double sec_vd_dof_type
The type of degree of freedom in the section space.
virtual void * dof_tuple()
The dof tuple (mutable version).
double default_value()
The default value; the value for dofs that are not stored in _val_map.
virtual void put_dof_tuple(const void *xbuf, size_t xbuflen)
Copies the entire dof tuple from xbuf into internal storage.
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.
virtual bool invariant() const
The class invariant.
virtual void allocate_dofs()
Allocates dof storage.
const scoped_index & index() const
The index of this in host() dof tuple table.
virtual void put_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.
A handle for a poset whose members are numerical representations of sections of a fiber bundle...