/home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/physics/interpolation/spline_interpolator_1d.hh Source File#
|
DiFfRG
Discretization Framework for functional Renormalization Group flows
|
spline_interpolator_1d.hh
Go to the documentation of this file.
28 // The spline coefficients come from a non-cyclic tridiagonal solve with boundary conditions at the grid edges,
34 using ValueViewType = Kokkos::View<NT *, GPU_memory, Kokkos::MemoryTraits<Kokkos::RandomAccess>>;
106 ctype KOKKOS_FUNCTION index(const typename Coordinates::ctype x) const { return coordinates.backward(x); }
146 NT KOKKOS_FUNCTION operator()(const typename Coordinates::ctype x) const { return at(index(x)); }
A spline interpolator for 1D data, callable from host AND device code.
Definition spline_interpolator_1d.hh:26
ctype KOKKOS_FUNCTION index(const typename Coordinates::ctype x) const
Map a physical coordinate onto the (clamped) grid index.
Definition spline_interpolator_1d.hh:106
HostValueViewType host_values
Definition spline_interpolator_1d.hh:183
ValueViewType CoeffViewType
Definition spline_interpolator_1d.hh:35
const Coordinates & get_coordinates() const
Get the coordinate system of the data.
Definition spline_interpolator_1d.hh:153
ValueViewType device_values
Definition spline_interpolator_1d.hh:181
typename CoeffViewType::host_mirror_type HostCoeffViewType
Definition spline_interpolator_1d.hh:37
NT KOKKOS_FUNCTION operator()(const typename Coordinates::ctype x) const
Interpolate the data at a given point.
Definition spline_interpolator_1d.hh:146
const NT * data() const
Read-only handle to the host values.
Definition spline_interpolator_1d.hh:161
HostCoeffViewType host_coeffs
Definition spline_interpolator_1d.hh:184
KOKKOS_DEFAULTED_FUNCTION SplineInterpolator1D(const SplineInterpolator1D &)=default
Shallow copy of ALL views, valid in host and in device code. See LinearInterpolator1D.
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.hh:71
KOKKOS_FORCEINLINE_FUNCTION NT value(const size_t i) const
Read one value from whichever buffer belongs to the executing side.
Definition spline_interpolator_1d.hh:165
typename Coordinates::ctype ctype
Definition spline_interpolator_1d.hh:43
const Coordinates coordinates
Definition spline_interpolator_1d.hh:178
KOKKOS_FORCEINLINE_FUNCTION NT coeff(const size_t i) const
Read one spline coefficient from whichever buffer belongs to the executing side.
Definition spline_interpolator_1d.hh:172
CoeffViewType device_coeffs
Definition spline_interpolator_1d.hh:182
typename ValueViewType::host_mirror_type HostValueViewType
Definition spline_interpolator_1d.hh:36
NT operator[](size_t i) const
Host-side element access. Always valid, including on a copy.
Definition spline_interpolator_1d.hh:92
Kokkos::View< NT *, GPU_memory, Kokkos::MemoryTraits< Kokkos::RandomAccess > > ValueViewType
Definition spline_interpolator_1d.hh:34
NT KOKKOS_FUNCTION at(const ctype raw_idx) const
Interpolate at a grid index previously obtained from index().
Definition spline_interpolator_1d.hh:116
void build_y2(const ctype lower_y1, const ctype upper_y1)
Definition spline_interpolator_1d.hh:186
SplineInterpolator1D(const Coordinates &coordinates)
Construct a SplineInterpolator1D with internal, zeroed data and a coordinate system.
Definition spline_interpolator_1d.hh:52
static constexpr bool has_separate_device
Definition spline_interpolator_1d.hh:39
Definition complex_math.hh:10
constexpr bool is_periodic_coordinate_v
Whether a 1D coordinate class describes a periodic axis, i.e. one where the last grid point is follow...
Definition coordinates.hh:43
Definition kokkos.hh:538
Generated by