Loading...
Searching...
No Matches
terra::io::ScalarLookupTable2D< ScalarType > Struct Template Reference

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.
 

Detailed Description

template<typename ScalarType>
struct terra::io::ScalarLookupTable2D< ScalarType >

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.

Template Parameters
ScalarTypeFloating-point type of the table values (typically double)

Member Typedef Documentation

◆ ViewType

template<typename ScalarType >
using terra::io::ScalarLookupTable2D< ScalarType >::ViewType = Kokkos::View< ScalarType**, Kokkos::LayoutRight >

Member Function Documentation

◆ operator()()

template<typename ScalarType >
ScalarType terra::io::ScalarLookupTable2D< ScalarType >::operator() ( ScalarType  x,
ScalarType  y 
) const
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.

Parameters
xPhysical x coordinate
yPhysical y coordinate
Returns
Interpolated (or clamped boundary) scalar value

Member Data Documentation

◆ data

template<typename ScalarType >
ViewType terra::io::ScalarLookupTable2D< ScalarType >::data

2D device view, indexed as data(ix, iy)

◆ dx

template<typename ScalarType >
ScalarType terra::io::ScalarLookupTable2D< ScalarType >::dx

Spacing between grid points along x.

◆ dy

template<typename ScalarType >
ScalarType terra::io::ScalarLookupTable2D< ScalarType >::dy

Spacing between grid points along y.

◆ nx

template<typename ScalarType >
int terra::io::ScalarLookupTable2D< ScalarType >::nx

Number of grid points along x.

◆ ny

template<typename ScalarType >
int terra::io::ScalarLookupTable2D< ScalarType >::ny

Number of grid points along y.

◆ x_min

template<typename ScalarType >
ScalarType terra::io::ScalarLookupTable2D< ScalarType >::x_min

x coordinate of grid point ix=0

◆ y_min

template<typename ScalarType >
ScalarType terra::io::ScalarLookupTable2D< ScalarType >::y_min

y coordinate of grid point iy=0


The documentation for this struct was generated from the following file: