lbm_reference
Public Member Functions | Protected Attributes | List of all members
Grid< T, Cellsize > Class Template Reference

3-dimensional grid of Cells with template specifyable number of cell variables and type More...

#include <Grid.h>

+ Inheritance diagram for Grid< T, Cellsize >:
+ Collaboration diagram for Grid< T, Cellsize >:

Public Member Functions

int getSizeX ()
 Get size in x-dimension. More...
 
int getSizeY ()
 Get size in y-dimension. More...
 
int getSizeZ ()
 Get size in z-dimension. More...
 
 Grid ()
 Default constructor. More...
 
 Grid (int sizeX, int sizeY, int sizeZ)
 Constructor to specify grid dimensions. More...
 
 Grid (int sizeX, int sizeY, int sizeZ, T val)
 Constructor to specify grid dimensions and initialization value. More...
 
void init (int sizeX, int sizeY, int sizeZ, T val)
 Initialize the grid with given dimensions and initial value. More...
 
void init (T val)
 Initialize the grid with given initial value. More...
 
T & operator() (int x, int y, int z, int f)
 Get specified cell variable of specified cell. More...
 
const T & operator() (int x, int y, int z, int f) const
 Get specified const cell variable of specified cell. More...
 
virtual ~Grid ()
 Destructor. More...
 

Protected Attributes

std::vector< T > data_
 Linearized, 1-dimensional representation of the 3D data grid. More...
 
int sizeX_
 Number of cells in x-dimension. More...
 
int sizeY_
 Number of cells in y-dimension. More...
 
int sizeZ_
 Number of cells in z-dimension. More...
 

Detailed Description

template<typename T, int Cellsize>
class Grid< T, Cellsize >

3-dimensional grid of Cells with template specifyable number of cell variables and type

Template Parameters
TType of cell variables
CellsizeNumber of cell variables

Definition at line 18 of file Grid.h.

Constructor & Destructor Documentation

template<typename T , int Cellsize>
Grid< T, Cellsize >::Grid ( )

Default constructor.

Creates a grid with zero cells in each dimension

Date
Jan 16, 2009
Author
Florian Rathgeber

Definition at line 17 of file Grid_def.h.

template<typename T , int Cellsize>
Grid< T, Cellsize >::Grid ( int  sizeX,
int  sizeY,
int  sizeZ 
)

Constructor to specify grid dimensions.

Parameters
[in]sizeXGrid size in x-dimension
[in]sizeYGrid size in y-dimension
[in]sizeZGrid size in z-dimension

Definition at line 22 of file Grid_def.h.

template<typename T, int Cellsize>
Grid< T, Cellsize >::Grid ( int  sizeX,
int  sizeY,
int  sizeZ,
val 
)

Constructor to specify grid dimensions and initialization value.

Parameters
[in]sizeXGrid size in x-dimension
[in]sizeYGrid size in y-dimension
[in]sizeZGrid size in z-dimension
[in]valInitial value for all cell variables

Definition at line 30 of file Grid_def.h.

template<typename T , int Cellsize>
Grid< T, Cellsize >::~Grid ( )
virtual

Destructor.

Clears the vector of cell variables

Definition at line 38 of file Grid_def.h.

Member Function Documentation

template<typename T, int Cellsize>
int Grid< T, Cellsize >::getSizeX ( )
inline

Get size in x-dimension.

Returns
Grid size in x-dimension

Definition at line 82 of file Grid.h.

template<typename T, int Cellsize>
int Grid< T, Cellsize >::getSizeY ( )
inline

Get size in y-dimension.

Returns
Grid size in y-dimension

Definition at line 90 of file Grid.h.

template<typename T, int Cellsize>
int Grid< T, Cellsize >::getSizeZ ( )
inline

Get size in z-dimension.

Returns
Grid size in z-dimension

Definition at line 98 of file Grid.h.

template<typename T, int Cellsize>
void Grid< T, Cellsize >::init ( int  sizeX,
int  sizeY,
int  sizeZ,
val 
)

Initialize the grid with given dimensions and initial value.

Parameters
[in]sizeXGrid size in x-dimension
[in]sizeYGrid size in y-dimension
[in]sizeZGrid size in z-dimension
[in]valInitial value for all cell variables

Definition at line 50 of file Grid_def.h.

Referenced by lbm::LBM< T >::setup().

template<typename T, int Cellsize>
void Grid< T, Cellsize >::init ( val)

Initialize the grid with given initial value.

Parameters
[in]valInitial value for all cell variables

Definition at line 58 of file Grid_def.h.

template<typename T , int Cellsize>
T & Grid< T, Cellsize >::operator() ( int  x,
int  y,
int  z,
int  f 
)
inline

Get specified cell variable of specified cell.

Parameters
[in]xCell coordinate in x-dimension
[in]yCell coordinate in y-dimension
[in]zCell coordinate in z-dimension
[in]fCell variable index
Returns
Reference to specified cell variable of specified cell

Definition at line 67 of file Grid_def.h.

template<typename T , int Cellsize>
const T & Grid< T, Cellsize >::operator() ( int  x,
int  y,
int  z,
int  f 
) const
inline

Get specified const cell variable of specified cell.

Parameters
[in]xCell coordinate in x-dimension
[in]yCell coordinate in y-dimension
[in]zCell coordinate in z-dimension
[in]fCell variable index
Returns
Const reference to specified cell variable of specified cell

Definition at line 77 of file Grid_def.h.

Member Data Documentation

template<typename T, int Cellsize>
std::vector<T> Grid< T, Cellsize >::data_
protected

Linearized, 1-dimensional representation of the 3D data grid.

Definition at line 142 of file Grid.h.

Referenced by Grid< T, 1 >::init(), Grid< T, 1 >::operator()(), and Grid< T, 1 >::~Grid().

template<typename T, int Cellsize>
int Grid< T, Cellsize >::sizeX_
protected

Number of cells in x-dimension.

Definition at line 130 of file Grid.h.

Referenced by Grid< float, 3 >::getSizeX(), Grid< T, 1 >::getSizeX(), Grid< T, 1 >::init(), Grid< T, 1 >::operator()(), and Grid< T, 1 >::~Grid().

template<typename T, int Cellsize>
int Grid< T, Cellsize >::sizeY_
protected

Number of cells in y-dimension.

Definition at line 134 of file Grid.h.

Referenced by Grid< float, 3 >::getSizeY(), Grid< T, 1 >::getSizeY(), Grid< T, 1 >::init(), Grid< T, 1 >::operator()(), and Grid< T, 1 >::~Grid().

template<typename T, int Cellsize>
int Grid< T, Cellsize >::sizeZ_
protected

Number of cells in z-dimension.

Definition at line 138 of file Grid.h.

Referenced by Grid< float, 3 >::getSizeZ(), Grid< T, 1 >::getSizeZ(), Grid< T, 1 >::init(), Grid< T, 1 >::operator()(), and Grid< T, 1 >::~Grid().


The documentation for this class was generated from the following files: