Describes the 2D grid layout for a linearized data column. More...
#include <lookup_table_2d_reader.hpp>
Public Attributes | |
| int | nx |
| Number of grid points along x. | |
| int | ny |
| Number of grid points along y. | |
| double | x_min |
| x coordinate of the first (ix=0) grid point | |
| double | y_min |
| y coordinate of the first (iy=0) grid point | |
| double | dx |
| Grid spacing along x (must be > 0) | |
| double | dy |
| Grid spacing along y (must be > 0) | |
| int | stride_x |
| Flat-index step when ix increases by 1 (see above) | |
| int | stride_y |
| Flat-index step when iy increases by 1 (see above) | |
Describes the 2D grid layout for a linearized data column.
A single column in a data file contains nx * ny scalar values (one value per data row), representing a 2D grid where
nx equally-spaced points: x_min, x_min+dx, ..., x_min+(nx-1)*dxny equally-spaced points: y_min, y_min+dy, ..., y_min+(ny-1)*dyThe flat file index k (0-based, counting only non-comment data rows) maps to the grid index pair (ix, iy) via
Exactly one of stride_x / stride_y must be 1 (the "fast" / innermost dimension); the other equals the size of that fast dimension.
Two common configurations (and their correct stride settings):
Suppose the grid maps pressure (x, 2 points) × temperature (y, 3 points) to density. The data author loops over pressure in the outer loop:
For the density column (index 2): nx=2, ny=3. k = ix*3 + iy*1 → stride_x=3 (=ny), stride_y=1
Same grid, but the data author loops over temperature in the outer loop:
For the density column (index 2): nx=2, ny=3. k = ix*1 + iy*2 → stride_x=1, stride_y=2 (=nx)
Both layouts produce the same ScalarLookupTable2D and the same interpolated values — only the file row order differs.
| double terra::io::GridLayout2D::dx |
Grid spacing along x (must be > 0)
| double terra::io::GridLayout2D::dy |
Grid spacing along y (must be > 0)
| int terra::io::GridLayout2D::nx |
Number of grid points along x.
| int terra::io::GridLayout2D::ny |
Number of grid points along y.
| int terra::io::GridLayout2D::stride_x |
Flat-index step when ix increases by 1 (see above)
| int terra::io::GridLayout2D::stride_y |
Flat-index step when iy increases by 1 (see above)
| double terra::io::GridLayout2D::x_min |
x coordinate of the first (ix=0) grid point
| double terra::io::GridLayout2D::y_min |
y coordinate of the first (iy=0) grid point