-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from GianlucaOberreit/mironov_templatization_pr…
…ivate Fix BSI + add tests
- Loading branch information
Showing
95 changed files
with
3,181 additions
and
1,800 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,4 @@ exec_script.sh.* | |
.DS_Store | ||
tables/* | ||
*.stats* | ||
.venv* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
# ---------------------------------------------------------------------------------------- | ||
# SIMULATION PARAMETERS FOR THE PIC-CODE SMILEI | ||
# ---------------------------------------------------------------------------------------- | ||
|
||
import math | ||
|
||
l0 = 2.0 * math.pi # wavelength in normalized units | ||
t0 = l0 # optical cycle in normalized units | ||
rest = 6000.0 # nb of timestep in 1 optical cycle | ||
resx = 4000.0 # nb cells in 1 wavelength | ||
Lsim = 0.01 * l0 # simulation length | ||
Tsim = 0.2 * t0 # duration of the simulation | ||
|
||
|
||
Main( | ||
geometry="1Dcartesian", | ||
interpolation_order=2, | ||
cell_length=[l0 / resx], | ||
grid_length=[Lsim], | ||
number_of_patches=[4], | ||
timestep=t0 / rest, | ||
simulation_time=Tsim, | ||
EM_boundary_conditions=[["silver-muller"]], | ||
reference_angular_frequency_SI=6 * math.pi * 1e14, | ||
) | ||
|
||
Species( | ||
name="hydrogen", | ||
ionization_model="barrier_suppression", | ||
ionization_electrons="electron", | ||
atomic_number=1, | ||
position_initialization="regular", | ||
momentum_initialization="cold", | ||
particles_per_cell=40, | ||
mass=1836.0 * 1000.0, | ||
charge=0.0, | ||
number_density=0.1, | ||
boundary_conditions=[ | ||
["remove", "remove"], | ||
], | ||
) | ||
|
||
Species( | ||
name="carbon", | ||
ionization_model="barrier_suppression", | ||
ionization_electrons="electron", | ||
atomic_number=6, | ||
position_initialization="regular", | ||
momentum_initialization="cold", | ||
particles_per_cell=40, | ||
mass=1836.0 * 1000.0, | ||
charge=0.0, | ||
number_density=0.1, | ||
boundary_conditions=[ | ||
["remove", "remove"], | ||
], | ||
) | ||
|
||
Species( | ||
name="electron", | ||
position_initialization="regular", | ||
momentum_initialization="cold", | ||
particles_per_cell=0, | ||
mass=1.0, | ||
charge=-1.0, | ||
charge_density=0.0, | ||
boundary_conditions=[ | ||
["remove", "remove"], | ||
], | ||
keep_interpolated_fields=["Ex", "Ey", "Ez", "Wx", "Wy", "Wz"], | ||
) | ||
|
||
|
||
def By(t): | ||
return 1e-7 * math.sin(t) | ||
|
||
|
||
def Bz(t): | ||
return 0.1 * math.sin(t) | ||
|
||
|
||
Laser( | ||
box_side="xmin", | ||
space_time_profile=[By, Bz], | ||
) | ||
|
||
DiagScalar(every=20) | ||
|
||
DiagFields(every=20, time_average=1, fields=["Ex", "Ey", "Ez"]) | ||
|
||
DiagParticleBinning( | ||
deposited_quantity="weight", | ||
every=20, | ||
species=["hydrogen"], | ||
axes=[["charge", -0.5, 1.5, 2]], | ||
) | ||
|
||
DiagParticleBinning( | ||
deposited_quantity="weight", | ||
every=20, | ||
species=["carbon"], | ||
axes=[["charge", -0.5, 6.5, 7]], | ||
) | ||
|
||
DiagTrackParticles( | ||
species="electron", | ||
every=[1, 1000, 30], | ||
attributes=["x", "px", "py", "pz", "w", "Wy"], | ||
) | ||
|
||
DiagNewParticles( | ||
species="electron", | ||
every=100, | ||
attributes=["x", "py", "w", "q"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
# ---------------------------------------------------------------------------------------- | ||
# SIMULATION PARAMETERS FOR THE PIC-CODE SMILEI | ||
# ---------------------------------------------------------------------------------------- | ||
|
||
import math | ||
|
||
l0 = 2.0 * math.pi # wavelength in normalized units | ||
t0 = l0 # optical cycle in normalized units | ||
rest = 6000.0 # nb of timestep in 1 optical cycle | ||
resx = 4000.0 # nb cells in 1 wavelength | ||
Lsim = 0.01 * l0 # simulation length | ||
Tsim = 0.2 * t0 # duration of the simulation | ||
|
||
|
||
Main( | ||
geometry="1Dcartesian", | ||
interpolation_order=2, | ||
cell_length=[l0 / resx], | ||
grid_length=[Lsim], | ||
number_of_patches=[4], | ||
timestep=t0 / rest, | ||
simulation_time=Tsim, | ||
EM_boundary_conditions=[["silver-muller"]], | ||
reference_angular_frequency_SI=6 * math.pi * 1e14, | ||
) | ||
|
||
Species( | ||
name="hydrogen", | ||
ionization_model="Tong_Lin", | ||
ionization_electrons="electron", | ||
atomic_number=1, | ||
position_initialization="regular", | ||
momentum_initialization="cold", | ||
particles_per_cell=40, | ||
mass=1836.0 * 1000.0, | ||
charge=0.0, | ||
number_density=0.1, | ||
boundary_conditions=[ | ||
["remove", "remove"], | ||
], | ||
) | ||
|
||
Species( | ||
name="carbon", | ||
ionization_model="Tong_Lin", | ||
ionization_electrons="electron", | ||
atomic_number=6, | ||
position_initialization="regular", | ||
momentum_initialization="cold", | ||
particles_per_cell=40, | ||
mass=1836.0 * 1000.0, | ||
charge=0.0, | ||
number_density=0.1, | ||
boundary_conditions=[ | ||
["remove", "remove"], | ||
], | ||
) | ||
|
||
Species( | ||
name="electron", | ||
position_initialization="regular", | ||
momentum_initialization="cold", | ||
particles_per_cell=0, | ||
mass=1.0, | ||
charge=-1.0, | ||
charge_density=0.0, | ||
boundary_conditions=[ | ||
["remove", "remove"], | ||
], | ||
keep_interpolated_fields=["Ex", "Ey", "Ez", "Wx", "Wy", "Wz"], | ||
) | ||
|
||
|
||
def By(t): | ||
return 1e-7 * math.sin(t) | ||
|
||
|
||
def Bz(t): | ||
return 0.1 * math.sin(t) | ||
|
||
|
||
Laser( | ||
box_side="xmin", | ||
space_time_profile=[By, Bz], | ||
) | ||
|
||
DiagScalar(every=20) | ||
|
||
DiagFields(every=20, time_average=1, fields=["Ex", "Ey", "Ez"]) | ||
|
||
DiagParticleBinning( | ||
deposited_quantity="weight", | ||
every=20, | ||
species=["hydrogen"], | ||
axes=[["charge", -0.5, 1.5, 2]], | ||
) | ||
|
||
DiagParticleBinning( | ||
deposited_quantity="weight", | ||
every=20, | ||
species=["carbon"], | ||
axes=[["charge", -0.5, 6.5, 7]], | ||
) | ||
|
||
DiagTrackParticles( | ||
species="electron", | ||
every=[1, 1000, 30], | ||
attributes=["x", "px", "py", "pz", "w", "Wy"], | ||
) | ||
|
||
DiagNewParticles( | ||
species="electron", | ||
every=100, | ||
attributes=["x", "py", "w", "q"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
# ---------------------------------------------------------------------------------------- | ||
# SIMULATION PARAMETERS FOR THE PIC-CODE SMILEI | ||
# ---------------------------------------------------------------------------------------- | ||
|
||
import math | ||
l0 = 2.0*math.pi # wavelength in normalized units | ||
t0 = l0 # optical cycle in normalized units | ||
rest = 6000.0 # nb of timestep in 1 optical cycle | ||
resx = 4000.0 # nb cells in 1 wavelength | ||
Lsim = 0.01*l0 # simulation length | ||
Tsim = 0.2*t0 # duration of the simulation | ||
|
||
|
||
Main( | ||
geometry = "1Dcartesian", | ||
|
||
interpolation_order = 2, | ||
|
||
cell_length = [l0/resx], | ||
grid_length = [Lsim], | ||
|
||
number_of_patches = [ 4 ], | ||
|
||
timestep = t0/rest, | ||
simulation_time = Tsim, | ||
|
||
EM_boundary_conditions = [ ['silver-muller'] ], | ||
|
||
reference_angular_frequency_SI = 6*math.pi*1e14, | ||
|
||
) | ||
|
||
Species( | ||
name = 'hydrogen', | ||
ionization_model = 'tunnel_full_PPT', | ||
ionization_electrons = 'electron', | ||
atomic_number = 1, | ||
position_initialization = 'regular', | ||
momentum_initialization = 'cold', | ||
particles_per_cell = 40, | ||
mass = 1836.0*1000., | ||
charge = 0.0, | ||
number_density = 0.1, | ||
boundary_conditions = [ | ||
["remove", "remove"], | ||
], | ||
) | ||
|
||
Species( | ||
name = 'carbon', | ||
ionization_model = 'tunnel_full_PPT', | ||
ionization_electrons = 'electron', | ||
atomic_number = 6, | ||
position_initialization = 'regular', | ||
momentum_initialization = 'cold', | ||
particles_per_cell = 40, | ||
mass = 1836.0*1000., | ||
charge = 0.0, | ||
number_density = 0.1, | ||
boundary_conditions = [ | ||
["remove", "remove"], | ||
], | ||
) | ||
|
||
Species( | ||
name = 'electron', | ||
position_initialization = 'regular', | ||
momentum_initialization = 'cold', | ||
particles_per_cell = 0, | ||
mass = 1.0, | ||
charge = -1.0, | ||
charge_density = 0.0, | ||
boundary_conditions = [ | ||
["remove", "remove"], | ||
], | ||
keep_interpolated_fields = ["Ex", "Ey", "Ez", "Wx", "Wy", "Wz"], | ||
) | ||
|
||
def By(t): | ||
return 1e-7 * math.sin(t) | ||
def Bz(t): | ||
return 0.1 * math.sin(t) | ||
|
||
Laser( | ||
box_side = "xmin", | ||
space_time_profile = [By, Bz], | ||
) | ||
|
||
DiagScalar(every = 20) | ||
|
||
DiagFields( | ||
every = 20, | ||
time_average = 1, | ||
fields = ["Ex", "Ey", "Ez"] | ||
) | ||
|
||
DiagParticleBinning( | ||
deposited_quantity = "weight", | ||
every = 20, | ||
species = ["hydrogen"], | ||
axes = [ | ||
["charge", -0.5, 1.5, 2] | ||
] | ||
) | ||
|
||
DiagParticleBinning( | ||
deposited_quantity = "weight", | ||
every = 20, | ||
species = ["carbon"], | ||
axes = [ | ||
["charge", -0.5, 6.5, 7] | ||
] | ||
) | ||
|
||
DiagTrackParticles( | ||
species = "electron", | ||
every = [1,1000,30], | ||
attributes = ["x","px","py","pz","w","Wy"] | ||
) | ||
|
||
DiagNewParticles( | ||
species = "electron", | ||
every = 100, | ||
attributes = ["x","py","w","q"], | ||
) |
Oops, something went wrong.