aboutsummaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/Particles/PhotonParticleContainer.cpp16
-rw-r--r--Source/Particles/PhysicalParticleContainer.cpp35
2 files changed, 31 insertions, 20 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) {
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp
index 9511ab8f8..8c6959060 100644
--- a/Source/Particles/PhysicalParticleContainer.cpp
+++ b/Source/Particles/PhysicalParticleContainer.cpp
@@ -1474,6 +1474,8 @@ PhysicalParticleContainer::PushP (int lev, Real dt,
const auto pusher_algo = WarpX::particle_pusher_algo;
const auto do_crr = do_classical_radiation_reaction;
+ const auto t_do_not_gather = do_not_gather;
+
amrex::ParallelFor( np, [=] AMREX_GPU_DEVICE (long ip)
{
amrex::ParticleReal xp, yp, zp;
@@ -1485,12 +1487,14 @@ PhysicalParticleContainer::PushP (int lev, Real dt,
amrex::ParticleReal Bxp = 0._rt, Byp = 0._rt, Bzp = 0._rt;
getExternalB(ip, Bxp, Byp, Bzp);
- // first gather E and B to the particle positions
- doGatherShapeN(xp, yp, zp, 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(xp, yp, zp, 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 (do_crr) {
amrex::Real qp = q;
@@ -1760,8 +1764,7 @@ PhysicalParticleContainer::PushPX (WarpXParIter& pti,
(gather_lev==(lev )),
"Gather buffers only work for lev-1");
// If no particles, do not do anything
- // If do_not_gather = 1 by user, do not do anything
- if (np_to_push == 0 || do_not_gather) return;
+ if (np_to_push == 0) return;
// Get cell size on gather_lev
const std::array<Real,3>& dx = WarpX::CellSize(std::max(gather_lev,0));
@@ -1850,6 +1853,8 @@ PhysicalParticleContainer::PushPX (WarpXParIter& pti,
}
#endif
+ const auto t_do_not_gather = do_not_gather;
+
amrex::ParallelFor( np_to_push, [=] AMREX_GPU_DEVICE (long ip)
{
amrex::ParticleReal xp, yp, zp;
@@ -1861,12 +1866,14 @@ PhysicalParticleContainer::PushPX (WarpXParIter& pti,
amrex::ParticleReal Bxp = 0._rt, Byp = 0._rt, Bzp = 0._rt;
getExternalB(ip, Bxp, Byp, Bzp);
- // first gather E and B to the particle positions
- doGatherShapeN(xp, yp, zp, 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(xp, yp, zp, 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);
+ }
scaleFields(xp, yp, zp, Exp, Eyp, Ezp, Bxp, Byp, Bzp);