CSol
Public Member Functions | List of all members
BF_Potential_Tile Class Reference

Potential processor tile.

#include <bf/csol_bf_potential.h>

Inheritance diagram for BF_Potential_Tile:
[legend]

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_Tileoperator= (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_TilepTileE
 
BF_TilepTileN
 
BF_TilepTileNE
 
BF_TilepTileNW
 
BF_TilepTileS
 
BF_TilepTileSE
 
BF_TilepTileSW
 
BF_TilepTileW
 
cl::CommandQueue & queue
 
int tileSize
 Number of cells in each tile. More...
 
int tx
 
int ty
 Cell offset in tile world units. More...
 

Constructor & Destructor Documentation

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.

Parameters
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.
fillRealBufferKernelthe OpenCL kernel to fill a buffer with an REAL value.
~BF_Potential_Tile ( )
inline

Member Function Documentation

void boundaries ( BF_Potential_Ranges ranges,
int  level,
int  type,
cl::Kernel &  boundariesKernel 
)

Multigrid boundary function.

Copies boundary values between tiles

Parameters
rangesa BF_Potential_Ranges structure with the two-dimensional sizes of all multigrid levels.
levelthe grid level to relax.
typethe grid type to relax, 0: l0, 1: l1, 2: b
boundariesKernelboundary 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

Parameters
rangesa BF_Potential_Ranges structure with the two-dimensional sizes of all multigrid levels.
initKernelinitialisation kernel.
void calculate ( BF_Potential_Ranges ,
REAL  ,
cl::Kernel &   
)
cl::Buffer* const get_pb ( int  level)
inline
cl::Buffer* const get_pbrand ( )
inlinevirtual

Implements BF_Tile.

cl::Buffer* const get_pbw_u ( )
inlinevirtual

Implements BF_Tile.

cl::Buffer* const get_pbw_v ( )
inlinevirtual

Implements BF_Tile.

cl::Buffer* const get_pl0 ( int  level)
inline
cl::Buffer* const get_pl1 ( int  level)
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.

Parameters
rangesa BF_Potential_Ranges structure with the two-dimensional sizes of all multigrid levels.
initKernelinitialisation 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.

Parameters
rangesa BF_Potential_Ranges structure with the two-dimensional sizes of all multigrid levels.
levelthe current grid level, the function interpolates to the level one above this.
interpolateErrorKernelkernel to interpolate error grid.
REAL maximum ( BF_Potential_Ranges ranges,
cl::Kernel &  maxKernel,
Potential_Type::Type  type 
)

Calculates maximum value in tile

Parameters
rangesa BF_Potential_Ranges structure with the two-dimensional sizes of all multigrid levels.
maxKernelkernel 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.

Parameters
rangesa BF_Potential_Ranges structure with the two-dimensional sizes of all multigrid levels.
levelthe grid level to relax.
flipswitch between alternate grids.
solveKernelJacobi relaxation kernel.
void residual ( BF_Potential_Ranges ranges,
int  level,
cl::Kernel &  residualKernel 
)

Multigrid restriction function.

Calculates residual.

Parameters
rangesa BF_Potential_Ranges structure with the two-dimensional sizes of all multigrid levels.
levelthe current grid level, the function restricts to the level one below this.
residualKernelkernel 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.

Parameters
rangesa BF_Potential_Ranges structure with the two-dimensional sizes of all multigrid levels.
levelthe current grid level, the function restricts to the level one below this.
restrictResidualKernelkernel to restrict grid.
void set ( BF_Potential_Ranges ,
REAL  ,
cl::Kernel &   
)