aboutsummaryrefslogtreecommitdiff
path: root/Source/Laser/LaserParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar MaxThevenet <mthevenet@lbl.gov> 2019-05-07 14:50:01 -0700
committerGravatar MaxThevenet <mthevenet@lbl.gov> 2019-05-07 14:50:01 -0700
commitf9678d6a615fb151b7f70f78bafa511b03bd562d (patch)
tree5b0fa755cdb79e459d2e839fce1b7aaab3d2f58b /Source/Laser/LaserParticleContainer.cpp
parent75dec227e2df67eebdd1d13da6a7a6083024a3f7 (diff)
downloadWarpX-f9678d6a615fb151b7f70f78bafa511b03bd562d.tar.gz
WarpX-f9678d6a615fb151b7f70f78bafa511b03bd562d.tar.zst
WarpX-f9678d6a615fb151b7f70f78bafa511b03bd562d.zip
remove done_injecting test
Diffstat (limited to 'Source/Laser/LaserParticleContainer.cpp')
-rw-r--r--Source/Laser/LaserParticleContainer.cpp37
1 files changed, 15 insertions, 22 deletions
diff --git a/Source/Laser/LaserParticleContainer.cpp b/Source/Laser/LaserParticleContainer.cpp
index 3bbd7a039..a45da540d 100644
--- a/Source/Laser/LaserParticleContainer.cpp
+++ b/Source/Laser/LaserParticleContainer.cpp
@@ -162,7 +162,7 @@ LaserParticleContainer::LaserParticleContainer (AmrCore* amr_core, int ispecies,
if (do_continuous_injection){
// If laser antenna initially outside of the box, store its theoretical
- // position in z_antenna_th, and set done_injecting to 0.
+ // position in z_antenna_th
updated_position = position;
// Convert updated position to Real* to use RealBox.contains()
#if (AMREX_SPACEDIM == 3)
@@ -170,9 +170,6 @@ LaserParticleContainer::LaserParticleContainer (AmrCore* amr_core, int ispecies,
#else
const Real p_pos[2] = {updated_position[0], updated_position[2]};
#endif
- if ( not laser_injection_box.contains(p_pos) ){
- done_injecting = 0;
- }
// Sanity checks
int dir = WarpX::moving_window_dir;
@@ -203,28 +200,24 @@ LaserParticleContainer::LaserParticleContainer (AmrCore* amr_core, int ispecies,
void
LaserParticleContainer::ContinuousInjection (const RealBox& injection_box)
{
- if (done_injecting==0)
- {
- // Input parameter injection_box contains small box where injection
- // should occur.
- // So far, LaserParticleContainer::laser_injection_box contains the
- // outdated full problem domain at t=0.
+ // Input parameter injection_box contains small box where injection
+ // should occur.
+ // So far, LaserParticleContainer::laser_injection_box contains the
+ // outdated full problem domain at t=0.
- // Convert updated_position to Real* to use RealBox::contains().
+ // Convert updated_position to Real* to use RealBox::contains().
#if (AMREX_SPACEDIM == 3)
- const Real* p_pos = updated_position.dataPtr();
+ const Real* p_pos = updated_position.dataPtr();
#else
- const Real p_pos[2] = {updated_position[0], updated_position[2]};
+ const Real p_pos[2] = {updated_position[0], updated_position[2]};
#endif
- if ( injection_box.contains(p_pos) ){
- // Update laser_injection_box with current value
- laser_injection_box = injection_box;
- // Inject laser particles. LaserParticleContainer::InitData
- // is called only once, when the antenna enters the simulation
- // domain.
- InitData();
- done_injecting = 1;
- }
+ if ( injection_box.contains(p_pos) ){
+ // Update laser_injection_box with current value
+ laser_injection_box = injection_box;
+ // Inject laser particles. LaserParticleContainer::InitData
+ // is called only once, when the antenna enters the simulation
+ // domain.
+ InitData();
}
}