diff options
author | 2019-05-08 11:33:14 -0700 | |
---|---|---|
committer | 2019-05-08 11:33:14 -0700 | |
commit | 73d6b20ae982466a126f899699ab35cbad1433bf (patch) | |
tree | d2a4ccc10c007b8040ce91f9e7ba70b820b2db6e /Source/Particles/MultiParticleContainer.cpp | |
parent | bd9e80c56baf4bb6d8760befb3a42896f03fe912 (diff) | |
parent | c6335ccaf604b1713449a500eb56559d7c678d7c (diff) | |
download | WarpX-73d6b20ae982466a126f899699ab35cbad1433bf.tar.gz WarpX-73d6b20ae982466a126f899699ab35cbad1433bf.tar.zst WarpX-73d6b20ae982466a126f899699ab35cbad1433bf.zip |
Merge branch 'dev' into clean_godfrey
Diffstat (limited to 'Source/Particles/MultiParticleContainer.cpp')
-rw-r--r-- | Source/Particles/MultiParticleContainer.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp index a4df1f83a..440906348 100644 --- a/Source/Particles/MultiParticleContainer.cpp +++ b/Source/Particles/MultiParticleContainer.cpp @@ -414,3 +414,48 @@ MultiParticleContainer } } } + +/* \brief Continuous injection for particles initially outside of the domain. + * \param injection_box: Domain where new particles should be injected. + * Loop over all WarpXParticleContainer in MultiParticleContainer and + * calls virtual function ContinuousInjection. + */ +void +MultiParticleContainer::ContinuousInjection(const RealBox& injection_box) const +{ + for (int i=0; i<nspecies+nlasers; i++){ + auto& pc = allcontainers[i]; + if (pc->do_continuous_injection){ + pc->ContinuousInjection(injection_box); + } + } +} + +/* \brief Update position of continuous injection parameters. + * \param dt: simulation time step (level 0) + * All classes inherited from WarpXParticleContainer do not have + * a position to update (PhysicalParticleContainer does not do anything). + */ +void +MultiParticleContainer::UpdateContinuousInjectionPosition(Real dt) const +{ + for (int i=0; i<nspecies+nlasers; i++){ + auto& pc = allcontainers[i]; + if (pc->do_continuous_injection){ + pc->UpdateContinuousInjectionPosition(dt); + } + } +} + +int +MultiParticleContainer::doContinuousInjection() const +{ + int warpx_do_continuous_injection = 0; + for (int i=0; i<nspecies+nlasers; i++){ + auto& pc = allcontainers[i]; + if (pc->do_continuous_injection){ + warpx_do_continuous_injection = 1; + } + } + return warpx_do_continuous_injection; +} |