|
SpECTRE
2021.08.02
|
An ElementId uniquely labels an Element. More...
#include <ElementId.hpp>
Public Member Functions | |
| ElementId () noexcept=default | |
| Default constructor needed for Charm++ serialization. | |
| ElementId (const ElementId &) noexcept=default | |
| ElementId & | operator= (const ElementId &) noexcept=default |
| ElementId (ElementId &&) noexcept=default | |
| ElementId & | operator= (ElementId &&) noexcept=default |
| ElementId (size_t block_id, size_t grid_index=0) noexcept | |
| 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) noexcept | |
| Create an arbitrary ElementId. | |
| ElementId< VolumeDim > | id_of_child (size_t dim, Side side) const noexcept |
| ElementId< VolumeDim > | id_of_parent (size_t dim) const noexcept |
| size_t | block_id () const noexcept |
| size_t | grid_index () const noexcept |
| std::array< SegmentId, VolumeDim > | segment_ids () const noexcept |
| SegmentId | segment_id (const size_t dim) const noexcept |
Static Public Member Functions | |
| static ElementId< VolumeDim > | external_boundary_id () noexcept |
| 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_podElementId must not be larger than the size of three ints, 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.