Peano
Loading...
Searching...
No Matches
benchmarks::exahype2::kernelbenchmarks::DataRepository::Indexing Struct Reference

Provides helper functions for calculating linearized array indices from geometric cell positions. More...

#include <DataRepository.h>

Static Public Member Functions

static int linearise (const tarch::la::Vector< DIMENSIONS, int > &cellCentre, const tarch::la::Vector< DIMENSIONS, double > &cellSize)
 Calculates the linearised index of the lower face of a cell along one axis (along one axis means the face normal is parallel to the axis) formula: faceIndexLow = x_1 + x_2 * (3^Depth)+1 + x_3 * (((3^Depth)+1)*(3^Depth)) faceIndexHigh = faceIndexLow + 1.
static tarch::la::Vector< DIMENSIONS, int > getFaceIndices (const tarch::la::Vector< DIMENSIONS, double > &cellCentre, const tarch::la::Vector< DIMENSIONS, double > &cellSize)
 Calculates the indices of the lower faces of a cell along along all axis for x axis: x_1 + x_2 * (3^Depth)+1 + x_3 * (((3^Depth)+1)*(3^Depth)) for y axis: x_2 + x_1 * (3^Depth)+1 + x_3 * (((3^Depth)+1)*(3^Depth)) for z axis: x_3 + x_1 * (3^Depth)+1 + x_2 * (((3^Depth)+1)*(3^Depth)) in 2d (((3^Depth)+1)*(3^Depth)) is not needed, because the faces are only in x and y direction Matrix * Vector: N = (3^Depth)
static int getFaceIndex (const tarch::la::Vector< DIMENSIONS, double > &cellCentre, const tarch::la::Vector< DIMENSIONS, double > &cellSize, int axis)

Detailed Description

Provides helper functions for calculating linearized array indices from geometric cell positions.

Definition at line 32 of file DataRepository.h.

Member Function Documentation

◆ getFaceIndex()

int benchmarks::exahype2::kernelbenchmarks::DataRepository::Indexing::getFaceIndex ( const tarch::la::Vector< DIMENSIONS, double > & cellCentre,
const tarch::la::Vector< DIMENSIONS, double > & cellSize,
int axis )
static

Definition at line 55 of file DataRepository.cpp.

References cellSize, and linearise().

Referenced by applyBoundaryConditionsToAxis(), benchmarks::exahype2::kernelbenchmarks::DataRepository::getFaceQNew(), and benchmarks::exahype2::kernelbenchmarks::DataRepository::getFaceQNewDevice().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFaceIndices()

tarch::la::Vector< DIMENSIONS, int > benchmarks::exahype2::kernelbenchmarks::DataRepository::Indexing::getFaceIndices ( const tarch::la::Vector< DIMENSIONS, double > & cellCentre,
const tarch::la::Vector< DIMENSIONS, double > & cellSize )
static

Calculates the indices of the lower faces of a cell along along all axis for x axis: x_1 + x_2 * (3^Depth)+1 + x_3 * (((3^Depth)+1)*(3^Depth)) for y axis: x_2 + x_1 * (3^Depth)+1 + x_3 * (((3^Depth)+1)*(3^Depth)) for z axis: x_3 + x_1 * (3^Depth)+1 + x_2 * (((3^Depth)+1)*(3^Depth)) in 2d (((3^Depth)+1)*(3^Depth)) is not needed, because the faces are only in x and y direction Matrix * Vector: N = (3^Depth)

| x_1 x_2 x_3 | | 1 | | index_x | | x_2 x_1 x_3 | * | N+1 | = | index_y | | x_3 x_1 x_2 | | (N+1)*N | | index_z |

Definition at line 33 of file DataRepository.cpp.

References cellSize, and linearise().

Here is the call graph for this function:

◆ linearise()

int benchmarks::exahype2::kernelbenchmarks::DataRepository::Indexing::linearise ( const tarch::la::Vector< DIMENSIONS, int > & cellCentre,
const tarch::la::Vector< DIMENSIONS, double > & cellSize )
static

Calculates the linearised index of the lower face of a cell along one axis (along one axis means the face normal is parallel to the axis) formula: faceIndexLow = x_1 + x_2 * (3^Depth)+1 + x_3 * (((3^Depth)+1)*(3^Depth)) faceIndexHigh = faceIndexLow + 1.

Definition at line 15 of file DataRepository.cpp.

References cellSize.

Referenced by getFaceIndex(), and getFaceIndices().

Here is the caller graph for this function:

The documentation for this struct was generated from the following files: