7 #ifndef PARTICLESCRAPER_H_ 8 #define PARTICLESCRAPER_H_ 23 #include <type_traits> 112 scrapeParticles(pc, distance_to_eb, 0, pc.finestLevel(), std::forward<F>(f));
156 int lev_min,
int lev_max, F&& f)
160 for (
int lev = lev_min; lev <= lev_max; ++lev)
162 const auto plo = pc.Geom(lev).ProbLoArray();
163 const auto dxi = pc.Geom(lev).InvCellSizeArray();
167 auto& tile = pti.GetParticleTile();
168 auto ptd = tile.getParticleTileData();
169 const auto np = tile.numParticles();
171 auto phi = (*distance_to_eb[lev])[pti].array();
176 if (particles[ip].
id() < 0)
return;
178 amrex::ParticleReal xp, yp, zp;
179 getPosition(ip, xp, yp, zp);
182 amrex::Real W[AMREX_SPACEDIM][2];
189 amrex::RealVect normal = DistanceToEB::interp_normal(i, j, k, W, phi, dxi);
193 #if (defined WARPX_DIM_3D) 194 pos[0] = xp - normal[0]*phi_value;
195 pos[1] = yp - normal[1]*phi_value;
196 pos[2] = zp - normal[2]*phi_value;
197 #elif (defined WARPX_DIM_XZ) 198 pos[0] = xp - normal[0]*phi_value;
199 pos[1] = zp - normal[1]*phi_value;
200 #elif (defined WARPX_DIM_RZ) 201 pos[0] = std::sqrt(xp*xp + yp*yp) - normal[0]*phi_value;
202 pos[1] = zp - normal[1]*phi_value;
203 #elif (defined WARPX_DIM_1D_Z) 204 pos[0] = zp - normal[0]*phi_value;
206 DistanceToEB::normalize(normal);
208 f(ptd, ip, pos, normal, engine);
data
Definition: run_alltests_1node.py:325
void scrapeParticles(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:67
i
Definition: check_interp_points_and_weights.py:174
void ParallelForRNG(T n, L &&f) noexcept
AMREX_GPU_HOST_DEVICE AMREX_INLINE void compute_weights_nodal(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]) noexcept
Compute weight of each surrounding node in interpolating a nodal field to the given coordinates...
Definition: NodalFieldGather.H:32
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:92
Functor that can be used to extract the positions of the macroparticles inside a ParallelFor kernel...
Definition: GetAndSetPosition.H:52
Definition: WarpXParticleContainer.H:49
bool isValid() const noexcept
value
Definition: updateAMReX.py:141