CSol
|
Potential processor tile.
#include <bf/csol_bf_potential.h>
Public Member Functions | |
BF_Potential_Tile (CSol_Solver &, int, int, BF_Potential_Ranges &, int, cl::Kernel &) | |
Potential tile constructor. More... | |
BF_Potential_Tile (const BF_Potential_Tile &) | |
~BF_Potential_Tile () | |
void | boundaries (BF_Potential_Ranges &, int, int, cl::Kernel &) |
Apply boundaries. More... | |
void | build (BF_Potential_Ranges &, REAL, REAL, cl::Kernel &) |
void | calculate (BF_Potential_Ranges &, cl::Kernel &, cl::Buffer &, cl::Buffer &, cl::Buffer &, bool) |
Calculate results. More... | |
void | calculate (BF_Potential_Ranges &, REAL, cl::Kernel &) |
cl::Buffer *const | get_pb (int level) |
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_v () |
Returns 2D tile wind v (y-component) buffer. More... | |
cl::Buffer *const | get_pl0 (int level) |
Returns lambda buffer. More... | |
cl::Buffer *const | get_pl1 (int level) |
Returns lambda buffer. More... | |
void | init (BF_Potential_Ranges &, cl::Kernel &, cl::Kernel &, cl::Buffer &, cl::Buffer &, REAL, REAL) |
Initialise. More... | |
void | interpolate (BF_Potential_Ranges &, int, cl::Kernel &) |
Interpolate solution. More... | |
REAL | maximum (BF_Potential_Ranges &, cl::Kernel &, Potential_Type::Type) |
Maximum calculation function. More... | |
BF_Potential_Tile & | operator= (const BF_Potential_Tile &) |
void | relax (BF_Potential_Ranges &, int, bool, cl::Kernel &) |
Relax. More... | |
void | residual (BF_Potential_Ranges &, int, cl::Kernel &) |
Calculate residual. More... | |
void | restrictResidual (BF_Potential_Ranges &, int, cl::Kernel &) |
Restrict solution. More... | |
void | set (BF_Potential_Ranges &, REAL, cl::Kernel &) |
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_Potential_Tile | ( | CSol_Solver & | solver_, |
int | tx_, | ||
int | ty_, | ||
BF_Potential_Ranges & | ranges_, | ||
int | levels_, | ||
cl::Kernel & | fillBufferKernel | ||
) |
Creates a set of multigrid two-dimensional computational tiles for the bushfire potential processor. Each tile has equal x and y dimensions of 'tileSize'. 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_Potential_Ranges structure with the two-dimensional sizes of all multigrid levels. |
levels_ | the number of nested multigrid levels. |
fillRealBufferKernel | the OpenCL kernel to fill a buffer with an REAL value. |
|
inline |
BF_Potential_Tile | ( | const BF_Potential_Tile & | ) |
void boundaries | ( | BF_Potential_Ranges & | ranges, |
int | level, | ||
int | type, | ||
cl::Kernel & | boundariesKernel | ||
) |
Multigrid boundary function.
Copies boundary values between tiles
ranges | a BF_Potential_Ranges structure with the two-dimensional sizes of all multigrid levels. |
level | the grid level to relax. |
type | the grid type to relax, 0: l0, 1: l1, 2: b |
boundariesKernel | boundary kernel. |
void build | ( | BF_Potential_Ranges & | , |
REAL | , | ||
REAL | , | ||
cl::Kernel & | |||
) |
void calculate | ( | BF_Potential_Ranges & | ranges, |
cl::Kernel & | calculateKernel, | ||
cl::Buffer & | x, | ||
cl::Buffer & | u, | ||
cl::Buffer & | v, | ||
bool | addField | ||
) |
Multigrid calculation function.
Copies results to tile buffer
ranges | a BF_Potential_Ranges structure with the two-dimensional sizes of all multigrid levels. |
initKernel | initialisation kernel. |
void calculate | ( | BF_Potential_Ranges & | , |
REAL | , | ||
cl::Kernel & | |||
) |
|
inline |
|
inlinevirtual |
Implements BF_Tile.
|
inlinevirtual |
Implements BF_Tile.
|
inlinevirtual |
Implements BF_Tile.
|
inline |
|
inline |
void init | ( | BF_Potential_Ranges & | ranges, |
cl::Kernel & | initKernel, | ||
cl::Kernel & | fillBufferKernel, | ||
cl::Buffer & | f, | ||
cl::Buffer & | s, | ||
REAL | param_fn, | ||
REAL | param_mag | ||
) |
Multigrid initialisation function.
Sets forcing vector.
ranges | a BF_Potential_Ranges structure with the two-dimensional sizes of all multigrid levels. |
initKernel | initialisation kernel. |
void interpolate | ( | BF_Potential_Ranges & | ranges, |
int | level, | ||
cl::Kernel & | interpolateErrorKernel | ||
) |
Multigrid interpolation function.
Interpolates (up-samples) error grid to finer grid at higher level.
ranges | a BF_Potential_Ranges structure with the two-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 maximum | ( | BF_Potential_Ranges & | ranges, |
cl::Kernel & | maxKernel, | ||
Potential_Type::Type | type | ||
) |
Calculates maximum value in tile
ranges | a BF_Potential_Ranges structure with the two-dimensional sizes of all multigrid levels. |
maxKernel | kernel to calculate norm product reduction. |
BF_Potential_Tile& operator= | ( | const BF_Potential_Tile & | ) |
void relax | ( | BF_Potential_Ranges & | ranges, |
int | level, | ||
bool | flip, | ||
cl::Kernel & | solveKernel | ||
) |
Multigrid relaxation function.
Performs Jacobi relaxation on grid.
ranges | a BF_Potential_Ranges structure with the two-dimensional sizes of all multigrid levels. |
level | the grid level to relax. |
flip | switch between alternate grids. |
solveKernel | Jacobi relaxation kernel. |
void residual | ( | BF_Potential_Ranges & | ranges, |
int | level, | ||
cl::Kernel & | residualKernel | ||
) |
Multigrid restriction function.
Calculates residual.
ranges | a BF_Potential_Ranges structure with the two-dimensional sizes of all multigrid levels. |
level | the current grid level, the function restricts to the level one below this. |
residualKernel | kernel to calculate residual vector. |
void restrictResidual | ( | BF_Potential_Ranges & | ranges, |
int | level, | ||
cl::Kernel & | restrictResidualKernel | ||
) |
Multigrid restriction function.
Restricts (down-samples) grid to coarser grid at lower level.
ranges | a BF_Potential_Ranges structure with the two-dimensional sizes of all multigrid levels. |
level | the current grid level, the function restricts to the level one below this. |
restrictResidualKernel | kernel to restrict grid. |
void set | ( | BF_Potential_Ranges & | , |
REAL | , | ||
cl::Kernel & | |||
) |