lbm_reference
|
3-dimensional grid of cells with template type, specialization to a single cell variable More...
#include <Grid.h>
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... | |
3-dimensional grid of cells with template type, specialization to a single cell variable
T | Type of cell variables |
Default constructor.
Creates a grid with zero cells in each dimension
Definition at line 93 of file Grid_def.h.
Constructor to specify grid dimensions.
[in] | sizeX | Grid size in x-dimension |
[in] | sizeY | Grid size in y-dimension |
[in] | sizeZ | Grid size in z-dimension |
Definition at line 98 of file Grid_def.h.
Constructor to specify grid dimensions and initialization value.
[in] | sizeX | Grid size in x-dimension |
[in] | sizeY | Grid size in y-dimension |
[in] | sizeZ | Grid size in z-dimension |
[in] | val | Initial value for cells |
Definition at line 106 of file Grid_def.h.
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_.
|
inline |
Get size in x-dimension.
Definition at line 217 of file Grid.h.
References Grid< T, Cellsize >::sizeX_.
|
inline |
Get size in y-dimension.
Definition at line 225 of file Grid.h.
References Grid< T, Cellsize >::sizeY_.
|
inline |
Get size in z-dimension.
Definition at line 233 of file Grid.h.
References Grid< T, Cellsize >::sizeZ_.
void Grid< T, 1 >::init | ( | int | sizeX, |
int | sizeY, | ||
int | sizeZ, | ||
T | val | ||
) |
Initialize the grid with given dimensions and initial value.
[in] | sizeX | Grid size in x-dimension |
[in] | sizeY | Grid size in y-dimension |
[in] | sizeZ | Grid size in z-dimension |
[in] | val | Initial 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_.
void Grid< T, 1 >::init | ( | T | val | ) |
Initialize the grid with given initial value.
[in] | val | Initial 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_.
|
inline |
Get cell variable of specified cell.
[in] | x | Cell coordinate in x-dimension |
[in] | y | Cell coordinate in y-dimension |
[in] | z | Cell coordinate in z-dimension |
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_.
|
inline |
Get specified constant cell variable of specified cell.
[in] | x | Cell coordinate in x-dimension |
[in] | y | Cell coordinate in y-dimension |
[in] | z | Cell coordinate in z-dimension |
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_.
|
protected |
|
protected |
|
protected |
|
protected |