From 46656318081e84c262f6f4b54f78d8e449c44df8 Mon Sep 17 00:00:00 2001 From: NeilZaim <49716072+NeilZaim@users.noreply.github.com> Date: Thu, 3 Sep 2020 12:01:45 +0200 Subject: 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 * Use mutable in ResamplingTrigger and replace run with operator() * Apply suggestions from code review Co-authored-by: MaxThevenet * Make LevelingThinning operator() final Co-authored-by: Luca Fedeli Co-authored-by: MaxThevenet --- Source/Particles/MultiParticleContainer.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Source/Particles/MultiParticleContainer.cpp') 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(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); -- cgit v1.2.3