diff options
author | 2021-04-13 12:00:17 -0700 | |
---|---|---|
committer | 2021-04-13 12:00:17 -0700 | |
commit | 7b7267ed685b4b045c576004a17ad8090bc6744c (patch) | |
tree | 5b33528e0fe4dee7f91e5d8026132d837de7c45d /Source/Particles/MultiParticleContainer.cpp | |
parent | 599d590e60e480cf2e8a7c766565da1edaf79b0b (diff) | |
download | WarpX-7b7267ed685b4b045c576004a17ad8090bc6744c.tar.gz WarpX-7b7267ed685b4b045c576004a17ad8090bc6744c.tar.zst WarpX-7b7267ed685b4b045c576004a17ad8090bc6744c.zip |
Add an option to skip deposition in the `Evolve` function ; use it for electrostatic (#1807)
* Introduce new option skip_deposition
* Properly implement the option to skip deposition
* Skip deposition for electrostatic solver
* Correct typo
Diffstat (limited to 'Source/Particles/MultiParticleContainer.cpp')
-rw-r--r-- | Source/Particles/MultiParticleContainer.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp index 4218e9fdf..34d12a2b3 100644 --- a/Source/Particles/MultiParticleContainer.cpp +++ b/Source/Particles/MultiParticleContainer.cpp @@ -328,16 +328,18 @@ MultiParticleContainer::Evolve (int lev, MultiFab* rho, MultiFab* crho, const MultiFab* cEx, const MultiFab* cEy, const MultiFab* cEz, const MultiFab* cBx, const MultiFab* cBy, const MultiFab* cBz, - Real t, Real dt, DtType a_dt_type) + Real t, Real dt, DtType a_dt_type, bool skip_deposition) { - jx.setVal(0.0); - jy.setVal(0.0); - jz.setVal(0.0); - if (cjx) cjx->setVal(0.0); - if (cjy) cjy->setVal(0.0); - if (cjz) cjz->setVal(0.0); - if (rho) rho->setVal(0.0); - if (crho) crho->setVal(0.0); + if (! skip_deposition) { + jx.setVal(0.0); + jy.setVal(0.0); + jz.setVal(0.0); + if (cjx) cjx->setVal(0.0); + if (cjy) cjy->setVal(0.0); + if (cjz) cjz->setVal(0.0); + if (rho) rho->setVal(0.0); + if (crho) crho->setVal(0.0); + } for (auto& pc : allcontainers) { pc->Evolve(lev, Ex, Ey, Ez, Bx, By, Bz, jx, jy, jz, cjx, cjy, cjz, rho, crho, cEx, cEy, cEz, cBx, cBy, cBz, t, dt, a_dt_type); |