Template Class Grid¶
- Defined in File Grid.h
Inheritance Relationships¶
Base Type¶
public Referenced
(Class Referenced)
Derived Types¶
public ScalarGrid
(Class ScalarGrid)public VectorGrid
(Class VectorGrid)
Class Documentation¶
-
template <typename T>
classGrid
: public Referenced¶ Template class for fields on a periodic grid with trilinear interpolation.
The grid spacing is constant with diffrent resulution along all three axes. Values are calculated by trilinear interpolation of the surrounding 8 grid points. The grid is periodically (default) or reflectively extended. The grid sample positions are at 1/2 * size/N, 3/2 * size/N … (2N-1)/2 * size/N.
Subclassed by ScalarGrid, VectorGrid
Public Functions
-
Grid
(Vector3d origin, size_t N, double spacing)¶ Constructor for cubic grid
- Parameters
origin
: Position of the lower left front corner of the volumeN
: Number of grid points in one directionspacing
: Spacing between grid points
-
Grid
(Vector3d origin, size_t Nx, size_t Ny, size_t Nz, double spacing)¶ Constructor for non-cubic grid
- Parameters
origin
: Position of the lower left front corner of the volumeNx
: Number of grid points in x-directionNy
: Number of grid points in y-directionNz
: Number of grid points in z-directionspacing
: Spacing between grid points
-
Grid
(Vector3d origin, size_t Nx, size_t Ny, size_t Nz, Vector3d spacing)¶ Constructor for non-cubic grid with spacing vector
- Parameters
origin
: Position of the lower left front corner of the volumeNx
: Number of grid points in x-directionNy
: Number of grid points in y-directionNz
: Number of grid points in z-directionspacing
: Spacing vector between grid points
-
Grid
(const GridProperties &p)¶ Constructor for GridProperties
- Parameters
p
: GridProperties instance
-
void
setGridSize
(size_t Nx, size_t Ny, size_t Nz)¶ Resize grid, also enlarges the volume as the spacing stays constant
-
void
setReflective
(bool b)¶
-
Vector3d
getOrigin
() const
-
size_t
getNx
() const¶
-
size_t
getNy
() const¶
-
size_t
getNz
() const¶
-
size_t
getSizeOf
() const¶ Calculates the total size of the grid in bytes
-
bool
isReflective
() const¶
-
T &
get
(size_t ix, size_t iy, size_t iz)¶ Inspector & Mutator
-
const T &
get
(size_t ix, size_t iy, size_t iz) const¶ Inspector
-
T
getValue
(size_t ix, size_t iy, size_t iz)¶
-
void
setValue
(size_t ix, size_t iy, size_t iz, T value)¶
-
std::vector<T> &
getGrid
()¶ Return a reference to the grid values
-
T
closestValue
(const Vector3d &position) const¶ Value of a grid point that is closest to a given position
-
size_t
addReference
() const
-
size_t
removeReference
() const
-
int
removeReferenceNoDelete
() const
-
size_t
getReferenceCount
() const
Protected Attributes
-
size_t
_referenceCount
-