Device-capable 2D scalar lookup table with bilinear interpolation. More...
#include <lookup_table_2d_reader.hpp>
Public Types | |
| using | ViewType = Kokkos::View< ScalarType **, Kokkos::LayoutRight > |
Public Member Functions | |
| ScalarType | operator() (ScalarType x, ScalarType y) const |
| Bilinearly interpolated value at physical coordinates (x, y). | |
Public Attributes | |
| ViewType | data |
| 2D device view, indexed as data(ix, iy) | |
| ScalarType | x_min |
| x coordinate of grid point ix=0 | |
| ScalarType | y_min |
| y coordinate of grid point iy=0 | |
| ScalarType | dx |
| Spacing between grid points along x. | |
| ScalarType | dy |
| Spacing between grid points along y. | |
| int | nx |
| Number of grid points along x. | |
| int | ny |
| Number of grid points along y. | |
Device-capable 2D scalar lookup table with bilinear interpolation.
Holds a Kokkos::View with layout data(ix, iy) and scalar metadata that is trivially copyable to the device. All members are either arithmetic or Kokkos::View (which is itself device-copyable via a reference-counted handle), so the struct can be captured by value in a KOKKOS_LAMBDA.
Queries outside the table domain are clamped to the nearest boundary value; no extrapolation is performed.
| ScalarType | Floating-point type of the table values (typically double) |
| using terra::io::ScalarLookupTable2D< ScalarType >::ViewType = Kokkos::View< ScalarType**, Kokkos::LayoutRight > |
|
inline |
Bilinearly interpolated value at physical coordinates (x, y).
Queries outside [x_min, x_min+(nx-1)*dx] × [y_min, y_min+(ny-1)*dy] are clamped to the table boundary before interpolation.
| x | Physical x coordinate |
| y | Physical y coordinate |
| ViewType terra::io::ScalarLookupTable2D< ScalarType >::data |
2D device view, indexed as data(ix, iy)
| ScalarType terra::io::ScalarLookupTable2D< ScalarType >::dx |
Spacing between grid points along x.
| ScalarType terra::io::ScalarLookupTable2D< ScalarType >::dy |
Spacing between grid points along y.
| int terra::io::ScalarLookupTable2D< ScalarType >::nx |
Number of grid points along x.
| int terra::io::ScalarLookupTable2D< ScalarType >::ny |
Number of grid points along y.
| ScalarType terra::io::ScalarLookupTable2D< ScalarType >::x_min |
x coordinate of grid point ix=0
| ScalarType terra::io::ScalarLookupTable2D< ScalarType >::y_min |
y coordinate of grid point iy=0