/home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/physics/interpolation/spline_interpolator_1d_stack.hh Source File#
|
DiFfRG
Discretization Framework for functional Renormalization Group flows
|
spline_interpolator_1d_stack.hh
Go to the documentation of this file.
23 // The spline coefficients come from a non-cyclic tridiagonal solve with boundary conditions at the grid edges,
29 using ValueViewType = Kokkos::View<NT **, GPU_memory, Kokkos::MemoryTraits<Kokkos::RandomAccess>>;
49 device_values("SplineInterpolator1DStack_values", coordinates.sizes()[0], coordinates.sizes()[1]),
50 device_coeffs("SplineInterpolator1DStack_coeffs", coordinates.sizes()[0], coordinates.sizes()[1]),
57 KOKKOS_DEFAULTED_FUNCTION SplineInterpolator1DStack(const SplineInterpolator1DStack &) = default;
126 xidx = Kokkos::max(static_cast<decltype(xidx)>(0), Kokkos::min(xidx, static_cast<decltype(xidx)>(sizes[1] - 1)));
128 Kokkos::max(static_cast<decltype(_sidx)>(0), Kokkos::min(_sidx, static_cast<decltype(_sidx)>(sizes[0] - 1)));
216 u[i] = (host_values(sidx, i + 1) - host_values(sidx, i)) - (host_values(sidx, i) - host_values(sidx, i - 1));
A stack of 1D splines, callable from host AND device code.
Definition spline_interpolator_1d_stack.hh:21
NT KOKKOS_FUNCTION operator()(const typename Coordinates::ctype s, const typename Coordinates::ctype x) const
Interpolate the data at a given point.
Definition spline_interpolator_1d_stack.hh:155
HostCoeffViewType host_coeffs
Definition spline_interpolator_1d_stack.hh:197
typename CoeffViewType::host_mirror_type HostCoeffViewType
Definition spline_interpolator_1d_stack.hh:32
ValueViewType device_values
Definition spline_interpolator_1d_stack.hh:194
const device::array< size_t, 2 > sizes
Definition spline_interpolator_1d_stack.hh:192
typename Coordinates::ctype ctype
Definition spline_interpolator_1d_stack.hh:38
NT value_type
Definition spline_interpolator_1d_stack.hh:39
const Coordinates & get_coordinates() const
Get the coordinate system of the data.
Definition spline_interpolator_1d_stack.hh:166
ValueViewType CoeffViewType
Definition spline_interpolator_1d_stack.hh:30
static constexpr bool has_separate_device
Definition spline_interpolator_1d_stack.hh:34
SplineInterpolator1DStack(const Coordinates &coordinates)
Construct a SplineInterpolator1DStack with zeroed data and a coordinate system.
Definition spline_interpolator_1d_stack.hh:47
const Coordinates coordinates
Definition spline_interpolator_1d_stack.hh:191
KOKKOS_FORCEINLINE_FUNCTION NT coeff(const size_t i, const size_t j) const
Read one spline coefficient from whichever buffer belongs to the executing side.
Definition spline_interpolator_1d_stack.hh:185
static constexpr size_t dim
Definition spline_interpolator_1d_stack.hh:40
HostValueViewType host_values
Definition spline_interpolator_1d_stack.hh:196
const NT * data() const
Read-only handle to the host values, in the mirror's storage order.
Definition spline_interpolator_1d_stack.hh:174
Kokkos::View< NT **, GPU_memory, Kokkos::MemoryTraits< Kokkos::RandomAccess > > ValueViewType
Definition spline_interpolator_1d_stack.hh:29
void build_y2(const size_t sidx, const ctype lower_y1, const ctype upper_y1)
Definition spline_interpolator_1d_stack.hh:199
CoeffViewType device_coeffs
Definition spline_interpolator_1d_stack.hh:195
void update(const NT2 *in_data, const ctype lower_y1=std::numeric_limits< ctype >::max(), const ctype upper_y1=std::numeric_limits< ctype >::max())
Replace the data, leaving host AND device current. The only mutator.
Definition spline_interpolator_1d_stack.hh:67
NT operator[](size_t i) const
Host-side element access, in the row-major order update() takes its input in.
Definition spline_interpolator_1d_stack.hh:90
KOKKOS_DEFAULTED_FUNCTION SplineInterpolator1DStack(const SplineInterpolator1DStack &)=default
Shallow copy of ALL views, valid in host and in device code. See LinearInterpolator1D.
NT KOKKOS_FUNCTION at(const device::array< typename Coordinates::ctype, 2 > &raw) const
Interpolate at grid indices previously obtained from index().
Definition spline_interpolator_1d_stack.hh:121
typename ValueViewType::host_mirror_type HostValueViewType
Definition spline_interpolator_1d_stack.hh:31
device::array< typename Coordinates::ctype, 2 > KOKKOS_FUNCTION index(const typename Coordinates::ctype s, const typename Coordinates::ctype x) const
Map physical coordinates onto grid indices.
Definition spline_interpolator_1d_stack.hh:110
KOKKOS_FORCEINLINE_FUNCTION NT value(const size_t i, const size_t j) const
Read one value from whichever buffer belongs to the executing side.
Definition spline_interpolator_1d_stack.hh:178
Definition complex_math.hh:10
constexpr bool is_periodic_axis_v
Whether axis i of a (possibly multi-dimensional) coordinate system is periodic. Falls back to false f...
Definition coordinates.hh:59
Definition kokkos.hh:538
Generated by