10 template <
unsigned long Po
int,
unsigned long Index,
typename Weights>
11 KOKKOS_INLINE_FUNCTION
constexpr typename Weights::value_type interpolationWeight(
12 const Weights& wlo,
const Weights& whi) {
13 if constexpr (Point & (1 << Index)) {
23 template <
unsigned long Po
int,
unsigned long Index,
typename Indices>
24 KOKKOS_INLINE_FUNCTION
constexpr typename Indices::value_type interpolationIndex(
25 const Indices& args) {
26 if constexpr (Point & (1 << Index)) {
27 return args[Index] - 1;
36 template <
unsigned long ScatterPoint,
unsigned long... Index,
typename View,
typename T,
38 KOKKOS_INLINE_FUNCTION
constexpr void scatterToPoint(
39 const std::index_sequence<Index...>&,
const View& view,
42 Kokkos::atomic_add(&view(interpolationIndex<ScatterPoint, Index>(args)...),
43 val * (interpolationWeight<ScatterPoint, Index>(wlo, whi) * ...));
46 template <
unsigned long... ScatterPoint,
typename View,
typename T,
typename IndexType>
47 KOKKOS_INLINE_FUNCTION
constexpr void scatterToField(
48 const std::index_sequence<ScatterPoint...>&,
const View& view,
52 (scatterToPoint<ScatterPoint>(std::make_index_sequence<View::rank>{}, view, wlo, whi,
57 template <
unsigned long GatherPoint,
unsigned long... Index,
typename View,
typename T,
59 KOKKOS_INLINE_FUNCTION
constexpr typename View::value_type gatherFromPoint(
60 const std::index_sequence<Index...>&,
const View& view,
63 return (interpolationWeight<GatherPoint, Index>(wlo, whi) * ...)
64 * view(interpolationIndex<GatherPoint, Index>(args)...);
67 template <
unsigned long... GatherPoint,
typename View,
typename T,
typename IndexType>
68 KOKKOS_INLINE_FUNCTION
constexpr typename View::value_type gatherFromField(
69 const std::index_sequence<GatherPoint...>&,
const View& view,
73 return (gatherFromPoint<GatherPoint>(std::make_index_sequence<View::rank>{}, view, wlo,