/home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/physics/interpolation/linear_interpolator_3d.hh Source File#
|
DiFfRG
|
linear_interpolator_3d.hh
Go to the documentation of this file.
16 template <typename NT, typename Coordinates, typename DefaultMemorySpace = CPU_memory> class LinearInterpolator3D
34 : coordinates(coordinates), sizes(coordinates.sizes()), total_size(sizes[0] * sizes[1] * sizes[2])
103 idx_x = max(static_cast<decltype(idx_x)>(0), min(idx_x, static_cast<decltype(idx_x)>(sizes[0] - 1)));
104 idx_y = max(static_cast<decltype(idx_y)>(0), min(idx_y, static_cast<decltype(idx_y)>(sizes[1] - 1)));
105 idx_z = max(static_cast<decltype(idx_z)>(0), min(idx_z, static_cast<decltype(idx_z)>(sizes[2] - 1)));
A linear interpolator for 3D data, both on GPU and CPU.
Definition linear_interpolator_3d.hh:17
KOKKOS_FUNCTION LinearInterpolator3D(const LinearInterpolator3D &other)
Definition linear_interpolator_3d.hh:43
DefaultMemorySpace memory_space
Definition linear_interpolator_3d.hh:21
const size_t total_size
Definition linear_interpolator_3d.hh:191
void update(const View &view)
Definition linear_interpolator_3d.hh:70
const Coordinates coordinates
Definition linear_interpolator_3d.hh:189
ViewType device_data
Definition linear_interpolator_3d.hh:196
Kokkos::View< NT ***, DefaultMemorySpace, Kokkos::MemoryTraits< Kokkos::RandomAccess > > ViewType
Definition linear_interpolator_3d.hh:193
typename ViewType::host_mirror_type HostViewType
Definition linear_interpolator_3d.hh:194
other_memory_space_t< DefaultMemorySpace > other_memory_space
Definition linear_interpolator_3d.hh:22
HostViewType host_data
Definition linear_interpolator_3d.hh:197
LinearInterpolator3D(const Coordinates &coordinates)
Construct a LinearInterpolator3D with internal, zeroed data and a coordinate system.
Definition linear_interpolator_3d.hh:33
NT operator[](size_t i) const
Definition linear_interpolator_3d.hh:83
void update(const NT2 *in_data)
Definition linear_interpolator_3d.hh:55
typename Coordinates::ctype ctype
Definition linear_interpolator_3d.hh:23
KOKKOS_FUNCTION ~LinearInterpolator3D()
Definition linear_interpolator_3d.hh:50
NT KOKKOS_FUNCTION operator()(const ctype &x, const ctype &y, const ctype &z) const
Interpolate the data at a given point.
Definition linear_interpolator_3d.hh:99
LinearInterpolator3D< NT, Coordinates, other_memory_space > * other_instance
Definition linear_interpolator_3d.hh:199
const device::array< size_t, 3 > sizes
Definition linear_interpolator_3d.hh:190
bool owns_other_instance
Definition linear_interpolator_3d.hh:200
const Coordinates & get_coordinates() const
Get the coordinate system of the data.
Definition linear_interpolator_3d.hh:175
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