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];
192 [[maybe_unused]]
int nodal;
193 amrex::Real Wc[AMREX_SPACEDIM][2];
195 amrex::RealVect normal = DistanceToEB::interp_normal(
i, j, k, W, ic, jc, kc, Wc, phi, dxi);
196 DistanceToEB::normalize(normal);
198 #if (defined WARPX_DIM_3D)
202 #elif (defined WARPX_DIM_XZ)
205 #elif (defined WARPX_DIM_RZ)
206 pos[0] = std::sqrt(xp*xp + yp*yp);
208 #elif (defined WARPX_DIM_1D_Z)
211 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:99
AMREX_GPU_HOST_DEVICE AMREX_INLINE void compute_weights(const amrex::ParticleReal xp, const amrex::ParticleReal yp, const amrex::ParticleReal zp, amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > const &plo, amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > const &dxi, int &i, int &j, int &k, amrex::Real W[AMREX_SPACEDIM][2], int nodal=1) noexcept
Compute weight of each surrounding node (or cell-centered nodes) in interpolating a nodal ((or a cell...
Definition: NodalFieldGather.H:34
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