diff options
author | 2020-07-29 06:23:57 +0200 | |
---|---|---|
committer | 2020-07-28 21:23:57 -0700 | |
commit | be7ccae324cb3c6dbfa266fad975b4077f563c3e (patch) | |
tree | a22414384ddfb085fa1d24a354070c2e1d1498f5 /Source/Particles/PhotonParticleContainer.cpp | |
parent | 8dcb939c78a7a1aaadaca4f948c16ee83d3040eb (diff) | |
download | WarpX-be7ccae324cb3c6dbfa266fad975b4077f563c3e.tar.gz WarpX-be7ccae324cb3c6dbfa266fad975b4077f563c3e.tar.zst WarpX-be7ccae324cb3c6dbfa266fad975b4077f563c3e.zip |
[tiny] Avoid particles with do_not_gather=1 be pushed in the last half step (#1210)
* species with do_not_gather=1 are not anymore pushed in the last halft step
* now do_not_gather is used just to avoid doing doGatherShapeN
* Minor fix
* fix involuntary capture of *this in lambda
Diffstat (limited to 'Source/Particles/PhotonParticleContainer.cpp')
-rw-r--r-- | Source/Particles/PhotonParticleContainer.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Source/Particles/PhotonParticleContainer.cpp b/Source/Particles/PhotonParticleContainer.cpp index ff1107eea..dd1120118 100644 --- a/Source/Particles/PhotonParticleContainer.cpp +++ b/Source/Particles/PhotonParticleContainer.cpp @@ -155,6 +155,8 @@ PhotonParticleContainer::PushPX (WarpXParIter& pti, amrex::IndexType const by_type = byfab->box().ixType(); amrex::IndexType const bz_type = bzfab->box().ixType(); + const auto t_do_not_gather = do_not_gather; + amrex::ParallelFor( np_to_push, [=] AMREX_GPU_DEVICE (long i) { @@ -168,12 +170,14 @@ PhotonParticleContainer::PushPX (WarpXParIter& pti, amrex::ParticleReal Bxp, Byp, Bzp; getExternalB(i, Bxp, Byp, Bzp); - // first gather E and B to the particle positions - doGatherShapeN(x, y, z, Exp, Eyp, Ezp, Bxp, Byp, Bzp, - ex_arr, ey_arr, ez_arr, bx_arr, by_arr, bz_arr, - ex_type, ey_type, ez_type, bx_type, by_type, bz_type, - dx_arr, xyzmin_arr, lo, n_rz_azimuthal_modes, - nox, l_lower_order_in_v); + if(!t_do_not_gather){ + // first gather E and B to the particle positions + doGatherShapeN(x, y, z, Exp, Eyp, Ezp, Bxp, Byp, Bzp, + ex_arr, ey_arr, ez_arr, bx_arr, by_arr, bz_arr, + ex_type, ey_type, ez_type, bx_type, by_type, bz_type, + dx_arr, xyzmin_arr, lo, n_rz_azimuthal_modes, + nox, l_lower_order_in_v); + } #ifdef WARPX_QED if (local_has_breit_wheeler) { |