DASH
0.3.0
|
N-Dimensional region coordinates and associated indices for all possible Halo/Boundary regions of a HaloBlock. More...
#include <Region.h>
Public Types | |
using | Coords_t = std::array< uint8_t, NumDimensions > |
using | CoordsVec_t = std::vector< Self_t > |
using | RegIndDepVec_t = std::vector< region_index_t > |
using | RegIndexDim_t = std::pair< region_index_t, region_index_t > |
Public Member Functions | |
RegionCoords () | |
Default Constructor. More... | |
template<typename... Values> | |
RegionCoords (region_coord_t value, Values... values) | |
Constructor allows custom coordinate values and calculates the fitting region index. More... | |
RegionCoords (region_index_t index) | |
Constructor takes a region index to set up the region coordinates. More... | |
constexpr region_index_t | index () const |
dim_t | level () |
returns the number of coordinates unequal to the center (1) for all dimensions More... | |
constexpr bool | operator== (const Self_t &other) const |
constexpr bool | operator!= (const Self_t &other) const |
constexpr const std::array< region_coord_t, NumDimensions > & | values () const |
Return value with all dimensions as array of NumDimensions elements. More... | |
region_coord_t | dim (dim_t dimension) const |
The value in the given dimension. More... | |
constexpr region_coord_t | operator[] (size_t dimension) const |
Subscript operator, access to value in dimension given by index. More... | |
region_coord_t & | operator[] (size_t dimension) |
Subscript assignment operator, access to value in dimension given by index. More... | |
constexpr bool | operator== (const self_t &other) const |
Equality comparison operator. More... | |
constexpr bool | operator!= (const self_t &other) const |
Equality comparison operator. More... | |
constexpr dim_t | rank () const |
The number of dimensions of the value. More... | |
Static Public Member Functions | |
static constexpr region_index_t | center_index () |
static Coords_t | center_coords () |
static constexpr RegIndexDim_t | index (dim_t dim) |
Returns a region index for a given dimension and RegionPos. More... | |
static constexpr region_index_t | index (dim_t dim, RegionPos pos) |
Returns a region index for a given dimension and RegionPos. More... | |
template<typename StencilPointT > | |
static constexpr region_index_t | index (const StencilPointT &stencil) |
Returns a region index for a given dimension and RegionPos. More... | |
static region_index_t | index (const Coords_t &coords) |
Returns the region index for a given RegionCoords. More... | |
static Coords_t | coords (const region_index_t index) |
static dim_t | relevant_dim (const Coords_t &coords) |
Returns the highest dimension with region values != 1. More... | |
static dim_t | level (const Coords_t &coords) |
auto max = stencil.max(); level = 0 -> center (1,1) level = 1 -> main regions (e.g. More... | |
static RegIndDepVec_t | boundary_dependencies (region_index_t index) |
static constexpr dim_t | ndim () |
The number of dimensions of the value. More... | |
N-Dimensional region coordinates and associated indices for all possible Halo/Boundary regions of a HaloBlock.
The center (all values = 1) is the local NArray memory block used by the HaloBlock.
Example for 2-D
.----—..----—..----—. | 0 || 1 || 2 <-|– region index | (0,0) || (0,1) || (0,2)<|– region coordinates | NW || N || NE <|– north east (only for explanation) '----—''----—''----—' .----—..----—..----—. | 3 || 4 || 5 | | (1,0) || (1,1) || (1,2) | | W || C || E | '----—''----—''----—' .----—..----—..----—. | 6 || 7 || 8 | | (2,0) || (2,1) || (2,2) | | SW || S || SE | '----—''----—''----—'
|
inline |
Default Constructor.
All region coordinate values are 1 and pointing to the center.
Definition at line 61 of file Region.h.
|
inline |
Constructor allows custom coordinate values and calculates the fitting region index.
Definition at line 72 of file Region.h.
|
inline |
Constructor takes a region index to set up the region coordinates.
Definition at line 79 of file Region.h.
|
inlinestatic |
index | region index |
Definition at line 181 of file Region.h.
References dash::index().
|
inlineinherited |
The value in the given dimension.
dimension | The dimension |
Definition at line 152 of file Dimensional.h.
|
inline |
Definition at line 97 of file Region.h.
References dash::halo::RegionCoords< NumDimensions >::index().
Referenced by dash::halo::RegionCoords< NumDimensions >::index(), and dash::halo::RegionSpec< NumDimensions >::operator[]().
|
inlinestatic |
Returns a region index for a given dimension and RegionPos.
Definition at line 102 of file Region.h.
|
inlinestatic |
Returns a region index for a given dimension and RegionPos.
Definition at line 121 of file Region.h.
|
inlinestatic |
Returns a region index for a given dimension and RegionPos.
Definition at line 138 of file Region.h.
References dash::index().
|
inlinestatic |
Returns the region index for a given RegionCoords.
Definition at line 162 of file Region.h.
References dash::index().
|
inlinestatic |
auto max = stencil.max(); level = 0 -> center (1,1) level = 1 -> main regions (e.g.
2D: (0,1) (2,1) (1,0) (1,2) level = 2 e.g. 2D corner regions or 3D edge regions ... for dimensions higher than 2D relevant
Definition at line 213 of file Region.h.
|
inline |
returns the number of coordinates unequal to the center (1) for all dimensions
level = 0 -> center (1,1) level = 1 -> main regions (e.g. 2D: (0,1) (2,1) (1,0) (1,2) level = 2 e.g. 2D corner regions or 3D edge regions ... for dimensions higher than 2D relevant
Definition at line 231 of file Region.h.
References dash::index(), and dash::halo::RegionCoords< NumDimensions >::level().
Referenced by dash::halo::RegionCoords< NumDimensions >::level().
|
inlinestaticinherited |
The number of dimensions of the value.
Definition at line 207 of file Dimensional.h.
|
inlineinherited |
Equality comparison operator.
Definition at line 193 of file Dimensional.h.
|
inlineinherited |
Equality comparison operator.
Definition at line 186 of file Dimensional.h.
|
inlineinherited |
Subscript operator, access to value in dimension given by index.
Alias for dim
.
dimension | The dimension |
Definition at line 167 of file Dimensional.h.
|
inlineinherited |
Subscript assignment operator, access to value in dimension given by index.
Alias for dim
.
dimension | The dimension |
Definition at line 179 of file Dimensional.h.
|
inlineinherited |
The number of dimensions of the value.
Definition at line 200 of file Dimensional.h.
|
inlinestatic |
Returns the highest dimension with region values != 1.
Definition at line 197 of file Region.h.
|
inlineinherited |
Return value with all dimensions as array of NumDimensions
elements.
Definition at line 142 of file Dimensional.h.