7 #ifndef WARPX_PARTICLESCRAPER_H_
8 #define WARPX_PARTICLESCRAPER_H_
24 #include <type_traits>
157 int lev_min,
int lev_max, F&& f)
161 for (
int lev = lev_min; lev <= lev_max; ++lev)
163 const auto plo = pc.Geom(lev).ProbLoArray();
164 const auto dxi = pc.Geom(lev).InvCellSizeArray();
166 #pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
171 auto& tile = pti.GetParticleTile();
172 auto ptd = tile.getParticleTileData();
173 const auto np = tile.numParticles();
174 auto phi = (*distance_to_eb[lev])[pti].array();
181 amrex::ParticleReal xp, yp, zp;
182 getPosition(ip, xp, yp, zp);
185 amrex::Real W[AMREX_SPACEDIM][2];
186 ablastr::particles::compute_weights<amrex::IndexType::NODE>(
187 xp, yp, zp, plo, dxi,
i, j, k, W);
193 amrex::Real Wc[AMREX_SPACEDIM][2];
194 ablastr::particles::compute_weights<amrex::IndexType::CELL>(
195 xp, yp, zp, plo, dxi, ic, jc, kc, Wc);
196 amrex::RealVect normal = DistanceToEB::interp_normal(
i, j, k, W, ic, jc, kc, Wc, phi, dxi);
197 DistanceToEB::normalize(normal);
199 #if (defined WARPX_DIM_3D)
203 #elif (defined WARPX_DIM_XZ)
206 #elif (defined WARPX_DIM_RZ)
207 pos[0] = std::sqrt(xp*xp + yp*yp);
209 #elif (defined WARPX_DIM_1D_Z)
212 f(ptd, ip, pos, normal, engine);
void scrapeParticlesAtEB(PC &pc, const amrex::Vector< const amrex::MultiFab * > &distance_to_eb, int lev, F &&f)
Interact particles with the embedded boundary walls.
Definition: ParticleScraper.H:68
Definition: WarpXParticleContainer.H:53
bool isValid() const noexcept
AMREX_GPU_HOST_DEVICE AMREX_INLINE amrex::Real interp_field_nodal(int i, int j, int k, const amrex::Real W[AMREX_SPACEDIM][2], amrex::Array4< const amrex::Real > const &scalar_field) noexcept
Interpolate nodal field value based on surrounding indices and weights.
Definition: NodalFieldGather.H:115
AMREX_ATTRIBUTE_FLATTEN_FOR void ParallelForRNG(T n, L const &f) noexcept
i
Definition: check_interp_points_and_weights.py:174
value
Definition: updateAMReX.py:141
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool is_valid() const noexcept