aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/PhysicalParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar Remi Lehe <remi.lehe@normalesup.org> 2019-09-23 20:17:50 -0700
committerGravatar GitHub <noreply@github.com> 2019-09-23 20:17:50 -0700
commit39bdf9c64af708facab60473fb6bdd32664b4b33 (patch)
treef8155d7caa94b7d0941bb8d3675bf526d84b0d86 /Source/Particles/PhysicalParticleContainer.cpp
parentc152e30951fa06d8aa4ea21680ad19e20a35d76e (diff)
parentc51f53a2dc60076995e99bcf91ca8167edb1818f (diff)
downloadWarpX-39bdf9c64af708facab60473fb6bdd32664b4b33.tar.gz
WarpX-39bdf9c64af708facab60473fb6bdd32664b4b33.tar.zst
WarpX-39bdf9c64af708facab60473fb6bdd32664b4b33.zip
Merge pull request #394 from MaxThevenet/subcycling_split
Split particles only during second half-push when subcycling
Diffstat (limited to 'Source/Particles/PhysicalParticleContainer.cpp')
-rw-r--r--Source/Particles/PhysicalParticleContainer.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp
index d5f133332..b1e83d652 100644
--- a/Source/Particles/PhysicalParticleContainer.cpp
+++ b/Source/Particles/PhysicalParticleContainer.cpp
@@ -1363,8 +1363,16 @@ PhysicalParticleContainer::Evolve (int lev,
}
}
}
- // Split particles
- if (do_splitting){ SplitParticles(lev); }
+ // Split particles at the end of the timestep.
+ // When subcycling is ON, the splitting is done on the last call to
+ // PhysicalParticleContainer::Evolve on the finest level, i.e., at the
+ // end of the large timestep. Otherwise, the pushes on different levels
+ // are not consistent, and the call to Redistribute (inside
+ // SplitParticles) may result in split particles to deposit twice on the
+ // coarse level.
+ if (do_splitting && (a_dt_type == DtType::SecondHalf || a_dt_type == DtType::Full) ){
+ SplitParticles(lev);
+ }
}
// Loop over all particles in the particle container and