SpECTRE  v2024.03.19
ElementId< VolumeDim > Class Template Reference

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
 
ElementIdoperator= (const ElementId &)=default
 
 ElementId (ElementId &&)=default
 
ElementIdoperator= (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.
 

Static Public Attributes

static constexpr size_t block_id_bits = 24
 
static constexpr size_t grid_index_bits = 8
 
static constexpr size_t refinement_bits = 4
 
static constexpr size_t max_refinement_level = 16
 
static constexpr size_t padding = 4
 
static constexpr size_t volume_dim = VolumeDim
 

Detailed Description

template<size_t VolumeDim>
class ElementId< VolumeDim >

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.

Details

The ElementId serves as an index that is compatible with Charm++ and therefore must adhere to the restrictions imposed by Charm++. These are:

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.


The documentation for this class was generated from the following file: