diff options
author | 2020-09-03 12:01:45 +0200 | |
---|---|---|
committer | 2020-09-03 12:01:45 +0200 | |
commit | 46656318081e84c262f6f4b54f78d8e449c44df8 (patch) | |
tree | be77de616e0ef4743cb8d9ae6a0005e23cb7284f /Source/Particles/PhysicalParticleContainer.cpp | |
parent | 004e96387d0cd45f2674d95151b79411ba5c1d0a (diff) | |
download | WarpX-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/PhysicalParticleContainer.cpp')
-rw-r--r-- | Source/Particles/PhysicalParticleContainer.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index e3aaa6002..1b4c243ac 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -122,6 +122,8 @@ PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core, int isp pp.query("do_field_ionization", do_field_ionization); + pp.query("do_resampling", do_resampling); + //check if Radiation Reaction is enabled and do consistency checks pp.query("do_classical_radiation_reaction", do_classical_radiation_reaction); //if the species is not a lepton, do_classical_radiation_reaction @@ -1988,6 +1990,24 @@ PhysicalParticleContainer::getIonizationFunc (const WarpXParIter& pti, ion_atomic_number); } +void PhysicalParticleContainer::resample (const Resampling& resampler, const int timestep) +{ + const amrex::Real global_numparts = TotalNumberOfParticles(); + + if (resampler.triggered(timestep, global_numparts)) + { + for (int lev = 0; lev <= maxLevel(); lev++) + { + for (WarpXParIter pti(*this, lev); pti.isValid(); ++pti) + { + resampler(pti); + } + } + } + +} + + #ifdef WARPX_QED |