Skip to content

Commit

Permalink
Fix checksum regression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
n01r committed Feb 6, 2024
1 parent 89f13da commit 8355e87
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 47 deletions.
7 changes: 3 additions & 4 deletions Examples/Physics_applications/laser_ion/PICMI_inputs_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,23 +138,22 @@
# Diagnostics
diag_field_list = ['B', 'E', 'J', 'rho', 'rho_electrons', 'rho_hydrogen']
particle_diag = picmi.ParticleDiagnostic(
name='diag1',
name='Python_LaserIonAcc2d_plt',
period=100,
write_dir='./diags',
species=[electrons],
data_list=['weighting', 'position', 'momentum'],
warpx_format='openpmd',
warpx_openpmd_backend='bp',
# >500keV for electrons (first term is m*c*c/q_e)
warpx_plot_filter_function='(x<1.0e-6) * (x>-1.0e-6) * (5.1100e+05*(sqrt(1.0+ux*ux+uy*uy+uz*uz)-1.0)>500.0e3)'
warpx_plot_filter_function='(x<1.0e-6) * (x>-1.0e-6)'
)
# reduce resolution of output fields
coarsening_ratio = [4, 4]
ncell_field = []
for (ncell_comp, cr) in zip([nx,nz], coarsening_ratio):
ncell_field.append(int(ncell_comp/cr))
field_diag = picmi.FieldDiagnostic(
name='diag1',
name='Python_LaserIonAcc2d_plt',
grid=grid,
period=100,
number_of_cells=ncell_field,
Expand Down
10 changes: 5 additions & 5 deletions Examples/Physics_applications/laser_ion/inputs_2d
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ diag1.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz rho rho_electrons rho_hydrogen
# reduce resolution of output fields
diag1.coarsening_ratio = 4 4
diag1.electrons.variables = w ux uy uz
diag1.hydrogen.variables = w ux uz orig_x orig_z
diag1.hydrogen.variables = w ux uy uz orig_x orig_z
# demonstration of a spatial and momentum filter
diag1.electrons.plot_filter_function(t,x,y,z,ux,uy,uz) = (uz>=0) * (x<1.0e-6) * (x>-1.0e-6)
diag1.hydrogen.plot_filter_function(t,x,y,z,ux,uy,uz) = (uz>=0) * (x<1.0e-6) * (x>-1.0e-6)
Expand All @@ -220,8 +220,8 @@ openPMDfw.diag_type = Full
openPMDfw.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz rho rho_electrons rho_hydrogen
# reduce resolution of output fields
openPMDfw.coarsening_ratio = 4 4
openPMDfw.electrons.variables = w ux uy uz
openPMDfw.hydrogen.variables = w ux uy uz orig_x orig_z
openPMDfw.electrons.variables = w ux uz
openPMDfw.hydrogen.variables = w ux uz orig_x orig_z
openPMDfw.format = openpmd
openPMDfw.openpmd_backend = h5
openPMDfw.species = electrons hydrogen
Expand All @@ -234,8 +234,8 @@ openPMDbw.diag_type = Full
openPMDbw.fields_to_plot = rho_hydrogen
# reduce resolution of output fields
openPMDbw.coarsening_ratio = 4 4
openPMDbw.electrons.variables = w ux uy uz
openPMDbw.hydrogen.variables = w ux uy uz orig_x orig_z
openPMDbw.electrons.variables = w ux uz
openPMDbw.hydrogen.variables = w ux uz orig_x orig_z
openPMDbw.format = openpmd
openPMDbw.openpmd_backend = h5
openPMDbw.species = electrons hydrogen
Expand Down
53 changes: 28 additions & 25 deletions Regression/Checksum/benchmarks_json/LaserIonAcc2d.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
{
"lev=0": {
"Bx": 0.0,
"By": 11411047.898351602,
"Bz": 0.0,
"Ex": 2031641076084948.5,
"Ey": 0.0,
"Ez": 334777106874158.8,
"jx": 1.6602050255725978e+19,
"jy": 0.0,
"jz": 9.545451466990307e+18,
"rho": 67237998613.86053,
"rho_electrons": 17449705826002.385,
"rho_hydrogen": 17441792654743.146
},
"hydrogen": {
"particle_momentum_x": 2.2575255298569512e-18,
"particle_momentum_z": 1.0773391029868316e-18,
"particle_orig_x": 0.007763427734375002,
"particle_orig_z": 0.0351975439453125,
"particle_position_x": 0.007763034484095496,
"particle_position_y": 0.035195761508116416,
"particle_weight": 2.6792730619156992e+17
},
"electrons": {
"particle_momentum_x": 3.8463518636930147e-19,
"particle_momentum_y": 0.0,
"particle_momentum_z": 1.6287398567676136e-18,
"particle_position_x": 0.008139313907538123,
"particle_position_y": 0.0308605164193468,
"particle_position_y": 0.0,
"particle_position_z": 0.0308605164193468,
"particle_weight": 2.647983436428149e+17
},
"hydrogen": {
"particle_momentum_x": 2.2575255298569516e-18,
"particle_momentum_y": 0.0,
"particle_momentum_z": 1.0773391029868316e-18,
"particle_origX": 0.007763427734375002,
"particle_origZ": 0.0351975439453125,
"particle_position_x": 0.007763034484095496,
"particle_position_y": 0.0,
"particle_position_z": 0.035195761508116416,
"particle_weight": 2.6792730619156992e+17
},
"lev=0": {
"Bx": 0.0,
"By": 11411047.898351604,
"Bz": 0.0,
"Ex": 2031641076084948.8,
"Ey": 0.0,
"Ez": 334777106874158.75,
"jx": 1.660205025572598e+19,
"jy": 0.0,
"jz": 9.545451466990307e+18,
"rho": 67237998613.860535,
"rho_electrons": 17449705826002.387,
"rho_hydrogen": 17441792654743.145
}
}
}
26 changes: 13 additions & 13 deletions Regression/Checksum/benchmarks_json/Python_LaserIonAcc2d.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"electrons": {
"particle_momentum_x": 3.8621627192974665e-19,
"particle_momentum_x": 6.031742830656991e-19,
"particle_momentum_y": 0.0,
"particle_momentum_z": 6.896952587339058e-19,
"particle_position_x": 0.0006797030751154397,
"particle_momentum_z": 1.7837793622079475e-18,
"particle_position_x": 0.014652057213435796,
"particle_position_y": 0.0,
"particle_position_z": 0.003396826825506241,
"particle_weight": 78498903451616.39
"particle_position_z": 0.05600311954919143,
"particle_weight": 5.332681204511206e+17
},
"lev=0": {
"Bx": 0.0,
"By": 11414190.202643845,
"By": 11406516.737324182,
"Bz": 0.0,
"Ex": 2029717163660505.8,
"Ex": 2032785026975781.0,
"Ey": 0.0,
"Ez": 322822619107718.8,
"jx": 1.639516352489411e+19,
"Ez": 315269171271122.75,
"jx": 1.6224680921022521e+19,
"jy": 0.0,
"jz": 9.077513680796167e+18,
"rho": 59460456286.93235,
"rho_electrons": 17448973788388.283,
"rho_hydrogen": 17441803388471.8
"jz": 8.875043590548824e+18,
"rho": 61329928310.45101,
"rho_electrons": 17450329551552.684,
"rho_hydrogen": 17441799909767.852
}
}
2 changes: 2 additions & 0 deletions Regression/WarpX-tests.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2165,6 +2165,7 @@ doVis = 0
[LaserIonAcc2d]
buildDir = .
inputFile = Examples/Physics_applications/laser_ion/inputs_2d
outputFile = LaserIonAcc2d_plt
runtime_params =
dim = 2
addToCompileString = USE_OPENPMD=TRUE
Expand Down Expand Up @@ -3377,6 +3378,7 @@ analysisRoutine = Examples/analysis_default_regression.py
[Python_LaserIonAcc2d]
buildDir = .
inputFile = Examples/Physics_applications/laser_ion/PICMI_inputs_2d.py
outputFile= diags/Python_LaserIonAcc2d_plt
runtime_params =
customRunCmd = python3 PICMI_inputs_2d.py
dim = 2
Expand Down

0 comments on commit 8355e87

Please sign in to comment.