diff options
author | 2023-06-30 12:09:13 -0700 | |
---|---|---|
committer | 2023-06-30 19:09:13 +0000 | |
commit | 1a55de802493eef4c515be0e198e4ddb23e5cda9 (patch) | |
tree | e7938d009a51a144f46195bf649649ace96dfb58 /Source/Particles/PhysicalParticleContainer.cpp | |
parent | 5baa09ceadc6291f67839c7842fd1756edfc1186 (diff) | |
download | WarpX-1a55de802493eef4c515be0e198e4ddb23e5cda9.tar.gz WarpX-1a55de802493eef4c515be0e198e4ddb23e5cda9.tar.zst WarpX-1a55de802493eef4c515be0e198e4ddb23e5cda9.zip |
Continuous injection of moving plasma (#3958)
* Continuous injection of moving plasma
* Fix const correctness
* Fix bugs in calculation of v_bulk
* Fix restart
* Use range-based for loops where possible
* Apply suggestions from code review
* Fix bug related to managed memory
* Apply suggestions from code review
* Exclude case with `moving_window_v = 0`
* Add to WarpXParticleContainer virtual function that returns pointer to plasma injector
* Add to WarpXParticleContainer member variable for current injection position
* Fix bugs
* Fix bug: use continue instead of return
Diffstat (limited to 'Source/Particles/PhysicalParticleContainer.cpp')
-rw-r--r-- | Source/Particles/PhysicalParticleContainer.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index 0793094ff..8dff41c05 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -926,7 +926,7 @@ PhysicalParticleContainer::AddPlasma (int lev, RealBox part_realbox) InjectorPosition* inj_pos = plasma_injector->getInjectorPosition(); InjectorDensity* inj_rho = plasma_injector->getInjectorDensity(); - InjectorMomentum* inj_mom = plasma_injector->getInjectorMomentum(); + InjectorMomentum* inj_mom = plasma_injector->getInjectorMomentumDevice(); const Real gamma_boost = WarpX::gamma_boost; const Real beta_boost = WarpX::beta_boost; const Real t = WarpX::GetInstance().gett_new(lev); @@ -1476,7 +1476,7 @@ PhysicalParticleContainer::AddPlasmaFlux (amrex::Real dt) InjectorPosition* inj_pos = plasma_injector->getInjectorPosition(); InjectorFlux* inj_flux = plasma_injector->getInjectorFlux(); - InjectorMomentum* inj_mom = plasma_injector->getInjectorMomentum(); + InjectorMomentum* inj_mom = plasma_injector->getInjectorMomentumDevice(); constexpr int level_zero = 0; const amrex::Real t = WarpX::GetInstance().gett_new(level_zero); @@ -2922,6 +2922,11 @@ PhysicalParticleContainer::getIonizationFunc (const WarpXParIter& pti, ion_atomic_number); } +PlasmaInjector* PhysicalParticleContainer::GetPlasmaInjector () +{ + return plasma_injector.get(); +} + void PhysicalParticleContainer::resample (const int timestep) { // In heavily load imbalanced simulations, MPI processes with few particles will spend most of |