|
|
| UniformGrid3 ()=default |
| | An empty grid; Contains() is false everywhere.
|
| |
| | UniformGrid3 (const double lower[3], const double spacing[3], const int numCells[3], const T &initial=T {}) |
| |
|
int | NumCells (int axis) const |
| | Number of cells along axis.
|
| |
|
double | Spacing (int axis) const |
| | Node spacing along axis.
|
| |
|
double | NodeCoordinate (int axis, int index) const |
| | Coordinate of node index along axis.
|
| |
|
T & | At (int i, int j, int k) |
| | Value at node (i, j, k); no bounds check.
|
| |
|
const T & | At (int i, int j, int k) const |
| | Value at node (i, j, k); no bounds check.
|
| |
| bool | Contains (const double pos[3]) const |
| |
| bool | Interpolate (const double pos[3], T &out) const |
| |
template<class T>
class marenv::grid::UniformGrid3< T >
Values at the nodes of an axis-aligned uniform 3D grid, read back by trilinear interpolation.
The grid spans the box [lower[a], lower[a] + numCells[a] * spacing[a]] along each axis a and holds numCells[a] + 1 nodes along it. Coordinates are those of whatever frame the caller works in; the grid knows no world frame.
Generalised from the trilinear code of marenv::current::CurrentField3DArray, which keeps its own copy (its depth layers are not uniformly spaced).
- Template Parameters
-
| T | Node value type; needs T{} as zero, T + T and double * T. |