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;
61 "peclet::core::interp::gather", Kokkos::RangePolicy<Exec>(0, nParticles), KOKKOS_LAMBDA(
int p) {
67 const long sx = 1, sy = ex, sz = (long)ex * ey;
68 const long b = (long)(i0 + g) + (long)(j0 + g) * sy + (long)(k0 + g) * sz;
69 auto F = [&](
long o) {
return (
double)field(b + o); };
70 const double c00 = F(0) * (1 - wx) + F(sx) * wx;
71 const double c10 = F(sy) * (1 - wx) + F(sy + sx) * wx;
72 const double c01 = F(sz) * (1 - wx) + F(sz + sx) * wx;
73 const double c11 = F(sz + sy) * (1 - wx) + F(sz + sy + sx) * wx;
74 const double c0 = c00 * (1 - wy) + c10 * wy;
75 const double c1 = c01 * (1 - wy) + c11 * wy;
76 out(p) = c0 * (1 - wz) + c1 * wz;
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),
92 KOKKOS_LAMBDA(
int p) {
98 const long sx = 1, sy = ex, sz = (long)ex * ey;
99 const long b = (long)(i0 + g) + (long)(j0 + g) * sy + (long)(k0 + g) * sz;
100 const double qv = (double)q(p);
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) {
105 const long o = b + di * sx + dj * sy + dk * sz;
106 Kokkos::atomic_add(&field(o), (T)(qv * w[di] * wj[dj] * wk[dk]));