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

Wind correction processor tile.

#include <bf/csol_bf_wind_correct.h>

Inheritance diagram for BF_Wind_Tile:
[legend]

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_Tileoperator= (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_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_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.

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_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
fillRealBufferKernelthe OpenCL kernel to fill a buffer with an REAL value.
initHeightKernelthe OpenCL kernel to initialise the height buffer.
initRandKernelthe OpenCL kernel to initialise the random buffer.
restrictHeightKernelthe OpenCL kernel to restrict the base height buffer.
~BF_Wind_Tile ( )
inline
BF_Wind_Tile ( const BF_Wind_Tile )

Member Function Documentation

void boundaries ( BF_Wind_Ranges ranges,
int  level,
bool  flip,
cl::Kernel &  boundariesTerrainKernel 
)

Multigrid boundary function.

Sets boundary values from neighbours.

Parameters
rangesa BF_Wind_Ranges structure with the three-dimensional sizes of all multigrid levels.
levelthe grid level to set.
flipswitch between alternate grids.
boundariesTerrainKernelkernel to apply boundary conditions.
void build ( BF_Wind_Ranges ranges,
REAL  H,
REAL  alpha,
cl::Kernel &  buildKernel 
)

Builds the top-level multigrid forcing vector.

Parameters
rangesa BF_Wind_Ranges structure with the three-dimensional sizes of all multigrid levels.
Hthe domain height.
buildKernelkernel 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.

Parameters
rangesa BF_Wind_Ranges structure with the three-dimensional sizes of all multigrid levels.
Hthe domain height.
alphathe correction vertical mixing parameter.
calculateKernelkernel to calculate the vector field.
REAL dot_b ( BF_Wind_Ranges ranges,
cl::Kernel &  dotKernel 
)

Calculates square of vector b

Parameters
rangesa BF_Potential_Ranges structure with the two-dimensional sizes of all multigrid levels.
dotKernelkernel to calculate norm product reduction.
cl::Buffer* const get_pbb ( )
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_u_3D ( )
inline
cl::Buffer* const get_pbw_v ( )
inlinevirtual

Implements BF_Tile.

cl::Buffer* const get_pbw_v_3D ( )
inline
cl::Buffer* const get_pbw_w_3D ( )
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.

Parameters
rangesa BF_Wind_Ranges structure with the three-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 norm ( BF_Wind_Ranges ranges,
REAL  H,
REAL  alpha,
cl::Kernel &  normKernel 
)

Calculates Square of error: |Ax-b|

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

Parameters
rangesa BF_Wind_Ranges structure with the three-dimensional sizes of all multigrid levels.
levelthe grid level to relax.
flipswitch between alternate grids.
Hthe domain height.
alphathe correction vertical mixing parameter.
solveKernelJacobi 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.

Parameters
rangesa BF_Wind_Ranges structure with the three-dimensional sizes of all multigrid levels.
levelthe current grid level, the function restricts to the level one below this.
Hthe domain height.
alphathe correction vertical mixing parameter.
applyKernelkernel to apply matrix to forcing vector.
restrictResidualKernelkernel 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.

Parameters
rangesa BF_Wind_Ranges structure with the three-dimensional sizes of all multigrid levels.
Hthe domain height.
setKernelkernel to set the vector field.