aboutsummaryrefslogtreecommitdiff
path: root/Tools/LibEnsemble/write_sim_input.py
diff options
context:
space:
mode:
authorGravatar L. Diana Amorim <LDianaAmorim@lbl.gov> 2020-07-13 13:43:20 -0700
committerGravatar GitHub <noreply@github.com> 2020-07-13 13:43:20 -0700
commit0b00cfa973de24e3ae08ecd0894b2d9b8b986c0d (patch)
treeac8ab3320f685df6a76fb6cc14c494b56f84ea2a /Tools/LibEnsemble/write_sim_input.py
parentb29a06a2ac06d8bbcaab0a432378284718c29754 (diff)
downloadWarpX-0b00cfa973de24e3ae08ecd0894b2d9b8b986c0d.tar.gz
WarpX-0b00cfa973de24e3ae08ecd0894b2d9b8b986c0d.tar.zst
WarpX-0b00cfa973de24e3ae08ecd0894b2d9b8b986c0d.zip
Added laser shifts to input for each libE config (#1141)
* Added laser shifts to input for each libE config * Position is 3D * Fix spaces - phrase must match * Laser pulse duration was off by x10 * Update Tools/LibEnsemble/write_sim_input.py Co-authored-by: MaxThevenet <mthevenet@lbl.gov> * Changed spaces * Shift added to mirrors position as well * Fixed tab * Fixed spaces for consistency * Added space to be consistent Co-authored-by: MaxThevenet <mthevenet@lbl.gov>
Diffstat (limited to '')
-rw-r--r--Tools/LibEnsemble/write_sim_input.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Tools/LibEnsemble/write_sim_input.py b/Tools/LibEnsemble/write_sim_input.py
index 5e1a15222..edd2ed4a5 100644
--- a/Tools/LibEnsemble/write_sim_input.py
+++ b/Tools/LibEnsemble/write_sim_input.py
@@ -1,4 +1,5 @@
import re
+import scipy.constants as scc
"""
This file is part of the suite of scripts to use LibEnsemble on top of WarpX
@@ -46,6 +47,14 @@ def write_sim_input(input_file, x_values):
beg_stage_2 = end_stage_1 + gap_12
end_stage_2 = beg_stage_2 + ramp_up_2 + plateau_2 + ramp_down_2
+ # Updating mirrors position
+ mirror_z_1 = end_stage_1 + 1.0e-3
+ mirror_z_2 = end_stage_2 + 1.0e-3
+
+ # Updating laser 2 configuration
+ z_antenna_2 = beg_stage_2 - 1.0e-9 #with value used for stage 1
+ z_t_peak_2 = z_antenna_2 / scc.c + 2 * 7.33841e-14 # using pulse duration
+
# End simulation when beam has just escaped the last stage
gamma_b = 30.
zmax_stop_run = end_stage_2 - 55.e-6 * gamma_b**2 * 2.
@@ -92,6 +101,15 @@ def write_sim_input(input_file, x_values):
output_text = _set_value(
output_text, 'warpx.zmax_plasma_to_compute_max_step = ',
str(zmax_stop_run))
+ # Set mirrors position
+ output_text = _set_value(
+ output_text, 'warpx.mirror_z = ', str(mirror_z_1)+' '+str(mirror_z_2))
+ # Set laser2 position
+ output_text = _set_value(
+ output_text, 'laser2.position = ', '0. 0. '+ str(z_antenna_2))
+ # Set laser2 time until peak field is reached
+ output_text = _set_value(
+ output_text, 'laser2.profile_t_peak = ', str(z_t_peak_2))
# Write new input file
fout = open(input_file, 'w')