aboutsummaryrefslogtreecommitdiff
path: root/Source/Evolve/WarpXEvolve.cpp
diff options
context:
space:
mode:
authorGravatar Remi Lehe <remi.lehe@normalesup.org> 2021-03-15 20:09:57 -0700
committerGravatar GitHub <noreply@github.com> 2021-03-15 20:09:57 -0700
commit8b7780f737d59751d21e81e2b0cb7d5157be0508 (patch)
tree9e164f5292078e96b3f6df2df62f81dc00b58095 /Source/Evolve/WarpXEvolve.cpp
parent1fe3435e9af28060c22c1823b0cb3163625ff832 (diff)
downloadWarpX-8b7780f737d59751d21e81e2b0cb7d5157be0508.tar.gz
WarpX-8b7780f737d59751d21e81e2b0cb7d5157be0508.tar.zst
WarpX-8b7780f737d59751d21e81e2b0cb7d5157be0508.zip
Move multi-physics module out of `OneStep` (#1790)
Diffstat (limited to '')
-rw-r--r--Source/Evolve/WarpXEvolve.cpp48
1 files changed, 21 insertions, 27 deletions
diff --git a/Source/Evolve/WarpXEvolve.cpp b/Source/Evolve/WarpXEvolve.cpp
index a64d52757..0abd243ef 100644
--- a/Source/Evolve/WarpXEvolve.cpp
+++ b/Source/Evolve/WarpXEvolve.cpp
@@ -125,6 +125,17 @@ WarpX::Evolve (int numsteps)
FillBoundaryAux(guard_cells.ng_UpdateAux);
}
}
+
+ // Run multi-physics modules:
+ // ionization, Coulomb collisions, QED Schwinger
+ doFieldIonization();
+ mypc->doCollisions( cur_time );
+#ifdef WARPX_QED
+ mypc->doQEDSchwinger();
+#endif
+
+ // Main PIC operation:
+ // gather fields, push particles, deposit sources, update fields
if (do_subcycling == 0 || finest_level == 0) {
OneStep_nosub(cur_time);
// E : guard cells are up-to-date
@@ -137,6 +148,16 @@ WarpX::Evolve (int numsteps)
amrex::Abort("Unsupported do_subcycling type");
}
+ // Run remaining QED modules
+#ifdef WARPX_QED
+ doQEDEvents();
+#endif
+
+ // Resample particles
+ // +1 is necessary here because value of step seen by user (first step is 1) is different than
+ // value of step in code (first step is 0)
+ mypc->doResampling(istep[0]+1);
+
if (num_mirrors>0){
applyMirrors(cur_time);
// E : guard cells are NOT up-to-date
@@ -278,14 +299,6 @@ void
WarpX::OneStep_nosub (Real cur_time)
{
- // Loop over species. For each ionizable species, create particles in
- // product species.
- doFieldIonization();
-
- mypc->doCollisions( cur_time );
-#ifdef WARPX_QED
- mypc->doQEDSchwinger();
-#endif
// Push particle from x^{n} to x^{n+1}
// from p^{n-1/2} to p^{n+1/2}
// Deposit current j^{n+1/2}
@@ -296,14 +309,6 @@ WarpX::OneStep_nosub (Real cur_time)
PushParticlesandDepose(cur_time);
if (warpx_py_afterdeposition) warpx_py_afterdeposition();
-#ifdef WARPX_QED
- doQEDEvents();
-#endif
-
- // +1 is necessary here because value of step seen by user (first step is 1) is different than
- // value of step in code (first step is 0)
- mypc->doResampling(istep[0]+1);
-
// Synchronize J and rho
SyncCurrent();
SyncRho();
@@ -409,17 +414,6 @@ WarpX::OneStep_sub1 (Real curtime)
}
// TODO: we could save some charge depositions
- // Loop over species. For each ionizable species, create particles in
- // product species.
- doFieldIonization();
-
-#ifdef WARPX_QED
- doQEDEvents();
-#endif
-
- // +1 is necessary here because value of step seen by user (first step is 1) is different than
- // value of step in code (first step is 0)
- mypc->doResampling(istep[0]+1);
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(finest_level == 1, "Must have exactly two levels");
const int fine_lev = 1;