diff options
author | 2019-09-23 16:48:45 -0700 | |
---|---|---|
committer | 2019-09-23 16:48:45 -0700 | |
commit | 3b44103b7cd689bb30e5e379f67c8a1c8ad9c618 (patch) | |
tree | 1e2b51ad637bc41d344f01a81a8bf0ffc33b5873 /Source/Particles/PhysicalParticleContainer.cpp | |
parent | 97782d2ee0929b1485923e8dc98ccf0192031649 (diff) | |
download | WarpX-3b44103b7cd689bb30e5e379f67c8a1c8ad9c618.tar.gz WarpX-3b44103b7cd689bb30e5e379f67c8a1c8ad9c618.tar.zst WarpX-3b44103b7cd689bb30e5e379f67c8a1c8ad9c618.zip |
fix and add comments
Diffstat (limited to 'Source/Particles/PhysicalParticleContainer.cpp')
-rw-r--r-- | Source/Particles/PhysicalParticleContainer.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index 8eec9ae41..8dfddc833 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -1363,8 +1363,14 @@ PhysicalParticleContainer::Evolve (int lev, } } } - // Split particles - if (do_splitting && a_dt_type == DtType::SecondHalf && WarpX::do_subcycling == 1){ + // 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); } } |