diff options
Diffstat (limited to 'Source/WarpXEvolve.cpp')
-rw-r--r-- | Source/WarpXEvolve.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/Source/WarpXEvolve.cpp b/Source/WarpXEvolve.cpp index a92f033b5..b42a781d1 100644 --- a/Source/WarpXEvolve.cpp +++ b/Source/WarpXEvolve.cpp @@ -5,7 +5,9 @@ #include <WarpX.H> #include <WarpXConst.H> #include <WarpX_f.H> +#ifdef WARPX_USE_PY #include <WarpX_py.H> +#endif using namespace amrex; @@ -45,12 +47,12 @@ WarpX::EvolveEM (int numsteps) Real walltime, walltime_start = ParallelDescriptor::second(); for (int step = istep[0]; step < numsteps_max && cur_time < stop_time; ++step) { - if (warpx_py_print_step) { - warpx_py_print_step(step); - } // Start loop on time steps amrex::Print() << "\nSTEP " << step+1 << " starts ...\n"; +#ifdef WARPX_USE_PY + if (warpx_py_beforestep) warpx_py_beforestep(); +#endif if (costs[0] != nullptr) { @@ -97,7 +99,15 @@ WarpX::EvolveEM (int numsteps) // from p^{n-1/2} to p^{n+1/2} // Deposit current j^{n+1/2} // Deposit charge density rho^{n} +#ifdef WARPX_USE_PY + if (warpx_py_particleinjection) warpx_py_particleinjection(); + if (warpx_py_particlescraper) warpx_py_particlescraper(); + if (warpx_py_beforedeposition) warpx_py_beforedeposition(); +#endif PushParticlesandDepose(cur_time); +#ifdef WARPX_USE_PY + if (warpx_py_afterdeposition) warpx_py_afterdeposition(); +#endif SyncCurrent(); @@ -122,6 +132,9 @@ WarpX::EvolveEM (int numsteps) FillBoundaryB(); #endif +#ifdef WARPX_USE_PY + if (warpx_py_beforeEsolve) warpx_py_beforeEsolve(); +#endif if (cur_time + dt[0] >= stop_time - 1.e-3*dt[0] || step == numsteps_max-1) { // At the end of last step, push p by 0.5*dt to synchronize UpdateAuxilaryData(); @@ -132,6 +145,9 @@ WarpX::EvolveEM (int numsteps) } is_synchronized = true; } +#ifdef WARPX_USE_PY + if (warpx_py_afterEsolve) warpx_py_afterEsolve(); +#endif for (int lev = 0; lev <= max_level; ++lev) { ++istep[lev]; @@ -196,6 +212,9 @@ WarpX::EvolveEM (int numsteps) break; } +#ifdef WARPX_USE_PY + if (warpx_py_afterstep) warpx_py_afterstep(); +#endif // End loop on time steps } |