aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/MultiParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar NeilZaim <49716072+NeilZaim@users.noreply.github.com> 2020-09-03 12:01:45 +0200
committerGravatar GitHub <noreply@github.com> 2020-09-03 12:01:45 +0200
commit46656318081e84c262f6f4b54f78d8e449c44df8 (patch)
treebe77de616e0ef4743cb8d9ae6a0005e23cb7284f /Source/Particles/MultiParticleContainer.cpp
parent004e96387d0cd45f2674d95151b79411ba5c1d0a (diff)
downloadWarpX-46656318081e84c262f6f4b54f78d8e449c44df8.tar.gz
WarpX-46656318081e84c262f6f4b54f78d8e449c44df8.tar.zst
WarpX-46656318081e84c262f6f4b54f78d8e449c44df8.zip
Add structure for resampling algorithms (#1265)
* First version of resampling structure * Remove new warnings * Added Doxygen comments * Minor modifications * Add do_resampling() in OneStep_sub1 * Apply suggestions from code review Co-authored-by: Luca Fedeli <luca.fedeli.88@gmail.com> * Use mutable in ResamplingTrigger and replace run with operator() * Apply suggestions from code review Co-authored-by: MaxThevenet <maxence.thevenet@desy.de> * Make LevelingThinning operator() final Co-authored-by: Luca Fedeli <luca.fedeli.88@gmail.com> Co-authored-by: MaxThevenet <maxence.thevenet@desy.de>
Diffstat (limited to 'Source/Particles/MultiParticleContainer.cpp')
-rw-r--r--Source/Particles/MultiParticleContainer.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp
index d619a5de4..e27a1d1d3 100644
--- a/Source/Particles/MultiParticleContainer.cpp
+++ b/Source/Particles/MultiParticleContainer.cpp
@@ -695,6 +695,18 @@ MultiParticleContainer::doCoulombCollisions ()
}
}
+void MultiParticleContainer::doResampling (const int timestep)
+{
+ WARPX_PROFILE("MPC::doResampling");
+
+ for (auto& pc : allcontainers)
+ {
+ if (!pc->do_resampling){ continue; }
+
+ pc->resample(m_resampler, timestep);
+ }
+}
+
void MultiParticleContainer::CheckIonizationProductSpecies()
{
for (int i=0; i < static_cast<int>(species_names.size()); i++){
@@ -1033,7 +1045,6 @@ MultiParticleContainer::doQEDSchwinger ()
// Get cell volume multiplied by temporal step. In 2D the transverse size is
// chosen by the user in the input file.
amrex::Geometry const & geom = warpx.Geom(level_0);
- auto domain_box = geom.Domain();
#if (AMREX_SPACEDIM == 2)
const auto dVdt = geom.CellSize(0) * geom.CellSize(1)
* m_qed_schwinger_y_size * warpx.getdt(level_0);