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

3-dimensional grid of cells with template type, specialization to a single cell variable More...

#include <Grid.h>

+ Collaboration diagram for Grid< T, 1 >:

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)
 Get cell variable of specified cell. More...
 
const T & operator() (int x, int y, int z) const
 Get specified constant 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>
class Grid< T, 1 >

3-dimensional grid of cells with template type, specialization to a single cell variable

Template Parameters
TType of cell variables

Definition at line 153 of file Grid.h.

Constructor & Destructor Documentation

template<typename T >
Grid< T, 1 >::Grid ( )

Default constructor.

Creates a grid with zero cells in each dimension

Definition at line 93 of file Grid_def.h.

template<typename T >
Grid< T, 1 >::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 98 of file Grid_def.h.

template<typename T >
Grid< T, 1 >::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 cells

Definition at line 106 of file Grid_def.h.

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

Destructor.

Clears the vector of cell variables

Definition at line 114 of file Grid_def.h.

References Grid< T, Cellsize >::data_, Grid< T, Cellsize >::sizeX_, Grid< T, Cellsize >::sizeY_, and Grid< T, Cellsize >::sizeZ_.

Member Function Documentation

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

Get size in x-dimension.

Returns
Grid size in x-dimension

Definition at line 217 of file Grid.h.

References Grid< T, Cellsize >::sizeX_.

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

Get size in y-dimension.

Returns
Grid size in y-dimension

Definition at line 225 of file Grid.h.

References Grid< T, Cellsize >::sizeY_.

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

Get size in z-dimension.

Returns
Grid size in z-dimension

Definition at line 233 of file Grid.h.

References Grid< T, Cellsize >::sizeZ_.

template<typename T >
void Grid< T, 1 >::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 cells

Definition at line 126 of file Grid_def.h.

References Grid< T, Cellsize >::data_, Grid< T, Cellsize >::sizeX_, Grid< T, Cellsize >::sizeY_, and Grid< T, Cellsize >::sizeZ_.

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

Initialize the grid with given initial value.

Parameters
[in]valInitial value for cells

Definition at line 134 of file Grid_def.h.

References Grid< T, Cellsize >::data_, Grid< T, Cellsize >::sizeX_, Grid< T, Cellsize >::sizeY_, and Grid< T, Cellsize >::sizeZ_.

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

Get cell variable of specified cell.

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

Definition at line 143 of file Grid_def.h.

References Grid< T, Cellsize >::data_, Grid< T, Cellsize >::sizeX_, Grid< T, Cellsize >::sizeY_, and Grid< T, Cellsize >::sizeZ_.

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

Get specified constant cell variable of specified cell.

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

Definition at line 152 of file Grid_def.h.

References Grid< T, Cellsize >::data_, Grid< T, Cellsize >::sizeX_, Grid< T, Cellsize >::sizeY_, and Grid< T, Cellsize >::sizeZ_.

Member Data Documentation

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

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

Definition at line 271 of file Grid.h.

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

Number of cells in x-dimension.

Definition at line 259 of file Grid.h.

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

Number of cells in y-dimension.

Definition at line 263 of file Grid.h.

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

Number of cells in z-dimension.

Definition at line 267 of file Grid.h.


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