17#ifndef PECLET_CORE_INTERP_PARTICLE_GRID_HPP
18#define PECLET_CORE_INTERP_PARTICLE_GRID_HPP
20#include <Kokkos_Core.hpp>
38 const double si = (p - origin) *
inv - 0.5;
39 double fi = Kokkos::floor(
si);
55template <
class PosView,
class FieldView,
class OutView>
57 using Exec = Kokkos::DefaultExecutionSpace;
58 const int ex = m.
ex, ey = m.
ey, ez = m.
ez, g = m.
g;
59 const int nx = ex - 2 * g,
ny = ey - 2 * g,
nz = ez - 2 * g;
67 const long sx = 1,
sy = ex,
sz = (
long)ex * ey;
69 auto F = [&](
long o) {
return (
double)field(b +
o); };
84template <
class PosView,
class QView,
class FieldView>
86 using Exec = Kokkos::DefaultExecutionSpace;
87 const int ex = m.
ex, ey = m.
ey, ez = m.
ez, g = m.
g;
88 const int nx = ex - 2 * g,
ny = ey - 2 * g,
nz = ez - 2 * g;
89 using T =
typename FieldView::value_type;
91 "peclet::core::interp::scatter", Kokkos::RangePolicy<Exec>(0,
nParticles),
98 const long sx = 1,
sy = ex,
sz = (
long)ex * ey;
101 const double w[2] = {1.0 -
wx,
wx},
wj[2] = {1.0 -
wy,
wy},
wk[2] = {1.0 -
wz,
wz};
102 for (
int dk = 0;
dk < 2; ++
dk)
103 for (
int dj = 0;
dj < 2; ++
dj)
104 for (
int di = 0;
di < 2; ++
di) {
void axisStencil(double p, double origin, double inv, int nInner, int &i0, double &w)
void trilinearScatterAtomic(int nParticles, PosView pos, QView q, FieldView field, GridMap m)
void trilinearGather(int nParticles, PosView pos, FieldView field, OutView out, GridMap m)
Kokkos::View< T *, MemSpace > View
1D device array.