From e08767c1211754d3d771cf39f8587d7528fe19ef Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Mon, 20 Dec 2021 17:55:58 -0800 Subject: [PATCH 01/22] Add PICMI Script for 2D Case --- .../laser_acceleration/PICMI_inputs_2d.py | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100755 Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py new file mode 100755 index 00000000000..fdc1ed5f682 --- /dev/null +++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py @@ -0,0 +1,148 @@ +from pywarpx import picmi + +# Physical constants +c = picmi.constants.c +q_e = picmi.constants.q_e + +# Number of time steps +max_steps = 1000 + +# Number of cells +nx = 64 +nz = 512 + +# Physical domain +xmin = -30e-06 +xmax = 30e-06 +zmin = -56e-06 +zmax = 12e-06 + +# Domain decomposition +max_grid_size = 64 +blocking_factor = 32 + +# Create grid +grid = picmi.Cartesian2DGrid( + number_of_cells = [nx, nz], + lower_bound = [xmin, zmin], + upper_bound = [xmax, zmax], + lower_boundary_conditions = ['open', 'open'], + upper_boundary_conditions = ['open', 'open'], + lower_boundary_conditions_particles = ['absorbing', 'absorbing'], + upper_boundary_conditions_particles = ['absorbing', 'absorbing'], + moving_window_velocity = [0., c], + warpx_max_grid_size = max_grid_size, + warpx_blocking_factor = blocking_factor) + +# Particles: plasma electrons +plasma_density = 2e23 +plasma_xmin = -20e-06 +plasma_ymin = None +plasma_zmin = 10e-06 +plasma_xmax = 20e-06 +plasma_ymax = None +plasma_zmax = None +uniform_distribution = picmi.UniformDistribution( + density = plasma_density, + lower_bound = [plasma_xmin, plasma_ymin, plasma_zmin], + upper_bound = [plasma_xmax, plasma_ymax, plasma_zmax], + fill_in = True) +electrons = picmi.Species( + particle_type = 'electron', + name = 'electrons', + initial_distribution = uniform_distribution) + +# Particles: beam electrons +q_tot = 1e-12 +x_m = 0. +y_m = 0. +z_m = -28e-06 +x_rms = 0.5e-06 +y_rms = 0.5e-06 +z_rms = 0.5e-06 +ux_m = 0. +uy_m = 0. +uz_m = 500. +ux_th = 2. +uy_th = 2. +uz_th = 50. +gaussian_bunch_distribution = picmi.GaussianBunchDistribution( + n_physical_particles = q_tot / q_e, + rms_bunch_size = [x_rms, y_rms, z_rms], + rms_velocity = [c*ux_th, c*uy_th, c*uz_th], + centroid_position = [x_m, y_m, z_m], + centroid_velocity = [c*ux_m, c*uy_m, c*uz_m]) +beam = picmi.Species( + particle_type = 'electron', + name = 'beam', + initial_distribution = gaussian_bunch_distribution) + +# Laser +e_max = 16e12 +position_z = 9e-06 +profile_t_peak = 30.e-15 +profile_focal_distance = 100e-06 +laser = picmi.GaussianLaser( + wavelength = 0.8e-06, + waist = 5e-06, + duration = 15e-15, + focal_position = [0, 0, profile_focal_distance + position_z], + centroid_position = [0, 0, position_z - c*profile_t_peak], + propagation_direction = [0, 0, 1], + polarization_direction = [0, 1, 0], + E0 = e_max, + fill_in = False) +laser_antenna = picmi.LaserAntenna( + position = [0., 0., position_z], + normal_vector = [0, 0, 1]) + +# Electromagnetic solver +solver = picmi.ElectromagneticSolver( + grid = grid, + method = 'Yee', + cfl = 1., + divE_cleaning = 0) + +# Diagnostics +diag_field_list = ["B", "E", "J", "rho"] +field_diag = picmi.FieldDiagnostic( + name = 'diag1', + grid = grid, + period = 200, + data_list = diag_field_list) + +# Set up simulation +sim = picmi.Simulation( + solver = solver, + max_steps = max_steps, + verbose = 1, + particle_shape = 'cubic', + warpx_use_filter = 1) + +# Add plasma electrons +sim.add_species( + electrons, + layout = picmi.GriddedLayout(grid = grid, n_macroparticle_per_cell = [1, 1, 1])) + +# Add beam electrons +sim.add_species( + beam, + layout = picmi.PseudoRandomLayout(grid = grid, n_macroparticles = 100)) + +# Add laser +sim.add_laser( + laser, + injection_method = laser_antenna) + +# Add diagnostics +sim.add_diagnostic(field_diag) + +# Write input file that can be used to run with the compiled version +sim.write_input_file(file_name = 'inputs_2d_picmi') + +# Initialize inputs and WarpX instance +sim.initialize_inputs() +sim.initialize_warpx() + +# Advance simulation until last time step +sim.step(max_steps) From ba41e8d306c00a301d6e9a08daafa85261ec9975 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 21 Dec 2021 11:48:32 -0800 Subject: [PATCH 02/22] Add PICMI Script for 3D Case --- .../laser_acceleration/PICMI_inputs_3d.py | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100755 Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py new file mode 100755 index 00000000000..617ea98792e --- /dev/null +++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py @@ -0,0 +1,121 @@ +from pywarpx import picmi + +# Physical constants +c = picmi.constants.c +q_e = picmi.constants.q_e + +# Number of time steps +max_steps = 1000 + +# Number of cells +nx = 64 +ny = 64 +nz = 512 + +# Physical domain +xmin = -30e-06 +xmax = 30e-06 +ymin = -30e-06 +ymax = 30e-06 +zmin = -56e-06 +zmax = 12e-06 + +# Domain decomposition +max_grid_size = 64 +blocking_factor = 32 + +# Create grid +grid = picmi.Cartesian3DGrid( + number_of_cells = [nx, ny, nz], + lower_bound = [xmin, ymin, zmin], + upper_bound = [xmax, ymax, zmax], + lower_boundary_conditions = ['periodic', 'periodic', 'dirichlet'], + upper_boundary_conditions = ['periodic', 'periodic', 'dirichlet'], + lower_boundary_conditions_particles = ['periodic', 'periodic', 'absorbing'], + upper_boundary_conditions_particles = ['periodic', 'periodic', 'absorbing'], + moving_window_velocity = [0., 0., c], + warpx_max_grid_size = max_grid_size, + warpx_blocking_factor = blocking_factor) + +# Particles: plasma electrons +plasma_density = 2e23 +plasma_xmin = -20e-06 +plasma_ymin = -20e-06 +plasma_zmin = 10e-06 +plasma_xmax = 20e-06 +plasma_ymax = 20e-06 +plasma_zmax = None +uniform_distribution = picmi.UniformDistribution( + density = plasma_density, + lower_bound = [plasma_xmin, plasma_ymin, plasma_zmin], + upper_bound = [plasma_xmax, plasma_ymax, plasma_zmax], + fill_in = True) +electrons = picmi.Species( + particle_type = 'electron', + name = 'electrons', + initial_distribution = uniform_distribution) + +# Laser +e_max = 16e12 +position_z = 9e-06 +profile_t_peak = 30.e-15 +profile_focal_distance = 100e-06 +laser = picmi.GaussianLaser( + wavelength = 0.8e-06, + waist = 5e-06, + duration = 15e-15, + focal_position = [0, 0, profile_focal_distance + position_z], + centroid_position = [0, 0, position_z - c*profile_t_peak], + propagation_direction = [0, 0, 1], + polarization_direction = [0, 1, 0], + E0 = e_max, + fill_in = False) +laser_antenna = picmi.LaserAntenna( + position = [0., 0., position_z], + normal_vector = [0, 0, 1]) + +# Electromagnetic solver +solver = picmi.ElectromagneticSolver( + grid = grid, + method = 'Yee', + cfl = 1., + divE_cleaning = 0) + +# Diagnostics +diag_field_list = ["B", "E", "J", "rho"] +field_diag = picmi.FieldDiagnostic( + name = 'diag1', + grid = grid, + period = 1000, + data_list = diag_field_list) + +# Set up simulation +sim = picmi.Simulation( + solver = solver, + max_steps = max_steps, + verbose = 1, + particle_shape = 'cubic', + warpx_use_filter = 1) + +# Add plasma electrons +sim.add_species( + electrons, + layout = picmi.GriddedLayout(grid = grid, n_macroparticle_per_cell = [1, 1, 1])) + +# Add laser +sim.add_laser( + laser, + injection_method = laser_antenna) + +# Add diagnostics +sim.add_diagnostic(field_diag) + +# Write input file that can be used to run with the compiled version +sim.write_input_file(file_name = 'inputs_3d_picmi') + +# Initialize inputs and WarpX instance +sim.initialize_inputs() +sim.initialize_warpx() + +# Advance simulation until last time step +sim.step(max_steps) From 24f486ce26bd10f3082df1f7548349b161d89b3d Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 21 Dec 2021 11:50:23 -0800 Subject: [PATCH 03/22] Cleaning --- .../Physics_applications/laser_acceleration/PICMI_inputs_2d.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py index fdc1ed5f682..7786d4f8684 100755 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py +++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py @@ -108,7 +108,7 @@ field_diag = picmi.FieldDiagnostic( name = 'diag1', grid = grid, - period = 200, + period = 1000, data_list = diag_field_list) # Set up simulation From 2e66abb527c740876b55b97762ffbf34e41b9870 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 21 Dec 2021 14:03:56 -0800 Subject: [PATCH 04/22] Add PICMI Script for 1D Case --- .../laser_acceleration/PICMI_inputs_1d.py | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100755 Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py new file mode 100755 index 00000000000..49ab37aa8b0 --- /dev/null +++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py @@ -0,0 +1,115 @@ +from pywarpx import picmi + +# Physical constants +c = picmi.constants.c +q_e = picmi.constants.q_e + +# Number of time steps +max_steps = 1000 + +# Number of cells +nz = 512 + +# Physical domain +zmin = -56e-06 +zmax = 12e-06 + +# Domain decomposition +max_grid_size = 64 +blocking_factor = 32 + +# Create grid +grid = picmi.Cartesian1DGrid( + number_of_cells = [nz], + lower_bound = [zmin], + upper_bound = [zmax], + lower_boundary_conditions = ['dirichlet'], + upper_boundary_conditions = ['dirichlet'], + lower_boundary_conditions_particles = ['absorbing'], + upper_boundary_conditions_particles = ['absorbing'], + moving_window_velocity = [0., 0., c], + warpx_max_grid_size = max_grid_size, + warpx_blocking_factor = blocking_factor) + +# Particles: plasma electrons +plasma_density = 2e23 +plasma_xmin = None +plasma_ymin = None +plasma_zmin = 10e-06 +plasma_xmax = None +plasma_ymax = None +plasma_zmax = None +uniform_distribution = picmi.UniformDistribution( + density = plasma_density, + lower_bound = [plasma_xmin, plasma_ymin, plasma_zmin], + upper_bound = [plasma_xmax, plasma_ymax, plasma_zmax], + fill_in = True) +electrons = picmi.Species( + particle_type = 'electron', + name = 'electrons', + initial_distribution = uniform_distribution) + +# Laser +e_max = 16e12 +position_z = 9e-06 +profile_t_peak = 30.e-15 +profile_focal_distance = 100e-06 +laser = picmi.GaussianLaser( + wavelength = 0.8e-06, + waist = 5e-06, + duration = 15e-15, + focal_position = [0, 0, profile_focal_distance + position_z], + centroid_position = [0, 0, position_z - c*profile_t_peak], + propagation_direction = [0, 0, 1], + polarization_direction = [0, 1, 0], + E0 = e_max, + fill_in = False) +laser_antenna = picmi.LaserAntenna( + position = [0., 0., position_z], + normal_vector = [0, 0, 1]) + +# Electromagnetic solver +solver = picmi.ElectromagneticSolver( + grid = grid, + method = 'Yee', + cfl = 0.9, + divE_cleaning = 0) + +# Diagnostics +diag_field_list = ["B", "E", "J", "rho"] +field_diag = picmi.FieldDiagnostic( + name = 'diag1', + grid = grid, + period = 1000, + data_list = diag_field_list) + +# Set up simulation +sim = picmi.Simulation( + solver = solver, + max_steps = max_steps, + verbose = 1, + particle_shape = 'cubic', + warpx_use_filter = 1) + +# Add plasma electrons +sim.add_species( + electrons, + layout = picmi.GriddedLayout(grid = grid, n_macroparticle_per_cell = [10])) + +# Add laser +sim.add_laser( + laser, + injection_method = laser_antenna) + +# Add diagnostics +sim.add_diagnostic(field_diag) + +# Write input file that can be used to run with the compiled version +sim.write_input_file(file_name = 'inputs_1d_picmi') + +# Initialize inputs and WarpX instance +sim.initialize_inputs() +sim.initialize_warpx() + +# Advance simulation until last time step +sim.step(max_steps) From 86298a92595cfc553204a909a53ddd8c1feab9e1 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 21 Dec 2021 14:55:21 -0800 Subject: [PATCH 05/22] Add PICMI Script for RZ Case --- .../laser_acceleration/PICMI_inputs_rz.py | 149 ++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100755 Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py new file mode 100755 index 00000000000..75cb9047cc2 --- /dev/null +++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py @@ -0,0 +1,149 @@ +from pywarpx import picmi + +# Physical constants +c = picmi.constants.c +q_e = picmi.constants.q_e + +# Number of time steps +max_steps = 1000 + +# Number of cells +nr = 64 +nz = 512 + +# Physical domain +rmin = 0 +rmax = 30e-06 +zmin = -56e-06 +zmax = 12e-06 + +# Domain decomposition +max_grid_size = 64 +blocking_factor = 32 + +# Create grid +grid = picmi.CylindricalGrid( + number_of_cells = [nr, nz], + n_azimuthal_modes = 2, + lower_bound = [rmin, zmin], + upper_bound = [rmax, zmax], + lower_boundary_conditions = ['none', 'dirichlet'], + upper_boundary_conditions = ['dirichlet', 'dirichlet'], + lower_boundary_conditions_particles = ['absorbing', 'absorbing'], + upper_boundary_conditions_particles = ['absorbing', 'absorbing'], + moving_window_zvelocity = c, + warpx_max_grid_size = max_grid_size, + warpx_blocking_factor = blocking_factor) + +# Particles: plasma electrons +plasma_density = 2e23 +plasma_xmin = -20e-06 +plasma_ymin = None +plasma_zmin = 10e-06 +plasma_xmax = 20e-06 +plasma_ymax = None +plasma_zmax = None +uniform_distribution = picmi.UniformDistribution( + density = plasma_density, + lower_bound = [plasma_xmin, plasma_ymin, plasma_zmin], + upper_bound = [plasma_xmax, plasma_ymax, plasma_zmax], + fill_in = True) +electrons = picmi.Species( + particle_type = 'electron', + name = 'electrons', + initial_distribution = uniform_distribution) + +# Particles: beam electrons +q_tot = 1e-12 +x_m = 0. +y_m = 0. +z_m = -28e-06 +x_rms = 0.5e-06 +y_rms = 0.5e-06 +z_rms = 0.5e-06 +ux_m = 0. +uy_m = 0. +uz_m = 500. +ux_th = 2. +uy_th = 2. +uz_th = 50. +gaussian_bunch_distribution = picmi.GaussianBunchDistribution( + n_physical_particles = q_tot / q_e, + rms_bunch_size = [x_rms, y_rms, z_rms], + rms_velocity = [c*ux_th, c*uy_th, c*uz_th], + centroid_position = [x_m, y_m, z_m], + centroid_velocity = [c*ux_m, c*uy_m, c*uz_m]) +beam = picmi.Species( + particle_type = 'electron', + name = 'beam', + initial_distribution = gaussian_bunch_distribution) + +# Laser +e_max = 16e12 +position_z = 9e-06 +profile_t_peak = 30.e-15 +profile_focal_distance = 100e-06 +laser = picmi.GaussianLaser( + wavelength = 0.8e-06, + waist = 5e-06, + duration = 15e-15, + focal_position = [0, 0, profile_focal_distance + position_z], + centroid_position = [0, 0, position_z - c*profile_t_peak], + propagation_direction = [0, 0, 1], + polarization_direction = [0, 1, 0], + E0 = e_max, + fill_in = False) +laser_antenna = picmi.LaserAntenna( + position = [0., 0., position_z], + normal_vector = [0, 0, 1]) + +# Electromagnetic solver +solver = picmi.ElectromagneticSolver( + grid = grid, + method = 'Yee', + cfl = 1., + divE_cleaning = 0) + +# Diagnostics +diag_field_list = ["B", "E", "J", "rho"] +field_diag = picmi.FieldDiagnostic( + name = 'diag1', + grid = grid, + period = 1000, + data_list = diag_field_list) + +# Set up simulation +sim = picmi.Simulation( + solver = solver, + max_steps = max_steps, + verbose = 1, + particle_shape = 'cubic', + warpx_use_filter = 1) + +# Add plasma electrons +sim.add_species( + electrons, + layout = picmi.GriddedLayout(grid = grid, n_macroparticle_per_cell = [1, 4, 1])) + +# Add beam electrons +sim.add_species( + beam, + layout = picmi.PseudoRandomLayout(grid = grid, n_macroparticles = 100)) + +# Add laser +sim.add_laser( + laser, + injection_method = laser_antenna) + +# Add diagnostics +sim.add_diagnostic(field_diag) + +# Write input file that can be used to run with the compiled version +sim.write_input_file(file_name = 'inputs_rz_picmi') + +# Initialize inputs and WarpX instance +sim.initialize_inputs() +sim.initialize_warpx() + +# Advance simulation until last time step +sim.step(max_steps) From 901f78f40a9f49df8d2f1c54850a64acebfd353f Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Wed, 22 Dec 2021 10:22:41 -0800 Subject: [PATCH 06/22] Remove Old PICMI Script --- .../PICMI_inputs_laser_acceleration.py | 146 ------------------ 1 file changed, 146 deletions(-) delete mode 100755 Examples/Physics_applications/laser_acceleration/PICMI_inputs_laser_acceleration.py diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_laser_acceleration.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_laser_acceleration.py deleted file mode 100755 index 7e75e14de26..00000000000 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_laser_acceleration.py +++ /dev/null @@ -1,146 +0,0 @@ -#!/usr/bin/env python3 -# -import numpy as np -from pywarpx import picmi -#from warp import picmi - -constants = picmi.constants - -########################## -# physics parameters -########################## - -# --- laser - -laser_a0 = 4. # Normalized potential vector -laser_wavelength = 8e-07 # Wavelength of the laser (in meters) -laser_waist = 5e-06 # Waist of the laser (in meters) -laser_duration = 15e-15 # Duration of the laser (in seconds) -laser_polarization = 0. # Polarization angle (in rad) -laser_injection_loc = 9.e-6 # Position of injection (in meters, along z) -laser_focal_distance = 100.e-6 # Focal distance from the injection (in meters) -laser_t_peak = 30.e-15 # The time at which the laser reaches its peak - # at the antenna injection location (in seconds) -# --- plasma - -plasma_density = 1.e24 -plasma_min = [-20.e-6, -20.e-6, 0.0e-6] -plasma_max = [ 20.e-6, 20.e-6, 1.e-3] - - -########################## -# numerics parameters -########################## - -# --- Nb time steps - -max_steps = 10 - -# --- grid - -nx = 64 -ny = 64 -nz = 480 - -xmin = 1.5*plasma_min[0] -xmax = 1.5*plasma_max[0] -ymin = 1.5*plasma_min[1] -ymax = 1.5*plasma_max[1] -zmin = -56.e-6 -zmax = 12.e-6 - -moving_window_velocity = [0., 0., constants.c] - -number_per_cell_each_dim = [2, 2, 1] - -########################## -# physics components -########################## - -# --- laser - -laser = picmi.GaussianLaser(wavelength = laser_wavelength, - waist = laser_waist, - duration = laser_duration, - focal_position = [0., 0., laser_focal_distance + laser_injection_loc], - centroid_position = [0., 0., laser_injection_loc - constants.c*laser_t_peak], - polarization_direction = [np.cos(laser_polarization), np.sin(laser_polarization), 0.], - propagation_direction = [0,0,1], - E0 = laser_a0*2.*np.pi*constants.m_e*constants.c**2/(constants.q_e*laser_wavelength)) # Maximum amplitude of the laser field (in V/m) - -laser_antenna = picmi.LaserAntenna(position = [0., 0., laser_injection_loc], # This point is on the laser plane - normal_vector = [0., 0., 1.]) # The plane normal direction - -# --- plasma - -uniform_plasma = picmi.UniformDistribution(density = plasma_density, - lower_bound = plasma_min, - upper_bound = plasma_max, - fill_in = True) - -electrons = picmi.Species(particle_type = 'electron', - name = 'electrons', - initial_distribution = uniform_plasma) - - -########################## -# numerics components -########################## - -grid = picmi.Cartesian3DGrid(number_of_cells = [nx, ny, nz], - lower_bound = [xmin, ymin, zmin], - upper_bound = [xmax, ymax, zmax], - lower_boundary_conditions = ['periodic', 'periodic', 'open'], - upper_boundary_conditions = ['periodic', 'periodic', 'open'], - lower_boundary_conditions_particles = ['periodic', 'periodic', 'absorbing'], - upper_boundary_conditions_particles = ['periodic', 'periodic', 'absorbing'], - moving_window_velocity = moving_window_velocity, - warpx_max_grid_size=32) - -solver = picmi.ElectromagneticSolver(grid=grid, method='CKC', cfl=1.) - - -########################## -# diagnostics -########################## - -diag_field_list = ["rho", "E", "B", "J"] -field_diag1 = picmi.FieldDiagnostic(name = 'diag1', - grid = grid, - period = 10, - write_dir = '.', - warpx_file_prefix = 'Python_LaserAccelerationMR_plt', - data_list = diag_field_list) - -part_diag1 = picmi.ParticleDiagnostic(name = 'diag1', - period = 10, - species = [electrons], - data_list = ['ux', 'uy', 'uz', 'weighting']) - -########################## -# simulation setup -########################## - -sim = picmi.Simulation(solver = solver, - max_steps = max_steps, - verbose = 1, - warpx_current_deposition_algo = 'esirkepov', - warpx_use_filter = 0) - -sim.add_species(electrons, layout=picmi.GriddedLayout(grid=grid, n_macroparticle_per_cell=number_per_cell_each_dim)) - -sim.add_laser(laser, injection_method=laser_antenna) - -sim.add_diagnostic(field_diag1) -sim.add_diagnostic(part_diag1) - -########################## -# simulation run -########################## - -# write_inputs will create an inputs file that can be used to run -# with the compiled version. -#sim.write_input_file(file_name = 'inputs_from_PICMI') - -# Alternatively, sim.step will run WarpX, controlling it from Python -sim.step(max_steps) From 379372c480c5a0ffe0135c897990f2b124fb9198 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Wed, 22 Dec 2021 10:52:51 -0800 Subject: [PATCH 07/22] Remove Old Test Python_LaserAccelerationMR --- Regression/WarpX-tests.ini | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/Regression/WarpX-tests.ini b/Regression/WarpX-tests.ini index a74dbdca8ca..116eeb8fc3b 100644 --- a/Regression/WarpX-tests.ini +++ b/Regression/WarpX-tests.ini @@ -1657,24 +1657,6 @@ compareParticles = 1 particleTypes = electrons beam analysisRoutine = Examples/analysis_default_regression.py -[Python_LaserAccelerationMR] -buildDir = . -inputFile = Examples/Physics_applications/laser_acceleration/PICMI_inputs_laser_acceleration.py -runtime_params = -customRunCmd = python3 PICMI_inputs_laser_acceleration.py -dim = 3 -addToCompileString = USE_PYTHON_MAIN=TRUE -restartTest = 0 -useMPI = 1 -numprocs = 2 -useOMP = 1 -numthreads = 1 -compileTest = 0 -doVis = 0 -compareParticles = 1 -particleTypes = electrons -analysisRoutine = Examples/analysis_default_regression.py - [Python_Langmuir_2d] buildDir = . inputFile = Examples/Tests/Langmuir/PICMI_inputs_langmuir2d.py From 692ef1a6d7b6732f5bad0f8b7546ee82a6dc7f3d Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Wed, 22 Dec 2021 12:10:06 -0800 Subject: [PATCH 08/22] inputs_3d: Move Inputs From runtime_params --- .../Physics_applications/laser_acceleration/inputs_3d | 8 +++++--- Regression/WarpX-tests.ini | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Examples/Physics_applications/laser_acceleration/inputs_3d b/Examples/Physics_applications/laser_acceleration/inputs_3d index 492f5dd8a94..4429b98396c 100644 --- a/Examples/Physics_applications/laser_acceleration/inputs_3d +++ b/Examples/Physics_applications/laser_acceleration/inputs_3d @@ -1,8 +1,8 @@ ################################# ####### GENERAL PARAMETERS ###### ################################# -max_step = 1000 -amr.n_cell = 64 64 512 +max_step = 100 # for production, run for longer time, e.g. max_step = 1000 +amr.n_cell = 32 32 256 # for production, run with finer mesh, e.g. amr.n_cell = 64 64 512 amr.max_grid_size = 64 # maximum size of each AMReX box, used to decompose the domain amr.blocking_factor = 32 # minimum size of each AMReX box, used to decompose the domain geometry.dims = 3 @@ -28,6 +28,8 @@ warpx.cfl = 1. # if 1., the time step is set to its CFL limit warpx.do_moving_window = 1 warpx.moving_window_dir = z # Only z is supported for the moment warpx.moving_window_v = 1.0 # units of speed of light +warpx.do_dynamic_scheduling = 0 # for production, set this to 1 (default) +warpx.serialize_ics = 1 # for production, set this to 0 (default) # Order of particle shape factors algo.particle_shape = 3 @@ -45,7 +47,7 @@ electrons.xmin = -20.e-6 electrons.xmax = 20.e-6 electrons.ymin = -20.e-6 electrons.ymax = 20.e-6 -electrons.zmin = 10.e-6 +electrons.zmin = 0 electrons.profile = constant electrons.density = 2.e23 # number of electrons per m^3 electrons.momentum_distribution_type = "at_rest" diff --git a/Regression/WarpX-tests.ini b/Regression/WarpX-tests.ini index 116eeb8fc3b..59980228d78 100644 --- a/Regression/WarpX-tests.ini +++ b/Regression/WarpX-tests.ini @@ -877,7 +877,7 @@ analysisRoutine = Examples/Modules/laser_injection/analysis_1d.py [LaserAcceleration] buildDir = . inputFile = Examples/Physics_applications/laser_acceleration/inputs_3d -runtime_params = warpx.do_dynamic_scheduling=0 amr.n_cell=32 32 256 max_step=100 electrons.zmin=0.e-6 warpx.serialize_ics=1 +runtime_params = dim = 3 addToCompileString = restartTest = 0 @@ -911,7 +911,7 @@ analysisRoutine = Examples/analysis_default_regression.py [LaserAcceleration_single_precision_comms] buildDir = . inputFile = Examples/Physics_applications/laser_acceleration/inputs_3d -runtime_params = warpx.do_dynamic_scheduling=0 amr.n_cell=32 32 256 max_step=100 electrons.zmin=0.e-6 warpx.serialize_ics=1 warpx.do_single_precision_comms=1 +runtime_params = warpx.do_single_precision_comms=1 dim = 3 addToCompileString = restartTest = 0 From 6db8d6333b2fda0960b3dbe021902517b4570fca Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Wed, 22 Dec 2021 13:16:08 -0800 Subject: [PATCH 09/22] inputs_2d: Move Inputs From runtime_params --- .../Physics_applications/laser_acceleration/inputs_2d | 9 +++++---- Regression/WarpX-tests.ini | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Examples/Physics_applications/laser_acceleration/inputs_2d b/Examples/Physics_applications/laser_acceleration/inputs_2d index 88ab197ce72..52b613c5617 100644 --- a/Examples/Physics_applications/laser_acceleration/inputs_2d +++ b/Examples/Physics_applications/laser_acceleration/inputs_2d @@ -1,16 +1,16 @@ ################################# ####### GENERAL PARAMETERS ###### ################################# -max_step = 1000 +max_step = 200 # for production, run for longer time, e.g. max_step = 1000 amr.n_cell = 64 512 amr.max_grid_size = 64 # maximum size of each AMReX box, used to decompose the domain amr.blocking_factor = 32 # minimum size of each AMReX box, used to decompose the domain geometry.dims = 2 geometry.prob_lo = -30.e-6 -56.e-6 # physical domain geometry.prob_hi = 30.e-6 12.e-6 -amr.max_level = 0 # Maximum level in hierarchy (1 might be unstable, >1 is not supported) -# warpx.fine_tag_lo = -5.e-6 -35.e-6 -# warpx.fine_tag_hi = 5.e-6 -25.e-6 +amr.max_level = 1 # Maximum level in hierarchy (1 might be unstable, >1 is not supported) +warpx.fine_tag_lo = -5.e-6 -35.e-6 +warpx.fine_tag_hi = 5.e-6 -25.e-6 ################################# ####### Boundary condition ###### @@ -28,6 +28,7 @@ warpx.cfl = 1. # if 1., the time step is set to its CFL limit warpx.do_moving_window = 1 warpx.moving_window_dir = z # Only z is supported for the moment warpx.moving_window_v = 1.0 # units of speed of light +warpx.serialize_ics = 1 # for production, set this to 0 (default) # Order of particle shape factors algo.particle_shape = 3 diff --git a/Regression/WarpX-tests.ini b/Regression/WarpX-tests.ini index 59980228d78..e6f5292a707 100644 --- a/Regression/WarpX-tests.ini +++ b/Regression/WarpX-tests.ini @@ -944,7 +944,7 @@ analysisRoutine = Examples/analysis_default_regression.py [LaserAccelerationMR] buildDir = . inputFile = Examples/Physics_applications/laser_acceleration/inputs_2d -runtime_params = amr.max_level=1 max_step=200 warpx.serialize_ics=1 warpx.fine_tag_lo=-5.e-6 -35.e-6 warpx.fine_tag_hi=5.e-6 -25.e-6 +runtime_params = dim = 2 addToCompileString = restartTest = 0 @@ -961,7 +961,7 @@ analysisRoutine = Examples/analysis_default_regression.py [RefinedInjection] buildDir = . inputFile = Examples/Physics_applications/laser_acceleration/inputs_2d -runtime_params = amr.max_level=1 max_step=200 warpx.serialize_ics=1 warpx.fine_tag_lo=-5.e-6 -35.e-6 warpx.fine_tag_hi=5.e-6 -25.e-6 warpx.refine_plasma=1 +runtime_params = warpx.refine_plasma=1 dim = 2 addToCompileString = restartTest = 0 From 0ceab68f08b853cc63b1c8131593eb0139e48acd Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Wed, 22 Dec 2021 13:38:23 -0800 Subject: [PATCH 10/22] Update PICMI Script for 2D Case --- .../laser_acceleration/PICMI_inputs_2d.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py index 7786d4f8684..bd356215a68 100755 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py +++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py @@ -5,7 +5,7 @@ q_e = picmi.constants.q_e # Number of time steps -max_steps = 1000 +max_steps = 200 # Number of cells nx = 64 @@ -16,6 +16,10 @@ xmax = 30e-06 zmin = -56e-06 zmax = 12e-06 +xmin_refined = -5e-06 +xmax_refined = 5e-06 +zmin_refined = -35e-06 +zmax_refined = -25e-06 # Domain decomposition max_grid_size = 64 @@ -32,7 +36,8 @@ upper_boundary_conditions_particles = ['absorbing', 'absorbing'], moving_window_velocity = [0., c], warpx_max_grid_size = max_grid_size, - warpx_blocking_factor = blocking_factor) + warpx_blocking_factor = blocking_factor, + refined_regions = [[1, [xmin_refined, zmin_refined], [xmax_refined, zmax_refined]]]) # Particles: plasma electrons plasma_density = 2e23 @@ -117,7 +122,8 @@ max_steps = max_steps, verbose = 1, particle_shape = 'cubic', - warpx_use_filter = 1) + warpx_use_filter = 1, + warpx_serialize_ics = 1) # Add plasma electrons sim.add_species( From 0dc1d0c31963a745df90dba250b194b5c8734640 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Wed, 22 Dec 2021 13:41:29 -0800 Subject: [PATCH 11/22] Update PICMI Script for 3D Case --- .../laser_acceleration/PICMI_inputs_3d.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py index 617ea98792e..2d9be34f85a 100755 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py +++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py @@ -5,12 +5,12 @@ q_e = picmi.constants.q_e # Number of time steps -max_steps = 1000 +max_steps = 100 # Number of cells -nx = 64 -ny = 64 -nz = 512 +nx = 32 +ny = 32 +nz = 256 # Physical domain xmin = -30e-06 @@ -41,7 +41,7 @@ plasma_density = 2e23 plasma_xmin = -20e-06 plasma_ymin = -20e-06 -plasma_zmin = 10e-06 +plasma_zmin = 0 plasma_xmax = 20e-06 plasma_ymax = 20e-06 plasma_zmax = None @@ -95,7 +95,9 @@ max_steps = max_steps, verbose = 1, particle_shape = 'cubic', - warpx_use_filter = 1) + warpx_use_filter = 1, + warpx_serialize_ics = 1, + warpx_do_dynamic_scheduling = 0) # Add plasma electrons sim.add_species( From 04e8362bf751dc2d8ffaf232be2d256710f44029 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Wed, 22 Dec 2021 13:48:07 -0800 Subject: [PATCH 12/22] inputs_1d: Move Inputs From runtime_params --- Examples/Physics_applications/laser_acceleration/inputs_1d | 6 ++++-- Regression/WarpX-tests.ini | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Examples/Physics_applications/laser_acceleration/inputs_1d b/Examples/Physics_applications/laser_acceleration/inputs_1d index f58c7375fc5..9e88ca7db66 100644 --- a/Examples/Physics_applications/laser_acceleration/inputs_1d +++ b/Examples/Physics_applications/laser_acceleration/inputs_1d @@ -1,8 +1,8 @@ ################################# ####### GENERAL PARAMETERS ###### ################################# -max_step = 1000 -amr.n_cell = 512 +max_step = 100 +amr.n_cell = 256 amr.max_grid_size = 64 # maximum size of each AMReX box, used to decompose the domain amr.blocking_factor = 32 # minimum size of each AMReX box, used to decompose the domain geometry.dims = 1 @@ -26,6 +26,8 @@ warpx.cfl = 0.9 # if 1., the time step is set to its CFL limit warpx.do_moving_window = 1 warpx.moving_window_dir = z # Only z is supported for the moment warpx.moving_window_v = 1.0 # units of speed of light +warpx.do_dynamic_scheduling = 0 +warpx.serialize_ics = 1 # Order of particle shape factors algo.particle_shape = 3 diff --git a/Regression/WarpX-tests.ini b/Regression/WarpX-tests.ini index e6f5292a707..cfb2a438f42 100644 --- a/Regression/WarpX-tests.ini +++ b/Regression/WarpX-tests.ini @@ -894,7 +894,7 @@ analysisRoutine = Examples/analysis_default_regression.py [LaserAcceleration_1d] buildDir = . inputFile = Examples/Physics_applications/laser_acceleration/inputs_1d -runtime_params = warpx.do_dynamic_scheduling=0 amr.n_cell=256 max_step=100 electrons.zmin=10.e-6 warpx.serialize_ics=1 +runtime_params = dim = 1 addToCompileString = restartTest = 0 From f413939b99516ffe1889ceefa1f4a85b0c992754 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Wed, 22 Dec 2021 14:03:20 -0800 Subject: [PATCH 13/22] inputs_2d_rz: Move Inputs From runtime_params --- Examples/Physics_applications/laser_acceleration/inputs_2d_rz | 4 +++- Regression/WarpX-tests.ini | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Examples/Physics_applications/laser_acceleration/inputs_2d_rz b/Examples/Physics_applications/laser_acceleration/inputs_2d_rz index 5647e9e22c6..f5746620b57 100644 --- a/Examples/Physics_applications/laser_acceleration/inputs_2d_rz +++ b/Examples/Physics_applications/laser_acceleration/inputs_2d_rz @@ -1,7 +1,7 @@ ################################# ####### GENERAL PARAMETERS ###### ################################# -max_step = 1000 +max_step = 10 amr.n_cell = 64 512 amr.max_grid_size = 64 # maximum size of each AMReX box, used to decompose the domain amr.blocking_factor = 32 # minimum size of each AMReX box, used to decompose the domain @@ -86,3 +86,5 @@ diag1.intervals = 200 diag1.diag_type = Full diag1.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz rho diag1.dump_rz_modes = 1 +diag1.electrons.variables = w ux uy uz +diag1.beam.variables = w ux uy uz diff --git a/Regression/WarpX-tests.ini b/Regression/WarpX-tests.ini index cfb2a438f42..73d6e80e7ad 100644 --- a/Regression/WarpX-tests.ini +++ b/Regression/WarpX-tests.ini @@ -1643,7 +1643,7 @@ analysisRoutine = Examples/analysis_default_regression.py [LaserAccelerationRZ] buildDir = . inputFile = Examples/Physics_applications/laser_acceleration/inputs_2d_rz -runtime_params = diag1.electrons.variables=w ux uy uz diag1.beam.variables=w ux uy uz max_step=10 +runtime_params = dim = 2 addToCompileString = USE_RZ=TRUE restartTest = 0 From cb861a2e3237c3f1416e1f10169af131aaf335e8 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Wed, 22 Dec 2021 14:04:27 -0800 Subject: [PATCH 14/22] Rename inputs_2d_rz as inputs_rz --- .../laser_acceleration/{inputs_2d_rz => inputs_rz} | 0 Regression/WarpX-tests.ini | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename Examples/Physics_applications/laser_acceleration/{inputs_2d_rz => inputs_rz} (100%) diff --git a/Examples/Physics_applications/laser_acceleration/inputs_2d_rz b/Examples/Physics_applications/laser_acceleration/inputs_rz similarity index 100% rename from Examples/Physics_applications/laser_acceleration/inputs_2d_rz rename to Examples/Physics_applications/laser_acceleration/inputs_rz diff --git a/Regression/WarpX-tests.ini b/Regression/WarpX-tests.ini index 73d6e80e7ad..0650c2e7369 100644 --- a/Regression/WarpX-tests.ini +++ b/Regression/WarpX-tests.ini @@ -1642,7 +1642,7 @@ analysisRoutine = Examples/analysis_default_regression.py [LaserAccelerationRZ] buildDir = . -inputFile = Examples/Physics_applications/laser_acceleration/inputs_2d_rz +inputFile = Examples/Physics_applications/laser_acceleration/inputs_rz runtime_params = dim = 2 addToCompileString = USE_RZ=TRUE From 58365342f4ef672b65b9135649034bd3dfbc8178 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Wed, 22 Dec 2021 14:05:24 -0800 Subject: [PATCH 15/22] Update PICMI Script for 1D Case --- .../laser_acceleration/PICMI_inputs_1d.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py index 49ab37aa8b0..314d876c8f2 100755 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py +++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py @@ -5,10 +5,10 @@ q_e = picmi.constants.q_e # Number of time steps -max_steps = 1000 +max_steps = 100 # Number of cells -nz = 512 +nz = 256 # Physical domain zmin = -56e-06 @@ -89,7 +89,9 @@ max_steps = max_steps, verbose = 1, particle_shape = 'cubic', - warpx_use_filter = 1) + warpx_use_filter = 1, + warpx_serialize_ics = 1, + warpx_do_dynamic_scheduling = 0) # Add plasma electrons sim.add_species( From f81541fa1acda198effedbd44206e38d3f8519d6 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Wed, 22 Dec 2021 14:11:59 -0800 Subject: [PATCH 16/22] Update PICMI Script for RZ Case --- .../laser_acceleration/PICMI_inputs_rz.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py index 75cb9047cc2..1b510c0a93d 100755 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py +++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py @@ -5,7 +5,7 @@ q_e = picmi.constants.q_e # Number of time steps -max_steps = 1000 +max_steps = 10 # Number of cells nr = 64 @@ -109,8 +109,14 @@ field_diag = picmi.FieldDiagnostic( name = 'diag1', grid = grid, - period = 1000, + period = 10, data_list = diag_field_list) +diag_particle_list = ["weighting", "momentum"] +particle_diag = picmi.ParticleDiagnostic( + name = 'diag1', + period = 10, + species = [electrons, beam], + data_list = diag_particle_list) # Set up simulation sim = picmi.Simulation( @@ -137,6 +143,7 @@ # Add diagnostics sim.add_diagnostic(field_diag) +sim.add_diagnostic(particle_diag) # Write input file that can be used to run with the compiled version sim.write_input_file(file_name = 'inputs_rz_picmi') From 3abaf2096e4e5601116b9761b6778244f71dcbf4 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Wed, 22 Dec 2021 14:12:41 -0800 Subject: [PATCH 17/22] inputs_rz: Fix Diagnostic Interval --- Examples/Physics_applications/laser_acceleration/inputs_rz | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/Physics_applications/laser_acceleration/inputs_rz b/Examples/Physics_applications/laser_acceleration/inputs_rz index f5746620b57..b76c40a51b4 100644 --- a/Examples/Physics_applications/laser_acceleration/inputs_rz +++ b/Examples/Physics_applications/laser_acceleration/inputs_rz @@ -82,7 +82,7 @@ laser1.wavelength = 0.8e-6 # The wavelength of the laser (in m) # Diagnostics diagnostics.diags_names = diag1 -diag1.intervals = 200 +diag1.intervals = 10 diag1.diag_type = Full diag1.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz rho diag1.dump_rz_modes = 1 From a188bf16fba7117c4f052d4b6e527368c7894350 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Wed, 22 Dec 2021 14:14:37 -0800 Subject: [PATCH 18/22] Fix Diagnostic Interval For All Inputs --- .../Physics_applications/laser_acceleration/PICMI_inputs_1d.py | 2 +- .../Physics_applications/laser_acceleration/PICMI_inputs_2d.py | 2 +- .../Physics_applications/laser_acceleration/PICMI_inputs_3d.py | 2 +- Examples/Physics_applications/laser_acceleration/inputs_1d | 2 +- Examples/Physics_applications/laser_acceleration/inputs_3d | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py index 314d876c8f2..f04854e9eb8 100755 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py +++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py @@ -80,7 +80,7 @@ field_diag = picmi.FieldDiagnostic( name = 'diag1', grid = grid, - period = 1000, + period = 100, data_list = diag_field_list) # Set up simulation diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py index bd356215a68..9f290d66d6a 100755 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py +++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py @@ -113,7 +113,7 @@ field_diag = picmi.FieldDiagnostic( name = 'diag1', grid = grid, - period = 1000, + period = 200, data_list = diag_field_list) # Set up simulation diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py index 2d9be34f85a..e52b4695696 100755 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py +++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py @@ -86,7 +86,7 @@ field_diag = picmi.FieldDiagnostic( name = 'diag1', grid = grid, - period = 1000, + period = 100, data_list = diag_field_list) # Set up simulation diff --git a/Examples/Physics_applications/laser_acceleration/inputs_1d b/Examples/Physics_applications/laser_acceleration/inputs_1d index 9e88ca7db66..6d37fb48ccd 100644 --- a/Examples/Physics_applications/laser_acceleration/inputs_1d +++ b/Examples/Physics_applications/laser_acceleration/inputs_1d @@ -63,6 +63,6 @@ laser1.wavelength = 0.8e-6 # The wavelength of the laser (in m) # Diagnostics diagnostics.diags_names = diag1 -diag1.intervals = 200 +diag1.intervals = 100 diag1.diag_type = Full diag1.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz rho diff --git a/Examples/Physics_applications/laser_acceleration/inputs_3d b/Examples/Physics_applications/laser_acceleration/inputs_3d index 4429b98396c..dea1d2ccb47 100644 --- a/Examples/Physics_applications/laser_acceleration/inputs_3d +++ b/Examples/Physics_applications/laser_acceleration/inputs_3d @@ -70,6 +70,6 @@ laser1.wavelength = 0.8e-6 # The wavelength of the laser (in m) # Diagnostics diagnostics.diags_names = diag1 -diag1.intervals = 1000 +diag1.intervals = 100 diag1.diag_type = Full diag1.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz rho From af5ce49ae5b907317eed347ea06a616a44a9db27 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Wed, 22 Dec 2021 15:25:58 -0800 Subject: [PATCH 19/22] Add New Test For Each PICMI Script --- .../laser_acceleration/PICMI_inputs_1d.py | 6 +- .../laser_acceleration/PICMI_inputs_2d.py | 6 +- .../laser_acceleration/PICMI_inputs_3d.py | 6 +- .../laser_acceleration/PICMI_inputs_rz.py | 12 ++-- .../Python_LaserAcceleration.json | 25 +++++++ .../Python_LaserAccelerationMR.json | 61 ++++++++++------ .../Python_LaserAccelerationRZ.json | 66 +++++++++++++++++ .../Python_LaserAcceleration_1d.json | 23 ++++++ Regression/WarpX-tests.ini | 72 +++++++++++++++++++ 9 files changed, 247 insertions(+), 30 deletions(-) create mode 100644 Regression/Checksum/benchmarks_json/Python_LaserAcceleration.json create mode 100644 Regression/Checksum/benchmarks_json/Python_LaserAccelerationRZ.json create mode 100644 Regression/Checksum/benchmarks_json/Python_LaserAcceleration_1d.json diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py index f04854e9eb8..7136cdb077c 100755 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py +++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py @@ -76,12 +76,14 @@ divE_cleaning = 0) # Diagnostics -diag_field_list = ["B", "E", "J", "rho"] +diag_field_list = ['B', 'E', 'J', 'rho'] field_diag = picmi.FieldDiagnostic( name = 'diag1', grid = grid, period = 100, - data_list = diag_field_list) + data_list = diag_field_list, + write_dir = '.', + warpx_file_prefix = 'Python_LaserAcceleration_1d_plt') # Set up simulation sim = picmi.Simulation( diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py index 9f290d66d6a..022bc15d3e3 100755 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py +++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py @@ -109,12 +109,14 @@ divE_cleaning = 0) # Diagnostics -diag_field_list = ["B", "E", "J", "rho"] +diag_field_list = ['B', 'E', 'J', 'rho'] field_diag = picmi.FieldDiagnostic( name = 'diag1', grid = grid, period = 200, - data_list = diag_field_list) + data_list = diag_field_list, + write_dir = '.', + warpx_file_prefix = 'Python_LaserAccelerationMR_plt') # Set up simulation sim = picmi.Simulation( diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py index e52b4695696..91f5615a562 100755 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py +++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py @@ -82,12 +82,14 @@ divE_cleaning = 0) # Diagnostics -diag_field_list = ["B", "E", "J", "rho"] +diag_field_list = ['B', 'E', 'J', 'rho'] field_diag = picmi.FieldDiagnostic( name = 'diag1', grid = grid, period = 100, - data_list = diag_field_list) + data_list = diag_field_list, + write_dir = '.', + warpx_file_prefix = 'Python_LaserAcceleration_plt') # Set up simulation sim = picmi.Simulation( diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py index 1b510c0a93d..2b6fe820c94 100755 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py +++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py @@ -105,18 +105,22 @@ divE_cleaning = 0) # Diagnostics -diag_field_list = ["B", "E", "J", "rho"] +diag_field_list = ['B', 'E', 'J', 'rho'] field_diag = picmi.FieldDiagnostic( name = 'diag1', grid = grid, period = 10, - data_list = diag_field_list) -diag_particle_list = ["weighting", "momentum"] + data_list = diag_field_list, + write_dir = '.', + warpx_file_prefix = 'Python_LaserAccelerationRZ_plt') +diag_particle_list = ['weighting', 'momentum'] particle_diag = picmi.ParticleDiagnostic( name = 'diag1', period = 10, species = [electrons, beam], - data_list = diag_particle_list) + data_list = diag_particle_list, + write_dir = '.', + warpx_file_prefix = 'Python_LaserAccelerationRZ_plt') # Set up simulation sim = picmi.Simulation( diff --git a/Regression/Checksum/benchmarks_json/Python_LaserAcceleration.json b/Regression/Checksum/benchmarks_json/Python_LaserAcceleration.json new file mode 100644 index 00000000000..401dc1a96e5 --- /dev/null +++ b/Regression/Checksum/benchmarks_json/Python_LaserAcceleration.json @@ -0,0 +1,25 @@ +{ + "electrons": { + "particle_cpu": 69212.0, + "particle_id": 2655287162.0, + "particle_momentum_x": 1.79212316501518e-20, + "particle_momentum_y": 7.225819832716737e-20, + "particle_momentum_z": 4.231725460519779e-20, + "particle_position_x": 0.7139122621161638, + "particle_position_y": 0.7150340887578206, + "particle_position_z": 1.317577060864619, + "particle_weight": 12926557617.187498 + }, + "lev=0": { + "Bx": 5863879.027613791, + "By": 2411.49823974812, + "Bz": 116025.4367923822, + "Ex": 6267728226590.701, + "Ey": 1670763224821434.0, + "Ez": 104345981838458.8, + "jx": 555687757148559.1, + "jy": 1595895515963762.0, + "jz": 1045266123023548.0, + "rho": 2211742630.95043 + } +} \ No newline at end of file diff --git a/Regression/Checksum/benchmarks_json/Python_LaserAccelerationMR.json b/Regression/Checksum/benchmarks_json/Python_LaserAccelerationMR.json index f00d487d106..cfee789f139 100644 --- a/Regression/Checksum/benchmarks_json/Python_LaserAccelerationMR.json +++ b/Regression/Checksum/benchmarks_json/Python_LaserAccelerationMR.json @@ -1,25 +1,46 @@ { + "beam": { + "particle_cpu": 0.0, + "particle_id": 5050.0, + "particle_momentum_x": 4.561019131383119e-20, + "particle_momentum_y": 4.149842919134552e-20, + "particle_momentum_z": 1.364708476750903e-17, + "particle_position_x": 4.652770082118157e-05, + "particle_position_y": 0.001484501913502292, + "particle_weight": 12483018148921.525 + }, "electrons": { - "particle_cpu": 695224.0, - "particle_id": 290501119140.0, - "particle_momentum_x": 2.36755772669732e-19, - "particle_momentum_y": 1.9290614212841715e-21, - "particle_momentum_z": 1.8938349865018830e-20, - "particle_position_x": 7.0065548820957835, - "particle_position_y": 7.006554897199218, - "particle_position_z": 4.600065455619851, - "particle_weight": 21640883789.062504 + "particle_cpu": 4788.0, + "particle_id": 13694226.0, + "particle_momentum_x": 4.2751178407573573e-20, + "particle_momentum_y": 1.9580305087551049e-19, + "particle_momentum_z": 8.913655221012198e-20, + "particle_position_x": 0.04741929968294934, + "particle_position_y": 0.08483137297620588, + "particle_weight": 119232421874999.98 }, "lev=0": { - "Bx": 2.0570940778040221, - "By": 2449254.9647385371, - "Bz": 71239.03439068704, - "Ex": 752773908979237.0, - "Ey": 1907341714160.9873, - "Ez": 28672358913898.098, - "jx": 1.9287740799385943e+18, - "jy": 69804336095097.0, - "jz": 742686844234635.5, - "rho": 27910721385.365227 + "Bx": 24121595.02471585, + "By": 78232.13397859206, + "Bz": 601058.5314543134, + "Ex": 22865766698494.82, + "Ey": 6508549201873332.0, + "Ez": 32072534017950.55, + "jx": 1130516319665756.0, + "jy": 2.325136305137274e+18, + "jz": 6769519391624705.0, + "rho": 152898720.2638083 + }, + "lev=1": { + "Bx": 53303280.78531405, + "By": 213761.8564937196, + "Bz": 1321618.978929098, + "Ex": 47856565901964.84, + "Ey": 1.455101409934242e+16, + "Ez": 65304559419893.03, + "jx": 46169274324016.0, + "jy": 9.274837523569297e+18, + "jz": 1.926277235505425e+16, + "rho": 67304284.98422323 } -} +} \ No newline at end of file diff --git a/Regression/Checksum/benchmarks_json/Python_LaserAccelerationRZ.json b/Regression/Checksum/benchmarks_json/Python_LaserAccelerationRZ.json new file mode 100644 index 00000000000..8007cf2dd4d --- /dev/null +++ b/Regression/Checksum/benchmarks_json/Python_LaserAccelerationRZ.json @@ -0,0 +1,66 @@ +{ + "beam": { + "particle_cpu": 0.0, + "particle_id": 5050.0, + "particle_momentum_x": 3.87997644296733e-20, + "particle_momentum_y": 5.078338417986405e-20, + "particle_momentum_z": 1.350360018411703e-17, + "particle_position_x": 6.242147159505209e-05, + "particle_position_y": 0.002676436329644457, + "particle_theta": 151.408043244598, + "particle_weight": 6241509.074460764 + }, + "electrons": { + "particle_cpu": 4128.0, + "particle_id": 10445216.0, + "particle_momentum_x": 2.114384362557539e-24, + "particle_momentum_y": 3.9172628978456397e-22, + "particle_momentum_z": 1.2567935092687156e-23, + "particle_position_x": 0.04160250004822599, + "particle_position_y": 0.047891250425121774, + "particle_theta": 7325.124728188977, + "particle_weight": 813672305.532158 + }, + "lev=0": { + "Bx": 101913.9132182723, + "By": 1330.818599062426, + "Bz": 4514.781857725756, + "Ex": 246731098537.3218, + "Ey": 37825184509557.35, + "Ez": 590251477994.7521, + "jx": 1353405747591.269, + "jy": 2.147722453194553e+17, + "jz": 1863310088559710.0, + "rho": 38912415.75698389, + "Br_0_real": 0.2137064585155872, + "Br_1_imag": 172.2988890744096, + "Br_1_real": 101913.9323749251, + "Btheta_0_real": 1326.759151241743, + "Btheta_1_imag": 103543.8641160633, + "Btheta_1_real": 225.3854904799976, + "Bz_0_real": 0.2910069650253564, + "Bz_1_imag": 0.8113703469857545, + "Bz_1_real": 4514.731146319417, + "Er_0_real": 235160954221.997, + "Er_1_imag": 38566923642693.89, + "Er_1_real": 71516895156.89052, + "Etheta_0_real": 78758938.63585563, + "Etheta_1_imag": 59697352935.93607, + "Etheta_1_real": 37825159479125.69, + "Ez_0_real": 563243350549.5107, + "Ez_1_imag": 1442184351135.906, + "Ez_1_real": 39851376061.69563, + "Jr_0_real": 955171862749.2391, + "Jr_1_imag": 2.267085398348701e+17, + "Jr_1_real": 1672099718770.67, + "Jtheta_0_real": 355427737499.2148, + "Jtheta_1_imag": 911714777272.9283, + "Jtheta_1_real": 2.147722332337163e+17, + "Jz_0_real": 1745718246376104.0, + "Jz_1_imag": 499465565312123.3, + "Jz_1_real": 532424954910440.6, + "rho_0_real": 38503729.9081786, + "rho_1_imag": 20910554.24239848, + "rho_1_real": 1806820.209899142 + } +} \ No newline at end of file diff --git a/Regression/Checksum/benchmarks_json/Python_LaserAcceleration_1d.json b/Regression/Checksum/benchmarks_json/Python_LaserAcceleration_1d.json new file mode 100644 index 00000000000..12f6f0c8189 --- /dev/null +++ b/Regression/Checksum/benchmarks_json/Python_LaserAcceleration_1d.json @@ -0,0 +1,23 @@ +{ + "electrons": { + "particle_cpu": 0.0, + "particle_id": 0.0, + "particle_momentum_x": 0.0, + "particle_momentum_y": 0.0, + "particle_momentum_z": 0.0, + "particle_position_x": 0.0, + "particle_weight": 0.0 + }, + "lev=0": { + "Bx": 178016.7504669478, + "By": 0.0, + "Bz": 0.0, + "Ex": 0.0, + "Ey": 40878227583310.83, + "Ez": 568254685.6950157, + "jx": 0.0, + "jy": 30442928969125.46, + "jz": 1108530282155.6707, + "rho": 3127749.1976868743 + } +} \ No newline at end of file diff --git a/Regression/WarpX-tests.ini b/Regression/WarpX-tests.ini index 0650c2e7369..b42e78459f5 100644 --- a/Regression/WarpX-tests.ini +++ b/Regression/WarpX-tests.ini @@ -891,6 +891,24 @@ compareParticles = 1 particleTypes = electrons analysisRoutine = Examples/analysis_default_regression.py +[Python_LaserAcceleration] +buildDir = . +inputFile = Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py +runtime_params = +customRunCmd = python3 PICMI_inputs_3d.py +dim = 3 +addToCompileString = USE_PYTHON_MAIN=TRUE +restartTest = 0 +useMPI = 1 +numprocs = 2 +useOMP = 1 +numthreads = 1 +compileTest = 0 +doVis = 0 +compareParticles = 1 +particleTypes = electrons +analysisRoutine = Examples/analysis_default_regression.py + [LaserAcceleration_1d] buildDir = . inputFile = Examples/Physics_applications/laser_acceleration/inputs_1d @@ -908,6 +926,24 @@ compareParticles = 1 particleTypes = electrons analysisRoutine = Examples/analysis_default_regression.py +[Python_LaserAcceleration_1d] +buildDir = . +inputFile = Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py +runtime_params = +customRunCmd = python3 PICMI_inputs_1d.py +dim = 1 +addToCompileString = USE_PYTHON_MAIN=TRUE +restartTest = 0 +useMPI = 1 +numprocs = 2 +useOMP = 1 +numthreads = 1 +compileTest = 0 +doVis = 0 +compareParticles = 1 +particleTypes = electrons +analysisRoutine = Examples/analysis_default_regression.py + [LaserAcceleration_single_precision_comms] buildDir = . inputFile = Examples/Physics_applications/laser_acceleration/inputs_3d @@ -958,6 +994,24 @@ compareParticles = 1 particleTypes = electrons beam analysisRoutine = Examples/analysis_default_regression.py +[Python_LaserAccelerationMR] +buildDir = . +inputFile = Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py +runtime_params = +customRunCmd = python3 PICMI_inputs_2d.py +dim = 2 +addToCompileString = USE_PYTHON_MAIN=TRUE +restartTest = 0 +useMPI = 1 +numprocs = 2 +useOMP = 1 +numthreads = 1 +compileTest = 0 +doVis = 0 +compareParticles = 1 +particleTypes = electrons beam +analysisRoutine = Examples/analysis_default_regression.py + [RefinedInjection] buildDir = . inputFile = Examples/Physics_applications/laser_acceleration/inputs_2d @@ -1657,6 +1711,24 @@ compareParticles = 1 particleTypes = electrons beam analysisRoutine = Examples/analysis_default_regression.py +[Python_LaserAccelerationRZ] +buildDir = . +inputFile = Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py +runtime_params = +customRunCmd = python3 PICMI_inputs_rz.py +dim = 2 +addToCompileString = USE_RZ=TRUE USE_PYTHON_MAIN=TRUE +restartTest = 0 +useMPI = 1 +numprocs = 2 +useOMP = 1 +numthreads = 1 +compileTest = 0 +doVis = 0 +compareParticles = 1 +particleTypes = electrons beam +analysisRoutine = Examples/analysis_default_regression.py + [Python_Langmuir_2d] buildDir = . inputFile = Examples/Tests/Langmuir/PICMI_inputs_langmuir2d.py From f042610cbad37f9b09cf44436aac2b754732af2d Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Wed, 22 Dec 2021 16:21:35 -0800 Subject: [PATCH 20/22] Remove Old PICMI Script From Workflow yml Files --- .github/workflows/intel.yml | 2 +- .github/workflows/macos.yml | 2 +- .github/workflows/ubuntu.yml | 2 +- Docs/source/usage/examples.rst | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/intel.yml b/.github/workflows/intel.yml index 793eceaf996..ce5ac80db0d 100644 --- a/.github/workflows/intel.yml +++ b/.github/workflows/intel.yml @@ -93,7 +93,7 @@ jobs: source /opt/intel/oneapi/setvars.sh set -e export OMP_NUM_THREADS=2 - Examples/Physics_applications/laser_acceleration/PICMI_inputs_laser_acceleration.py + Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py build_dpcc: name: oneAPI DPC++ SP diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index d6896853d65..a8e1fdc2ac0 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -56,4 +56,4 @@ jobs: - name: run pywarpx run: | export OMP_NUM_THREADS=1 - mpirun -n 2 Examples/Physics_applications/laser_acceleration/PICMI_inputs_laser_acceleration.py + mpirun -n 2 Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index d640f1bc7e4..a6c06396137 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -82,4 +82,4 @@ jobs: - name: run pywarpx run: | export OMP_NUM_THREADS=1 - mpirun -n 2 Examples/Physics_applications/laser_acceleration/PICMI_inputs_laser_acceleration.py + mpirun -n 2 Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py diff --git a/Docs/source/usage/examples.rst b/Docs/source/usage/examples.rst index 3fe62a5c46a..43d02dad1f5 100644 --- a/Docs/source/usage/examples.rst +++ b/Docs/source/usage/examples.rst @@ -38,7 +38,7 @@ AMReX ``inputs``: PICMI files: -* :download:`Without mesh refinement<../../../Examples/Physics_applications/laser_acceleration/PICMI_inputs_laser_acceleration.py>` +* :download:`Without mesh refinement<../../../Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py>` Plasma mirror ------------- From d37cfdcd26c4678ce8dee310cdd35a16c627a038 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Thu, 23 Dec 2021 08:31:23 -0800 Subject: [PATCH 21/22] Dump RZ Modes for RZ Case --- .../Physics_applications/laser_acceleration/PICMI_inputs_rz.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py index 2b6fe820c94..79ef33b1280 100755 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py +++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py @@ -111,6 +111,7 @@ grid = grid, period = 10, data_list = diag_field_list, + warpx_dump_rz_modes = 1, write_dir = '.', warpx_file_prefix = 'Python_LaserAccelerationRZ_plt') diag_particle_list = ['weighting', 'momentum'] From 2c3ddab377855a3f16238f2f3ec90d48f75c3ef7 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Mon, 3 Jan 2022 06:44:44 -0800 Subject: [PATCH 22/22] LWFA PICMI: Add Shellbang Add missing shellbang lines. --- .../Physics_applications/laser_acceleration/PICMI_inputs_1d.py | 2 ++ .../Physics_applications/laser_acceleration/PICMI_inputs_2d.py | 2 ++ .../Physics_applications/laser_acceleration/PICMI_inputs_3d.py | 2 ++ .../Physics_applications/laser_acceleration/PICMI_inputs_rz.py | 2 ++ 4 files changed, 8 insertions(+) diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py index 7136cdb077c..3a4a7d6b53a 100755 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py +++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_1d.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + from pywarpx import picmi # Physical constants diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py index 022bc15d3e3..c2d0ebb4656 100755 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py +++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_2d.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + from pywarpx import picmi # Physical constants diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py index 91f5615a562..3e6e70e0831 100755 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py +++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + from pywarpx import picmi # Physical constants diff --git a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py index 79ef33b1280..1f43a0b8893 100755 --- a/Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py +++ b/Examples/Physics_applications/laser_acceleration/PICMI_inputs_rz.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + from pywarpx import picmi # Physical constants