diff options
author | 2019-08-08 15:48:08 -0700 | |
---|---|---|
committer | 2019-08-08 15:48:08 -0700 | |
commit | 5cc13f04eaf1a41c22245129bf083f38e7c596ef (patch) | |
tree | 925bac3555b5fbdb6074e89eb9eb907c505e4ae7 /Source/Particles/PhysicalParticleContainer.cpp | |
parent | 1d5242090b0a486a379b4b8a756d9b902ac3a82b (diff) | |
download | WarpX-5cc13f04eaf1a41c22245129bf083f38e7c596ef.tar.gz WarpX-5cc13f04eaf1a41c22245129bf083f38e7c596ef.tar.zst WarpX-5cc13f04eaf1a41c22245129bf083f38e7c596ef.zip |
Converted DepositCharge to c++ (and removed duplication of code)
Diffstat (limited to 'Source/Particles/PhysicalParticleContainer.cpp')
-rw-r--r-- | Source/Particles/PhysicalParticleContainer.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index 59d3ce76f..d10390204 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -1156,7 +1156,12 @@ PhysicalParticleContainer::Evolve (int lev, pti.GetPosition(m_xp[thread_num], m_yp[thread_num], m_zp[thread_num]); BL_PROFILE_VAR_STOP(blp_copy); - if (rho) DepositCharge(pti, wp, rho, crho, 0, np_current, np, thread_num, lev); + if (rho) { + DepositCharge(pti, wp, rho, 0, 0, np_current, thread_num, lev, lev); + if (has_buffer){ + DepositCharge(pti, wp, crho, 0, np_current, np-np_current, thread_num, lev, lev-1); + } + } if (! do_not_push) { @@ -1292,7 +1297,12 @@ PhysicalParticleContainer::Evolve (int lev, BL_PROFILE_VAR_STOP(blp_copy); } - if (rho) DepositCharge(pti, wp, rho, crho, 1, np_current, np, thread_num, lev); + if (rho) { + DepositCharge(pti, wp, rho, 1, 0, np_current, thread_num, lev, lev); + if (has_buffer){ + DepositCharge(pti, wp, crho, 1, np_current, np-np_current, thread_num, lev, lev-1); + } + } if (cost) { const Box& tbx = pti.tilebox(); |