aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/PhysicalParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar Remi Lehe <remi.lehe@normalesup.org> 2019-07-15 13:19:35 -0700
committerGravatar GitHub <noreply@github.com> 2019-07-15 13:19:35 -0700
commit9644af5ed2eeeadbfb34dea9fdb2d5bbd5d2b34d (patch)
tree99b738a90be029e1fdccc19c4753a287920ad409 /Source/Particles/PhysicalParticleContainer.cpp
parent73884ee53f35a1845cbbc52d6c47a1c9aedf7d3d (diff)
parent630e4d715894cb5a35a9ea33c4d2859d2fbe08a0 (diff)
downloadWarpX-9644af5ed2eeeadbfb34dea9fdb2d5bbd5d2b34d.tar.gz
WarpX-9644af5ed2eeeadbfb34dea9fdb2d5bbd5d2b34d.tar.zst
WarpX-9644af5ed2eeeadbfb34dea9fdb2d5bbd5d2b34d.zip
Merge pull request #207 from ECP-WarpX/deposition_cpp
Direct current deposition in C++
Diffstat (limited to 'Source/Particles/PhysicalParticleContainer.cpp')
-rw-r--r--Source/Particles/PhysicalParticleContainer.cpp33
1 files changed, 23 insertions, 10 deletions
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp
index d6c4973c3..28d611020 100644
--- a/Source/Particles/PhysicalParticleContainer.cpp
+++ b/Source/Particles/PhysicalParticleContainer.cpp
@@ -1529,17 +1529,30 @@ PhysicalParticleContainer::Evolve (int lev,
//
// Current Deposition
//
- // Deposit inside domains
- DepositCurrent(pti, wp, uxp, uyp, uzp, &jx, &jy, &jz,
- 0, np_current, thread_num,
- lev, lev, dt);
- if (has_buffer){
- // Deposit in buffers
- DepositCurrent(pti, wp, uxp, uyp, uzp, cjx, cjy, cjz,
- np_current, np-np_current, thread_num,
- lev, lev-1, dt);
+ if (WarpX::use_picsar_deposition) {
+ // Deposit inside domains
+ DepositCurrentFortran(pti, wp, uxp, uyp, uzp, &jx, &jy, &jz,
+ 0, np_current, thread_num,
+ lev, lev, dt);
+ if (has_buffer){
+ // Deposit in buffers
+ DepositCurrentFortran(pti, wp, uxp, uyp, uzp, cjx, cjy, cjz,
+ np_current, np-np_current, thread_num,
+ lev, lev-1, dt);
+ }
+ } else {
+ // Deposit inside domains
+ DepositCurrent(pti, wp, uxp, uyp, uzp, &jx, &jy, &jz,
+ 0, np_current, thread_num,
+ lev, lev, dt);
+ if (has_buffer){
+ // Deposit in buffers
+ DepositCurrent(pti, wp, uxp, uyp, uzp, cjx, cjy, cjz,
+ np_current, np-np_current, thread_num,
+ lev, lev-1, dt);
+ }
}
-
+
//
// copy particle data back
//