![]() |
Peano
|
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. More... | |
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) More... | |
static int | getFaceIndex (const tarch::la::Vector< DIMENSIONS, double > &cellCentre, const tarch::la::Vector< DIMENSIONS, double > &cellSize, int axis) |
Provides helper functions for calculating linearized array indices from geometric cell positions.
Definition at line 32 of file DataRepository.h.
|
static |
Definition at line 55 of file DataRepository.cpp.
References cellSize.
Referenced by applyBoundaryConditionsToAxis(), benchmarks::exahype2::kernelbenchmarks::DataRepository::getFaceQNew(), and benchmarks::exahype2::kernelbenchmarks::DataRepository::getFaceQNewDevice().
|
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.
|
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, and acoustic::depth.