diff options
author | 2019-05-07 09:32:47 -0700 | |
---|---|---|
committer | 2019-05-07 09:32:47 -0700 | |
commit | 6bdafd570c25fde71d2ce93ecea6fbd803f8cf2c (patch) | |
tree | fd173453823f9267e32301bcbec5942baf8bfb0a /Source/Laser/LaserParticleContainer.cpp | |
parent | 38b802c0ba0d47fd179a2b384e8867248de078e9 (diff) | |
download | WarpX-6bdafd570c25fde71d2ce93ecea6fbd803f8cf2c.tar.gz WarpX-6bdafd570c25fde71d2ce93ecea6fbd803f8cf2c.tar.zst WarpX-6bdafd570c25fde71d2ce93ecea6fbd803f8cf2c.zip |
laser and plasma cont injection combined and working with MW and boost in z
Diffstat (limited to 'Source/Laser/LaserParticleContainer.cpp')
-rw-r--r-- | Source/Laser/LaserParticleContainer.cpp | 46 |
1 files changed, 42 insertions, 4 deletions
diff --git a/Source/Laser/LaserParticleContainer.cpp b/Source/Laser/LaserParticleContainer.cpp index 569d99c97..8499455de 100644 --- a/Source/Laser/LaserParticleContainer.cpp +++ b/Source/Laser/LaserParticleContainer.cpp @@ -207,10 +207,6 @@ LaserParticleContainer::ContinuousInjection (Real dt, const RealBox& prob_domain { Print()<<" --- In LaserParticleContainer::ContinuousInjection"<<std::endl; Print()<<"z_antenna_th "<<z_antenna_th<<std::endl; - // update position of the antenna (outside of the box) - if (WarpX::gamma_boost>1){ - z_antenna_th -= PhysConst::c * WarpX::beta_boost * dt; - } // If laser antenna particles have not been injected yet, // check if they should be injected at this iteration. If // so, inject them and set done_injecting to 0 (false). @@ -240,6 +236,48 @@ LaserParticleContainer::ContinuousInjection (Real dt, const RealBox& prob_domain } void +LaserParticleContainer::UpdateContinuousInjectionPosition(Real dt) +{ + int dir = WarpX::moving_window_dir; + // update position of the antenna (outside of the box) + // Continuously inject plasma in new cells (by default only on level 0) + if (do_continuous_injection and (WarpX::gamma_boost > 1)){ + // In boosted-frame simulations, the plasma has moved since the last + // call to this function, and injection position needs to be updated + z_antenna_th -= WarpX::beta_boost * +#if ( AMREX_SPACEDIM == 3 ) + WarpX::boost_direction[dir] * PhysConst::c * dt; +#elif ( AMREX_SPACEDIM == 2 ) + // In 2D, dir=0 corresponds to x and dir=1 corresponds to z + // This needs to be converted in order to index `boost_direction` + // which has 3 components, for both 2D and 3D simulations. + WarpX::boost_direction[2*dir] * PhysConst::c * dt; +#endif + } + + /* + if (WarpX::do_plasma_injection and (WarpX::gamma_boost > 1){ + z_antenna_th -= PhysConst::c * WarpX::beta_boost * dt; + } + */ +} + + + + + + + + + + + + + + + + +void LaserParticleContainer::InitData () { InitData(maxLevel()); |