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;
61 "peclet::core::interp::gather", Kokkos::RangePolicy<Exec>(0,
nParticles),
68 const long sx = 1,
sy = ex,
sz = (
long)ex * ey;
70 auto F = [&](
long o) {
return (
double)
field(b +
o); };
85template <
class PosView,
class QView,
class FieldView>
87 using Exec = Kokkos::DefaultExecutionSpace;
88 const int ex =
m.ex, ey =
m.ey, ez =
m.ez, g =
m.g;
89 const int nx = ex - 2 * g, ny = ey - 2 * g, nz = ez - 2 * g;
90 using T =
typename FieldView::value_type;
92 "peclet::core::interp::scatter", Kokkos::RangePolicy<Exec>(0,
nParticles),
99 const long sx = 1,
sy = ex,
sz = (
long)ex * ey;
102 const double w[2] = {1.0 -
wx,
wx},
wj[2] = {1.0 -
wy,
wy},
wk[2] = {1.0 -
wz,
wz};
103 for (
int dk = 0;
dk < 2; ++
dk)
104 for (
int dj = 0;
dj < 2; ++
dj)
105 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.