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/WarpXParticleContainer.H | |
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/WarpXParticleContainer.H')
-rw-r--r-- | Source/Particles/WarpXParticleContainer.H | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/Particles/WarpXParticleContainer.H b/Source/Particles/WarpXParticleContainer.H index ffeead6f1..6e0d3f4f9 100644 --- a/Source/Particles/WarpXParticleContainer.H +++ b/Source/Particles/WarpXParticleContainer.H @@ -13,6 +13,7 @@ #include "WarpXParticleContainer_fwd.H" #include "Evolve/WarpXDtType.H" +#include "Initialization/PlasmaInjector.H" #include "Particles/ParticleBoundaries.H" #include "SpeciesPhysicalProperties.H" @@ -121,6 +122,12 @@ public: virtual void InitIonizationModule () {} + /* + * \brief Virtual function that returns a pointer to the plasma injector, + * for derived classes that define one (PhysicalParticleContainer). + */ + virtual PlasmaInjector* GetPlasmaInjector () { return nullptr; } + /** * Evolve is the central WarpXParticleContainer function that advances * particles for a time dt (typically one timestep). It is a pure virtual @@ -241,10 +248,13 @@ public: virtual void ContinuousInjection(const amrex::RealBox& /*injection_box*/) {} // Update optional sub-class-specific injection location. virtual void UpdateContinuousInjectionPosition(amrex::Real /*dt*/) {} + bool doContinuousInjection() const {return do_continuous_injection;} // Inject a continuous flux of particles from a defined plane virtual void ContinuousFluxInjection(amrex::Real /*t*/, amrex::Real /*dt*/) {} + int getSpeciesId() const {return species_id;} + /// /// This returns the total charge for all the particles in this ParticleContainer. /// This is needed when solving Poisson's equation with periodic boundary conditions. @@ -306,6 +316,9 @@ public: int self_fields_max_iters = 200; int self_fields_verbosity = 2; + //! Current injection position + amrex::Real m_current_injection_position; + // split along diagonals (0) or axes (1) int split_type = 0; |