Template Class Grid
Defined in File Grid.h
Inheritance Relationships
Base Type
public Referenced
Class Documentation
-
template<typename T>
class Grid : public Referenced Template class for fields on a periodic grid with trilinear interpolation.
The grid spacing is constant with diffrent resolution 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.
Public Functions
-
inline Grid(Vector3d origin, size_t N, double spacing)
Constructor for cubic grid
- Parameters:
origin – Position of the lower left front corner of the volume
N – Number of grid points in one direction
spacing – Spacing between grid points
-
inline 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 volume
Nx – Number of grid points in x-direction
Ny – Number of grid points in y-direction
Nz – Number of grid points in z-direction
spacing – Spacing between grid points
-
inline 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 volume
Nx – Number of grid points in x-direction
Ny – Number of grid points in y-direction
Nz – Number of grid points in z-direction
spacing – Spacing vector between grid points
-
inline Grid(const GridProperties &p)
Constructor for GridProperties
- Parameters:
p – GridProperties instance
-
inline void setGridSize(size_t Nx, size_t Ny, size_t Nz)
Resize grid, also enlarges the volume as the spacing stays constant
-
inline void setReflective(bool b)
-
inline void setClipVolume(bool b)
-
inline void setInterpolationType(interpolationType ipolType)
Change the interpolation type to the routine specified by the user. Check if this routine is contained in the enum interpolationType and thus supported by CRPropa.
-
inline interpolationType getInterpolationType()
-
inline std::string getInterpolationTypeName()
-
inline Vector3d getOrigin() const
returns the position of the lower left front corner of the volume
-
inline bool getClipVolume() const
-
inline size_t getNx() const
-
inline size_t getNy() const
-
inline size_t getNz() const
-
inline size_t getSizeOf() const
Calculates the total size of the grid in bytes
-
inline bool isReflective() const
-
inline Grid(Vector3d origin, size_t N, double spacing)