CSol
|
Wind correction processor tile.
#include <bf/csol_bf_wind_correct.h>
Public Member Functions | |
BF_Wind_Tile (CSol_Solver &, int, int, BF_Wind_Ranges &, int, REAL, GridScalar &, unsigned int, cl::Kernel &, cl::Kernel &, cl::Kernel &, cl::Kernel &) | |
Wind correction tile constructor. More... | |
BF_Wind_Tile (const BF_Wind_Tile &) | |
~BF_Wind_Tile () | |
void | boundaries (BF_Wind_Ranges &, int, bool, cl::Kernel &) |
Set solution boundaries. More... | |
void | build (BF_Wind_Ranges &, REAL, REAL, cl::Kernel &) |
Forcing vector construction function. More... | |
void | calculate (BF_Wind_Ranges &, REAL, REAL, cl::Kernel &) |
Cartesian wind vector calculation function. More... | |
REAL | dot_b (BF_Wind_Ranges &, cl::Kernel &) |
Dot calculation function. More... | |
cl::Buffer *const | get_pbb () |
Returns tile base height buffer. More... | |
cl::Buffer *const | get_pbrand () |
Returns tile random buffer. More... | |
cl::Buffer *const | get_pbw_u () |
Returns 2D tile wind u (x-component) buffer. More... | |
cl::Buffer *const | get_pbw_u_3D () |
Returns 2D tile wind u (x-component) buffer. More... | |
cl::Buffer *const | get_pbw_v () |
Returns 2D tile wind v (y-component) buffer. More... | |
cl::Buffer *const | get_pbw_v_3D () |
Returns 2D tile wind v (y-component) buffer. More... | |
cl::Buffer *const | get_pbw_w_3D () |
Returns tile wind w (z-component) buffer. More... | |
void | interpolate (BF_Wind_Ranges &, int, cl::Kernel &) |
Interpolate solution. More... | |
REAL | norm (BF_Wind_Ranges &, REAL, REAL, cl::Kernel &) |
Norm calculation function. More... | |
BF_Wind_Tile & | operator= (const BF_Wind_Tile &) |
void | relax (BF_Wind_Ranges &, int, bool, REAL, REAL, cl::Kernel &) |
Relax solution. More... | |
void | restrict (BF_Wind_Ranges &, int, REAL, REAL, cl::Kernel &, cl::Kernel &) |
Restrict solution. More... | |
void | set (BF_Wind_Ranges &, REAL, REAL, cl::Kernel &) |
Vector field initialisation function. More... | |
Public Member Functions inherited from BF_Tile | |
BF_Tile (CSol_Solver &, int, int) | |
Bushfire tile constructor. More... | |
virtual | ~BF_Tile () |
void | deleteTile () |
De-activates the tile. More... | |
REAL | get_hx () |
Returns tile spacing in x-direction. More... | |
REAL | get_hy () |
Returns tile spacing in y-direction. More... | |
bool | get_isAlive () |
Returns true if tile is active, false otherwise. More... | |
REAL | get_ox () |
Returns global tile offset in x-direction. More... | |
REAL | get_oy () |
Returns global tile offset in y-direction. More... | |
int | get_size () |
Returns tile dimensions. More... | |
int | get_tx () |
Returns integer tile offset in x-direction. More... | |
int | get_ty () |
Returns integer tile offset in y-direction. More... | |
bool | hasNeighbourE () |
Returns true if tile has a east neighbour, false otherwise. More... | |
bool | hasNeighbourN () |
Returns true if tile has a north neighbour, false otherwise. More... | |
bool | hasNeighbourNE () |
Returns true if tile has a north-east neighbour, false otherwise. More... | |
bool | hasNeighbourNW () |
Returns true if tile has a north-west neighbour, false otherwise. More... | |
bool | hasNeighbourS () |
Returns true if tile has a south neighbour, false otherwise. More... | |
bool | hasNeighbourSE () |
Returns true if tile has a south-east neighbour, false otherwise. More... | |
bool | hasNeighbourSW () |
Returns true if tile has a south-west neighbour, false otherwise. More... | |
bool | hasNeighbourW () |
Returns true if tile has a west neighbour, false otherwise. More... | |
void | setNeighbourE (BF_Tile *pTile) |
Sets tile east neighbour. More... | |
void | setNeighbourN (BF_Tile *pTile) |
Sets tile north neighbour. More... | |
void | setNeighbourNE (BF_Tile *pTile) |
Sets tile north-east neighbour. More... | |
void | setNeighbourNW (BF_Tile *pTile) |
Sets tile north-west neighbour. More... | |
void | setNeighbours (std::map< BF::int64, BF_Tile * > &) |
Sets tile neighbours. More... | |
void | setNeighbourS (BF_Tile *pTile) |
Sets tile south neighbour. More... | |
void | setNeighbourSE (BF_Tile *pTile) |
Sets tile south-east neighbour. More... | |
void | setNeighbourSW (BF_Tile *pTile) |
Sets tile south-west neighbour. More... | |
void | setNeighbourW (BF_Tile *pTile) |
Sets tile west neighbour. More... | |
Additional Inherited Members | |
Public Types inherited from BF_Tile | |
enum | bufferType { bFront, bClass, bArrival, bOut, bUser } |
Tile buffer types. More... | |
enum | direction { North, South, West, East } |
Tile directions. More... | |
Protected Attributes inherited from BF_Tile | |
cl::Context & | context |
REAL | hx |
REAL | hy |
Cell spacing in world units. More... | |
bool | isAlive |
Active flag. More... | |
int | localSize |
OpenCL group size. More... | |
REAL | ox |
REAL | oy |
Tile origin in world units. More... | |
BF_Tile * | pTileE |
BF_Tile * | pTileN |
BF_Tile * | pTileNE |
BF_Tile * | pTileNW |
BF_Tile * | pTileS |
BF_Tile * | pTileSE |
BF_Tile * | pTileSW |
BF_Tile * | pTileW |
cl::CommandQueue & | queue |
int | tileSize |
Number of cells in each tile. More... | |
int | tx |
int | ty |
Cell offset in tile world units. More... | |
BF_Wind_Tile | ( | CSol_Solver & | solver_, |
int | tx_, | ||
int | ty_, | ||
BF_Wind_Ranges & | ranges_, | ||
int | levels_, | ||
REAL | hs_, | ||
GridScalar & | base, | ||
unsigned int | seed, | ||
cl::Kernel & | fillBufferKernel, | ||
cl::Kernel & | initHeightKernel, | ||
cl::Kernel & | initRandKernel, | ||
cl::Kernel & | restrictHeightKernel | ||
) |
Creates a set of multigrid three-dimensional computational tiles for the bushfire wind correction processor. Each tile has equal x and y dimensions of 'tileSize' with a number of vertical levels. The number of multigrid levels is given by the 'levels' parameter. The tiles have x and y spacings of 'hx' and 'hy', respectively.
solver_ | the parent solver instance. |
tx_ | the integer x-location of the tile with respect to the first tile created. |
ty_ | the integer y-location of the tile with respect to the first tile created. |
ranges_ | a BF_Wind_Ranges structure with the three-dimensional sizes of all multigrid levels. |
levels_ | the number of nested multigrid levels. |
hs_ | the tile spacing in the sigma (z)-direction. |
base_ | the base height layer |
seed_ | a random seed |
fillRealBufferKernel | the OpenCL kernel to fill a buffer with an REAL value. |
initHeightKernel | the OpenCL kernel to initialise the height buffer. |
initRandKernel | the OpenCL kernel to initialise the random buffer. |
restrictHeightKernel | the OpenCL kernel to restrict the base height buffer. |
|
inline |
BF_Wind_Tile | ( | const BF_Wind_Tile & | ) |
void boundaries | ( | BF_Wind_Ranges & | ranges, |
int | level, | ||
bool | flip, | ||
cl::Kernel & | boundariesTerrainKernel | ||
) |
Multigrid boundary function.
Sets boundary values from neighbours.
ranges | a BF_Wind_Ranges structure with the three-dimensional sizes of all multigrid levels. |
level | the grid level to set. |
flip | switch between alternate grids. |
boundariesTerrainKernel | kernel to apply boundary conditions. |
void build | ( | BF_Wind_Ranges & | ranges, |
REAL | H, | ||
REAL | alpha, | ||
cl::Kernel & | buildKernel | ||
) |
Builds the top-level multigrid forcing vector.
ranges | a BF_Wind_Ranges structure with the three-dimensional sizes of all multigrid levels. |
H | the domain height. |
buildKernel | kernel to build the forcing vector. |
void calculate | ( | BF_Wind_Ranges & | ranges, |
REAL | H, | ||
REAL | alpha, | ||
cl::Kernel & | calculateKernel | ||
) |
Calculates the wind vector in Cartesian components from the curvilinear gradient of lambda.
ranges | a BF_Wind_Ranges structure with the three-dimensional sizes of all multigrid levels. |
H | the domain height. |
alpha | the correction vertical mixing parameter. |
calculateKernel | kernel to calculate the vector field. |
REAL dot_b | ( | BF_Wind_Ranges & | ranges, |
cl::Kernel & | dotKernel | ||
) |
Calculates square of vector b
ranges | a BF_Potential_Ranges structure with the two-dimensional sizes of all multigrid levels. |
dotKernel | kernel to calculate norm product reduction. |
|
inline |
|
inlinevirtual |
Implements BF_Tile.
|
inlinevirtual |
Implements BF_Tile.
|
inline |
|
inlinevirtual |
Implements BF_Tile.
|
inline |
|
inline |
void interpolate | ( | BF_Wind_Ranges & | ranges, |
int | level, | ||
cl::Kernel & | interpolateErrorKernel | ||
) |
Multigrid interpolation function.
Interpolates (up-samples) error grid to finer grid at higher level.
ranges | a BF_Wind_Ranges structure with the three-dimensional sizes of all multigrid levels. |
level | the current grid level, the function interpolates to the level one above this. |
interpolateErrorKernel | kernel to interpolate error grid. |
REAL norm | ( | BF_Wind_Ranges & | ranges, |
REAL | H, | ||
REAL | alpha, | ||
cl::Kernel & | normKernel | ||
) |
Calculates Square of error: |Ax-b|
ranges | a BF_Potential_Ranges structure with the two-dimensional sizes of all multigrid levels. |
normKernel | kernel to calculate norm product reduction. |
BF_Wind_Tile& operator= | ( | const BF_Wind_Tile & | ) |
void relax | ( | BF_Wind_Ranges & | ranges, |
int | level, | ||
bool | flip, | ||
REAL | H, | ||
REAL | alpha, | ||
cl::Kernel & | solveKernel | ||
) |
Multigrid relaxation function.
Performs Jacobi relaxation on grid.
ranges | a BF_Wind_Ranges structure with the three-dimensional sizes of all multigrid levels. |
level | the grid level to relax. |
flip | switch between alternate grids. |
H | the domain height. |
alpha | the correction vertical mixing parameter. |
solveKernel | Jacobi relaxation kernel. |
void restrict | ( | BF_Wind_Ranges & | ranges, |
int | level, | ||
REAL | H, | ||
REAL | alpha, | ||
cl::Kernel & | applyKernel, | ||
cl::Kernel & | restrictResidualKernel | ||
) |
Multigrid restriction function.
Restricts (down-samples) grid to coarser grid at lower level.
ranges | a BF_Wind_Ranges structure with the three-dimensional sizes of all multigrid levels. |
level | the current grid level, the function restricts to the level one below this. |
H | the domain height. |
alpha | the correction vertical mixing parameter. |
applyKernel | kernel to apply matrix to forcing vector. |
restrictResidualKernel | kernel to restrict grid. |
void set | ( | BF_Wind_Ranges & | ranges, |
REAL | H, | ||
REAL | alpha, | ||
cl::Kernel & | setKernel | ||
) |
Intialises top-level multigrid vector field with two-dimensional vector field.
ranges | a BF_Wind_Ranges structure with the three-dimensional sizes of all multigrid levels. |
H | the domain height. |
setKernel | kernel to set the vector field. |