Template Class CompactCubicSplineInterpolator
Defined in File spline_interpolator.hpp
Inheritance Relationships
Base Type
public pcms::CubicSplineInterpolator< T, MemorySpace >(Template Class CubicSplineInterpolator)
Class Documentation
-
template<typename T, typename MemorySpace>
class CompactCubicSplineInterpolator : public pcms::CubicSplineInterpolator<T, MemorySpace> CompactCubicSplineInterpolator class This class provides methods for 1d compact cubic spline interpolation. It inherits from ExplicitCubicSplineInterpolator and implements the compact representation of cubic spline coefficients.
The 1d compact cubic spline are evaluated using the following formula: If x(i).le.x.le.x(i+1), let h = (x(i+1)-x(i)) p = (x-x(i))/h q = 1-p s(x)= q*D(1,i) + p*D(1,i+1) + (h**2/6)*{[q**3-q]*D(2,i) + [p**3-p]*D(2,i+1)} where D(1,i) and D(2,i) are the coefficients of the compact cubic spline.
Public Types
-
using execution_space = typename MemorySpace::execution_space
-
using member_type = typename Kokkos::TeamPolicy<execution_space>::member_type
Public Functions
-
CompactCubicSplineInterpolator(Rank1View<T, MemorySpace> x, Rank1View<T, MemorySpace> values, BoundaryCondition ibcxmin, T bcxmin, BoundaryCondition ibcxmax, T bcxmax)
Construct the interpolator object and set up the coefficients.
- Parameters:
x – input grid points
values – values of given grid points
ibcxmin – bounday condition flag at x(0)
bcxmin – bounday condition data at x(0)
ibcxmax – bounday condition flag at x(-1)
bcxmax – bounday condition data at x(-1)
-
CompactCubicSplineInterpolator(Rank1View<T, MemorySpace> x, Rank1View<T, MemorySpace> values)
Construct the interpolator object and set up the coefficients with default boundary conditions.
- Parameters:
x – input grid points
values – values of given grid points
-
virtual void evaluate(Rank1View<T, MemorySpace> xvec, Rank2View<T, MemorySpace> fval) override
Evaluate the function value of compact cubic spline at given points.
- Parameters:
xvec – input points where the spline is evaluated
fval – output values of the spline at given points
-
virtual void evaluate(Kokkos::View<LO*, MemorySpace> selector, Rank1View<T, MemorySpace> xvec, Rank2View<T, MemorySpace> fval, T lookup_tol = 4.0e-7) override
Evaluate the compact cubic spline at given points with selector.
The selector follows the same rules as in ExplicitCubicSplineInterpolator.
- Parameters:
selector – selector array indicating which derivatives to compute
xvec – input points where the spline is evaluated
fval – output values of the spline at given points
lookup_tol – tolerance for the lookup
-
using execution_space = typename MemorySpace::execution_space