aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Tools/LibEnsemble/sim/inputs20
-rw-r--r--Tools/LibEnsemble/write_sim_input.py18
2 files changed, 28 insertions, 10 deletions
diff --git a/Tools/LibEnsemble/sim/inputs b/Tools/LibEnsemble/sim/inputs
index 39ecaa11f..dea0128f6 100644
--- a/Tools/LibEnsemble/sim/inputs
+++ b/Tools/LibEnsemble/sim/inputs
@@ -195,25 +195,25 @@ warpx.mirror_z_npoints = 4 4
#################################
############# LASER #############
#################################
-lasers.nlasers = 2
-lasers.names = laser1 laser2
+lasers.nlasers = 2
+lasers.names = laser1 laser2
-laser1.profile = Gaussian
-laser1.position = 0. 0. -1.e-9 # This point is on the laser plane
-laser1.direction = 0. 0. 1. # The plane normal direction
+laser1.profile = Gaussian
+laser1.position = 0. 0. -1.e-9 # This point is on the laser plane
+laser1.direction = 0. 0. 1. # The plane normal direction
laser1.polarization = 0. 1. 0. # The main polarization vector
-laser1.e_max = 6.82274e12 # Maximum amplitude of the laser field (in V/m)
+laser1.e_max = 6.82274e12 # Maximum amplitude of the laser field (in V/m)
laser1.profile_waist = 50.e-6 # The waist of the laser (in meters)
laser1.profile_duration = 7.33841e-14 # The duration of the laser (in seconds)
laser1.profile_t_peak = 1.46764864e-13 # The time at which the laser reaches its peak (in seconds)
laser1.profile_focal_distance = 0.00875 # Focal distance from the antenna (in meters)
laser1.wavelength = 0.8e-6 # The wavelength of the laser (in meters)
-laser2.profile = Gaussian
-laser2.position = 0. 0. 0.348499999 # This point is on the laser plane
-laser2.direction = 0. 0. 1. # The plane normal direction
+laser2.profile = Gaussian
+laser2.position = 0. 0. 0.348499999 # This point is on the laser plane
+laser2.direction = 0. 0. 1. # The plane normal direction
laser2.polarization = 0. 1. 0. # The main polarization vector
-laser2.e_max = 6.82274e12 # Maximum amplitude of the laser field (in V/m)
+laser2.e_max = 6.82274e12 # Maximum amplitude of the laser field (in V/m)
laser2.profile_waist = 50.e-6 # The waist of the laser (in meters)
laser2.profile_duration = 7.33841e-14 # The duration of the laser (in seconds)
laser2.profile_t_peak = 1.1626176366295598e-09 # The time at which the laser reaches its peak (in seconds)
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')