Defines a D-dimensional stencil info with Q directions.
A stencil is defined by picking a subset of all possible directions. These directions are listed in the dir array. So when iterating a stencil, one iterates the dir array which contains the directions. To get the properties for these directions, the global arrays of Directions.h can be used:
Since all these arrays are constant, the lookup can be resolved at compile time and no performance overhead should be generated.
For more convenient iteration, use the provided iterator. The following code is equivalent to the code example above:
#include <Stencil.in.h>
Member Variables | |
static const char * | NAME = "$name" |
static const uint_t | D = $D |
static const uint_t | Q = $Q |
static const uint_t | POS_Q = $Q / 2 |
static const uint_t | Dimension = $D |
static const uint_t | Size = $Q |
static const bool | containsCenter = $containsCenter |
static const uint_t | noCenterFirstIdx = $noCenterFirstIndex |
static const Direction | dir [$Q] = { $dirs } |
Subset of directions. Defines the stencil. More... | |
static const Direction | dir_pos [POS_Q] = { $dir_pos } |
Contains only half of the directions ( the positive ones ) More... | |
static const uint_t | idx [NR_OF_DIRECTIONS] = { $indexFromDir } |
Maps direction enums, to an index. More... | |
static const Direction | d_per_d [NR_OF_DIRECTIONS][$Q/2] = { $d_per_d } |
Maps a direction to a set of sub-directions. More... | |
static const uint_t | d_per_d_length [NR_OF_DIRECTIONS] = { $d_per_d_length } |
Length of the d_per_d array For usage see documentation of d_per_d. More... | |
static const Direction | dir_neighbors [NR_OF_DIRECTIONS][NR_OF_DIRECTIONS] = { $dir_neighbors } |
Views directions as cells in a 3x3x3 grid. More... | |
static const uint_t | dir_neighbors_length [NR_OF_DIRECTIONS] = { $dir_neighbors_length } |
Length of the dir_neighbors array For usage see documentation of dir_neighbors. More... | |
static bool | containsDir (Direction d) |
static uint_t | invDirIdx (Direction d) |
Iteration | |
typedef stencil::Iterator< $name > | iterator |
static iterator | begin () |
static iterator | beginNoCenter () |
static iterator | end () |
typedef stencil::Iterator<$name> walberla::stencil::internal::$name< Dummy >::iterator |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
static |
|
static |
|
static |
Maps a direction to a set of sub-directions.
A sub-direction is defined as a direction that contains the letters of the original direction i.e. SW is a sub-direction of S and W. the following code shows how to iterate over all sub-directions, that are contained in the stencil of W
|
static |
Length of the d_per_d array For usage see documentation of d_per_d.
|
static |
|
static |
Subset of directions. Defines the stencil.
|
static |
Views directions as cells in a 3x3x3 grid.
Describes neighborhood between cells/directions.
Basis a 3x3x3 grid where every cell corresponds to a direction. The following array provides answer to the question: What are the neighboring cells of a given cell using the current stencil. If a neighbor is not in this 3x3x3 grid it can not be described by a direction and is not returned. Therefore N , for example, has more neighbors that NW. By definition, the neighbors of C are identical to the dir[] array without C itself.
|
static |
Length of the dir_neighbors array For usage see documentation of dir_neighbors.
|
static |
Contains only half of the directions ( the positive ones )
Use this f.e. in situations where direction have to be handled pairwise, the direction together with its inverse direction.
|
static |
Maps direction enums, to an index.
Use this when working with fields: The direction enum cannot be used as field index directly. Consider having a D2Q4 stencil, then the fourth field index f ranges from 0 to 3, but the direction enums are S=1,N=2,E=3,W=4 start at 1. So a stencil class is needed to map back from direction to field index
|
static |
|
static |
|
static |
|
static |
|
static |