/home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/physics/interpolation/spline_interpolator_1d.hh Source File#
|
DiFfRG
|
spline_interpolator_1d.hh
Go to the documentation of this file.
16 template <typename NT, typename Coordinates, typename DefaultMemorySpace = CPU_memory> class SplineInterpolator1D
32 SplineInterpolator1D(const Coordinates &coordinates) : coordinates(coordinates), size(coordinates.size())
47 SplineInterpolator1D(const SplineInterpolator1D &other) : coordinates(other.coordinates), size(other.size)
54 KOKKOS_FUNCTION ~SplineInterpolator1D() { KOKKOS_IF_ON_HOST((if (owns_other_instance) delete other_instance;)) }
121 idx = Kokkos::max(static_cast<decltype(idx)>(0), Kokkos::min(idx, static_cast<decltype(idx)>(size - 1)));
192 using ValueViewType = Kokkos::View<NT *, DefaultMemorySpace, Kokkos::MemoryTraits<Kokkos::RandomAccess>>;
193 using CoeffViewType = Kokkos::View<NT *, DefaultMemorySpace, Kokkos::MemoryTraits<Kokkos::RandomAccess>>;
A spline interpolator for 1D data, both on GPU and CPU.
Definition spline_interpolator_1d.hh:17
other_memory_space_t< DefaultMemorySpace > other_memory_space
Definition spline_interpolator_1d.hh:22
SplineInterpolator1D(const Coordinates &coordinates)
Construct a SplineInterpolator1D with internal, zeroed data and a coordinate system.
Definition spline_interpolator_1d.hh:32
NT KOKKOS_FUNCTION operator()(const typename Coordinates::ctype x) const
Interpolate the data at a given point.
Definition spline_interpolator_1d.hh:117
CoeffViewType device_coeffs
Definition spline_interpolator_1d.hh:198
void update(const NT2 *in_data, const ctype lower_y1=std::numeric_limits< ctype >::max(), const ctype upper_y1=std::numeric_limits< ctype >::max())
Definition spline_interpolator_1d.hh:57
KOKKOS_FUNCTION SplineInterpolator1D(const SplineInterpolator1D &other)
Copy constructor for SplineInterpolator1D. This is ONLY for usage inside Kokkos parallel loops.
Definition spline_interpolator_1d.hh:47
void update(const View &view, const ctype lower_y1=std::numeric_limits< ctype >::max(), const ctype upper_y1=std::numeric_limits< ctype >::max())
Definition spline_interpolator_1d.hh:80
void build_y2(const ctype lower_y1, const ctype upper_y1)
Definition spline_interpolator_1d.hh:205
HostCoeffViewType host_coeffs
Definition spline_interpolator_1d.hh:200
typename Coordinates::ctype ctype
Definition spline_interpolator_1d.hh:23
DefaultMemorySpace memory_space
Definition spline_interpolator_1d.hh:21
KOKKOS_FUNCTION ~SplineInterpolator1D()
Definition spline_interpolator_1d.hh:54
NT operator[](size_t i) const
Definition spline_interpolator_1d.hh:100
typename ValueViewType::host_mirror_type HostValueViewType
Definition spline_interpolator_1d.hh:194
SplineInterpolator1D< NT, Coordinates, other_memory_space > * other_instance
Definition spline_interpolator_1d.hh:202
ValueViewType device_values
Definition spline_interpolator_1d.hh:197
const Coordinates & get_coordinates() const
Get the coordinate system of the data.
Definition spline_interpolator_1d.hh:175
Kokkos::View< NT *, DefaultMemorySpace, Kokkos::MemoryTraits< Kokkos::RandomAccess > > CoeffViewType
Definition spline_interpolator_1d.hh:193
typename CoeffViewType::host_mirror_type HostCoeffViewType
Definition spline_interpolator_1d.hh:195
const Coordinates coordinates
Definition spline_interpolator_1d.hh:189
HostValueViewType host_values
Definition spline_interpolator_1d.hh:199
bool owns_other_instance
Definition spline_interpolator_1d.hh:203
Kokkos::View< NT *, DefaultMemorySpace, Kokkos::MemoryTraits< Kokkos::RandomAccess > > ValueViewType
Definition spline_interpolator_1d.hh:192
Definition complex_math.hh:10
std::conditional_t< std::is_same_v< MemorySpace, GPU_memory >, CPU_memory, GPU_memory > other_memory_space_t
Definition kokkos.hh:58
Generated by