aboutsummaryrefslogtreecommitdiff
path: root/Source/Laser/LaserParticleContainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Laser/LaserParticleContainer.cpp')
-rw-r--r--Source/Laser/LaserParticleContainer.cpp46
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());