CSol
Public Types | Public Member Functions | Protected Attributes | List of all members
BF_Tile Class Referenceabstract

Bushfire computational tile.

#include <bf/csol_bf.h>

Inheritance diagram for BF_Tile:
[legend]

Public Types

enum  bufferType {
  bFront, bClass, bArrival, bOut,
  bUser
}
 Tile buffer types. More...
 
enum  direction { North, South, West, East }
 Tile directions. More...
 

Public Member Functions

 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...
 
virtual cl::Buffer *const get_pbrand ()=0
 
virtual cl::Buffer *const get_pbw_u ()=0
 
virtual cl::Buffer *const get_pbw_v ()=0
 
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...
 

Protected Attributes

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...
 

Member Enumeration Documentation

enum bufferType
Enumerator
bFront 

Front data.

bClass 

Classification data.

bArrival 

Arrival time data.

bOut 

Output buffers.

bUser 

User data.

enum direction
Enumerator
North 

'North' positive y direction

South 

'South' negative y direction

West 

'West' negative x direction

East 

'East' positive x direction

Constructor & Destructor Documentation

BF_Tile ( CSol_Solver solver_,
int  tx_,
int  ty_ 
)

Creates a two-dimensional computational tile for the bushfire solver. Each tile has equal x and y dimensions of 'tileSize' with x and y spacings of 'hx' and 'hy', respectively. Every tile is reference according to the first tile created in the simulation. This first tile has a integer location of (0, 0) along with a global offset from the lower-left corner which is passed to this constructor for each subsequent tile creation.

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.
virtual ~BF_Tile ( )
inlinevirtual

Member Function Documentation

void deleteTile ( )
REAL get_hx ( )
inline
REAL get_hy ( )
inline
bool get_isAlive ( )
inline
REAL get_ox ( )
inline
REAL get_oy ( )
inline
virtual cl::Buffer* const get_pbrand ( )
pure virtual
virtual cl::Buffer* const get_pbw_u ( )
pure virtual
virtual cl::Buffer* const get_pbw_v ( )
pure virtual
int get_size ( )
inline
int get_tx ( )
inline
int get_ty ( )
inline
bool hasNeighbourE ( )
inline
bool hasNeighbourN ( )
inline
bool hasNeighbourNE ( )
inline
bool hasNeighbourNW ( )
inline
bool hasNeighbourS ( )
inline
bool hasNeighbourSE ( )
inline
bool hasNeighbourSW ( )
inline
bool hasNeighbourW ( )
inline
void setNeighbourE ( BF_Tile pTile)
inline
void setNeighbourN ( BF_Tile pTile)
inline
void setNeighbourNE ( BF_Tile pTile)
inline
void setNeighbourNW ( BF_Tile pTile)
inline
void setNeighbours ( std::map< BF::int64, BF_Tile * > &  tiles)

This detects the tile neighbours based on the input hash map of tile locations. Once a tile neighbour is detected, the corresponding pointers within the neighbour are set to point to the tile.

Parameters
tilesmap of all tiles.
void setNeighbourS ( BF_Tile pTile)
inline
void setNeighbourSE ( BF_Tile pTile)
inline
void setNeighbourSW ( BF_Tile pTile)
inline
void setNeighbourW ( BF_Tile pTile)
inline

Member Data Documentation

cl::Context& context
protected
REAL hx
protected
REAL hy
protected
bool isAlive
protected
int localSize
protected
REAL ox
protected
REAL oy
protected
BF_Tile* pTileE
protected
BF_Tile* pTileN
protected
BF_Tile* pTileNE
protected
BF_Tile* pTileNW
protected
BF_Tile* pTileS
protected
BF_Tile* pTileSE
protected
BF_Tile* pTileSW
protected
BF_Tile* pTileW
protected
cl::CommandQueue& queue
protected
int tileSize
protected
int tx
protected
int ty
protected