aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/WarpXParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar Remi Lehe <remi.lehe@normalesup.org> 2019-11-21 10:17:24 -0800
committerGravatar GitHub <noreply@github.com> 2019-11-21 10:17:24 -0800
commita58be24722a410cbd5348840f415fa4c4c37f4a5 (patch)
tree4714478a63477c9918389f10ac5dcfaa1b4909e0 /Source/Particles/WarpXParticleContainer.cpp
parent13f3c87791971c4e72b567410f938a6dade47647 (diff)
parent4e28a3d1a74ec1d3cd7c00e67f837ae403d9095a (diff)
downloadWarpX-a58be24722a410cbd5348840f415fa4c4c37f4a5.tar.gz
WarpX-a58be24722a410cbd5348840f415fa4c4c37f4a5.tar.zst
WarpX-a58be24722a410cbd5348840f415fa4c4c37f4a5.zip
Merge pull request #530 from Yin-YinjianZhao/doNotDepositCurrent
Do not deposit
Diffstat (limited to 'Source/Particles/WarpXParticleContainer.cpp')
-rw-r--r--Source/Particles/WarpXParticleContainer.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/Particles/WarpXParticleContainer.cpp b/Source/Particles/WarpXParticleContainer.cpp
index 09f51ef49..c256df6aa 100644
--- a/Source/Particles/WarpXParticleContainer.cpp
+++ b/Source/Particles/WarpXParticleContainer.cpp
@@ -18,6 +18,7 @@
using namespace amrex;
int WarpXParticleContainer::do_not_push = 0;
+int WarpXParticleContainer::do_not_deposit = 0;
WarpXParIter::WarpXParIter (ContainerType& pc, int level)
: ParIter(pc, level, MFItInfo().SetDynamic(WarpX::do_dynamic_scheduling))
@@ -121,6 +122,7 @@ WarpXParticleContainer::ReadParameters ()
#endif
pp.query("do_tiling", do_tiling);
pp.query("do_not_push", do_not_push);
+ pp.query("do_not_deposit", do_not_deposit);
initialized = true;
}
@@ -271,6 +273,9 @@ WarpXParticleContainer::DepositCurrent(WarpXParIter& pti,
// If no particles, do not do anything
if (np_to_depose == 0) return;
+ // If user decides not to deposit
+ if (do_not_deposit) return;
+
const long ngJ = jx->nGrow();
const std::array<Real,3>& dx = WarpX::CellSize(std::max(depos_lev,0));
Real q = this->charge;
@@ -428,6 +433,9 @@ WarpXParticleContainer::DepositCharge (WarpXParIter& pti, RealVector& wp,
// If no particles, do not do anything
if (np_to_depose == 0) return;
+ // If user decides not to deposit
+ if (do_not_deposit) return;
+
const long ngRho = rho->nGrow();
const std::array<Real,3>& dx = WarpX::CellSize(std::max(depos_lev,0));
const Real q = this->charge;