aboutsummaryrefslogtreecommitdiff
path: root/Source/WarpXEvolve.cpp
diff options
context:
space:
mode:
authorGravatar Dave Grote <grote1@llnl.gov> 2018-07-31 14:27:38 -0700
committerGravatar Dave Grote <grote1@llnl.gov> 2018-07-31 14:27:38 -0700
commitbbd7d61b7a9c8e65d988cfac2833a2265209255f (patch)
tree6600e965aacc4aabafceaf28dbf0296b68054912 /Source/WarpXEvolve.cpp
parentfc784aef722c45fc4e0849b27e24b5583181e00f (diff)
downloadWarpX-bbd7d61b7a9c8e65d988cfac2833a2265209255f.tar.gz
WarpX-bbd7d61b7a9c8e65d988cfac2833a2265209255f.tar.zst
WarpX-bbd7d61b7a9c8e65d988cfac2833a2265209255f.zip
Put that calls to warpx_py routines in ifdef WARPX_USE_PY macros
Diffstat (limited to 'Source/WarpXEvolve.cpp')
-rw-r--r--Source/WarpXEvolve.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/WarpXEvolve.cpp b/Source/WarpXEvolve.cpp
index 3eaa929f9..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;
@@ -48,7 +50,9 @@ WarpX::EvolveEM (int numsteps)
// 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)
{
@@ -95,11 +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();
@@ -124,7 +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();
@@ -135,7 +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];
@@ -200,7 +212,9 @@ WarpX::EvolveEM (int numsteps)
break;
}
+#ifdef WARPX_USE_PY
if (warpx_py_afterstep) warpx_py_afterstep();
+#endif
// End loop on time steps
}