SpECTRE
v2024.05.11
|
An ElementId uniquely labels an Element. More...
#include <ElementId.hpp>
Public Member Functions | |
ElementId ()=default | |
Default constructor needed for Charm++ serialization. | |
ElementId (const ElementId &)=default | |
ElementId & | operator= (const ElementId &)=default |
ElementId (ElementId &&)=default | |
ElementId & | operator= (ElementId &&)=default |
ElementId (size_t block_id, size_t grid_index=0) | |
Create the ElementId of the root Element of a Block. | |
ElementId (size_t block_id, std::array< SegmentId, VolumeDim > segment_ids, size_t grid_index=0) | |
Create an arbitrary ElementId. | |
ElementId (const std::string &grid_name) | |
Create an ElementId from its string representation (see operator<< ). | |
ElementId< VolumeDim > | id_of_child (size_t dim, Side side) const |
ElementId< VolumeDim > | id_of_parent (size_t dim) const |
size_t | block_id () const |
size_t | grid_index () const |
std::array< size_t, VolumeDim > | refinement_levels () const |
std::array< SegmentId, VolumeDim > | segment_ids () const |
SegmentId | segment_id (const size_t dim) const |
Static Public Member Functions | |
static ElementId< VolumeDim > | external_boundary_id () |
Returns an ElementId meant for identifying data on external boundaries, which should never correspond to the Id of an actual element. | |
An ElementId uniquely labels an Element.
It is constructed from the BlockId of the Block to which the Element belongs and the VolumeDim SegmentIds that label the segments of the Block that the Element covers. An optional grid_index
identifies elements with the same BlockId and SegmentIds across multiple grids.
The ElementId
serves as an index that is compatible with Charm++ and therefore must adhere to the restrictions imposed by Charm++. These are:
ElementId
must satisfy std::is_pod
ElementId
must not be larger than the size of three int
s, i.e. sizeof(ElementId) <= 3 * sizeof(int)
The latter restriction can be relaxed with a special compilation flag to Charm++, but we have not yet needed more elements than can be accounted for by densely packing bits together. SegmentId
is responsible for handling the low-level bit manipulations to create an index that satisfies the size constraints.