SpECTRE
v2024.12.16
|
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, const 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 (size_t dim) const |
size_t | number_of_block_boundaries () const |
Returns the number of block boundaries the element has. | |
Static Public Member Functions | |
static ElementId< VolumeDim > | external_boundary_id () |
Returns an ElementId meant for identifying data on external boundaries, which does not correspond to the Id of an actual element. | |
Static Public Attributes | |
static constexpr size_t | block_id_bits = 8 |
static constexpr size_t | grid_index_bits = 4 |
static constexpr size_t | direction_bits = 4 |
static constexpr size_t | max_refinement_level = 15 |
The maximum allowed refinement level. | |
static constexpr uint64_t | direction_shift |
static constexpr uint64_t | direction_mask |
static constexpr size_t | volume_dim = VolumeDim |
Protected Member Functions | |
ElementId (const Direction< VolumeDim > &direction, const ElementId< VolumeDim > &element_id) | |
Create an ElementId in a specified direction. | |
Direction< VolumeDim > | direction () const |
ElementId | without_direction () const |
Friends | |
template<size_t Dim> | |
bool | operator== (const ElementId< Dim > &lhs, const ElementId< Dim > &rhs) |
template<size_t Dim> | |
bool | operator< (const ElementId< Dim > &lhs, const ElementId< Dim > &rhs) |
template<size_t Dim> | |
bool | is_zeroth_element (const ElementId< Dim > &id, const std::optional< size_t > &grid_index) |
Returns a bool if the element is the zeroth element in the domain. More... | |
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)
|
friend |
Returns a bool if the element is the zeroth element in the domain.
An element is considered to be the zeroth element if its ElementId id
has
grid_index
is specified, id.grid_index() == grid_index.This means that the only element in a domain that this function will return true
for is the element in the lower corner of Block0 of that domain. The grid_index
will determine which domain is used for the comparison. During evolutions, only one domain will be active at a time so it doesn't make sense to compare the grid_index
. However, during an elliptic solve when there are multiple grids, this grid_index
is useful for specifying only one element over all domains.
This function is useful if you need a unique element in the domain because only one element in the whole domain can be the zeroth element.
grid_index
argument, this function will return true
for one element in every grid and thus can't be used to determine a unique element in a simulation; only a unique element in each grid.
|
staticconstexpr |
|
staticconstexpr |