diff options
author | 2020-08-06 06:31:38 -0700 | |
---|---|---|
committer | 2020-08-06 06:31:38 -0700 | |
commit | 4c93fb2f90321dab2477eaabe04785100869c073 (patch) | |
tree | a922a0852fee789e05deeadf49d848bf96d95406 /Source/Particles/PhysicalParticleContainer.cpp | |
parent | 0564feb5041728173716ef251f1d66d37c314770 (diff) | |
download | WarpX-4c93fb2f90321dab2477eaabe04785100869c073.tar.gz WarpX-4c93fb2f90321dab2477eaabe04785100869c073.tar.zst WarpX-4c93fb2f90321dab2477eaabe04785100869c073.zip |
swap fieldGather and external fields (#1235)
* swap fieldGather and external fields
* clarify EB external on particle for RZ
* swap order and initialize Exp-Bzp for Photons
Diffstat (limited to 'Source/Particles/PhysicalParticleContainer.cpp')
-rw-r--r-- | Source/Particles/PhysicalParticleContainer.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index 250cf2816..04e7c75d8 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -1482,10 +1482,7 @@ PhysicalParticleContainer::PushP (int lev, Real dt, getPosition(ip, xp, yp, zp); amrex::ParticleReal Exp = 0._rt, Eyp = 0._rt, Ezp = 0._rt; - getExternalE(ip, Exp, Eyp, Ezp); - amrex::ParticleReal Bxp = 0._rt, Byp = 0._rt, Bzp = 0._rt; - getExternalB(ip, Bxp, Byp, Bzp); if (!t_do_not_gather){ // first gather E and B to the particle positions @@ -1495,6 +1492,10 @@ PhysicalParticleContainer::PushP (int lev, Real dt, dx_arr, xyzmin_arr, lo, n_rz_azimuthal_modes, nox, galerkin_interpolation); } + // Externally applied E-field in Cartesian co-ordinates + getExternalE(ip, Exp, Eyp, Ezp); + // Externally applied B-field in Cartesian co-ordinates + getExternalB(ip, Bxp, Byp, Bzp); if (do_crr) { amrex::Real qp = q; @@ -1861,10 +1862,7 @@ PhysicalParticleContainer::PushPX (WarpXParIter& pti, getPosition(ip, xp, yp, zp); amrex::ParticleReal Exp = 0._rt, Eyp = 0._rt, Ezp = 0._rt; - getExternalE(ip, Exp, Eyp, Ezp); - amrex::ParticleReal Bxp = 0._rt, Byp = 0._rt, Bzp = 0._rt; - getExternalB(ip, Bxp, Byp, Bzp); if(!t_do_not_gather){ // first gather E and B to the particle positions @@ -1874,6 +1872,10 @@ PhysicalParticleContainer::PushPX (WarpXParIter& pti, dx_arr, xyzmin_arr, lo, n_rz_azimuthal_modes, nox, galerkin_interpolation); } + // Externally applied E-field in Cartesian co-ordinates + getExternalE(ip, Exp, Eyp, Ezp); + // Externally applied B-field in Cartesian co-ordinates + getExternalB(ip, Bxp, Byp, Bzp); scaleFields(xp, yp, zp, Exp, Eyp, Ezp, Bxp, Byp, Bzp); |