Template Class CompactBiCubicSplineInterpolator

Inheritance Relationships

Base Type

Class Documentation

template<typename T, typename MemorySpace>
class CompactBiCubicSplineInterpolator : public pcms::BiCubicSplineInterpolator<T, MemorySpace>

CompactBiCubicSplineInterpolator class This class provides methods for 2D compact bicubic spline interpolation. It inherits from ExplicitBiCubicSplineInterpolator and implements the compact representation of bicubic spline coefficients.

The 2D compact bicubic spline are evaluated using the following formula: for x(i).le.x.le.x(i+1) and y(j).le.y.le.y(j+1), let hx = x(i+1)-x(i) hy = y(j+1)-y(j) px = (x-x(i))/hx py = (y-y(j))/hy qx = 1-px qy = 1-py rx = (px**3-px) ry = (py**3-py) sx = (qx**3-qx) sy = (qy**3-qy)

s(x,y) = qx*(qy*D(1,i,j)+py*D(1,i,j+1)) + px*(qy*D(1,i+1,j)+py*D(1,i+1,j+1)) + (hx**2/6)*{sx*(qy*D(2,i,j)+py*D(2,i,j+1)) + rx*(qy*D(2,i+1,j)+py*D(2,i+1,j+1))} + (hy**2/6)*{qx*(sy*D(3,i,j)+ry*D(3,i,j+1)) + px*(sy*D(3,i+1,j)+ry*D(3,i+1,j+1))} + (hx**2*hy**2/36)*{sx*(sy*D(4,i,j)+ry*D(4,i,j+1)) + rx*(sy*D(4,i+1,j)+ry*D(4,i+1,j+1))}

Public Types

using execution_space = typename MemorySpace::execution_space
using member_type = typename Kokkos::TeamPolicy<execution_space>::member_type

Public Functions

CompactBiCubicSplineInterpolator(Rank1View<T, MemorySpace> x, Rank1View<T, MemorySpace> y, Rank1View<T, MemorySpace> values, BoundaryCondition ibcxmin, Rank1View<T, MemorySpace> bcxmin, BoundaryCondition ibcxmax, Rank1View<T, MemorySpace> bcxmax, BoundaryCondition ibcymin, Rank1View<T, MemorySpace> bcymin, BoundaryCondition ibcymax, Rank1View<T, MemorySpace> bcymax)

Construct the interpolator object and set up the coefficients.

The boundary condition flags take the same values as in CubicSplineInterpolator at each direction.

Parameters:
  • x – input grid points in x direction

  • y – input grid points in y direction

  • values – values of given grid points

  • ibcxmin – boundary condition flag at x(0)

  • bcxmin – boundary condition data at x(0)

  • ibcxmax – boundary condition flag at x(-1)

  • bcxmax – boundary condition data at x(-1)

  • ibcymin – boundary condition flag at y(0)

  • bcymin – boundary condition data at y(0)

  • ibcymax – boundary condition flag at y(-1)

  • bcymax – boundary condition data at y(-1)

CompactBiCubicSplineInterpolator(Rank1View<T, MemorySpace> x, Rank1View<T, MemorySpace> y, Rank1View<T, MemorySpace> values)

Construct the interpolator object and set up the coefficients with default boundary conditions.

Parameters:
  • x – input grid points in x direction

  • y – input grid points in y direction

  • values – values of given grid points

virtual void evaluate(Rank1View<T, MemorySpace> xvec, Rank1View<T, MemorySpace> yvec, Rank2View<T, MemorySpace> fval) override

Evaluate the bicubic spline at given points.

Parameters:
  • xvec – input points in x direction where the spline is evaluated

  • yvec – input points in y direction where the spline is evaluated

  • fval – output values of the spline at given points

virtual void evaluate(Kokkos::View<LO*, MemorySpace> iselect, Rank1View<T, MemorySpace> xvec, Rank1View<T, MemorySpace> yvec, Rank2View<T, MemorySpace> fval, T lookup_tol = 4.0e-7) override

Evaluate the bicubic spline at given points with selector.

The selector follows the same rules as in ExplicitBiCubicSplineInterpolator.

Parameters:
  • iselect – selector array indicating which derivatives to compute

  • xvec – input points in x direction where the spline is evaluated

  • yvec – input points in y direction where the spline is evaluated

  • fval – output values of the spline at given points

  • lookup_tol – tolerance for locating the interval in the grid