From 8355e8765d246baffb887562e6352bd175991648 Mon Sep 17 00:00:00 2001 From: Marco Garten Date: Fri, 2 Feb 2024 16:30:18 -0800 Subject: [PATCH] Fix checksum regression tests --- .../laser_ion/PICMI_inputs_2d.py | 7 ++- .../Physics_applications/laser_ion/inputs_2d | 10 ++-- .../benchmarks_json/LaserIonAcc2d.json | 53 ++++++++++--------- .../benchmarks_json/Python_LaserIonAcc2d.json | 26 ++++----- Regression/WarpX-tests.ini | 2 + 5 files changed, 51 insertions(+), 47 deletions(-) diff --git a/Examples/Physics_applications/laser_ion/PICMI_inputs_2d.py b/Examples/Physics_applications/laser_ion/PICMI_inputs_2d.py index 8ef613d8e8a..f25ca9b91fd 100755 --- a/Examples/Physics_applications/laser_ion/PICMI_inputs_2d.py +++ b/Examples/Physics_applications/laser_ion/PICMI_inputs_2d.py @@ -138,15 +138,14 @@ # 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] @@ -154,7 +153,7 @@ 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, diff --git a/Examples/Physics_applications/laser_ion/inputs_2d b/Examples/Physics_applications/laser_ion/inputs_2d index 18461e4b8df..0f321778480 100644 --- a/Examples/Physics_applications/laser_ion/inputs_2d +++ b/Examples/Physics_applications/laser_ion/inputs_2d @@ -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) @@ -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 @@ -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 diff --git a/Regression/Checksum/benchmarks_json/LaserIonAcc2d.json b/Regression/Checksum/benchmarks_json/LaserIonAcc2d.json index c5330b1548c..81850192121 100644 --- a/Regression/Checksum/benchmarks_json/LaserIonAcc2d.json +++ b/Regression/Checksum/benchmarks_json/LaserIonAcc2d.json @@ -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 } -} +} \ No newline at end of file diff --git a/Regression/Checksum/benchmarks_json/Python_LaserIonAcc2d.json b/Regression/Checksum/benchmarks_json/Python_LaserIonAcc2d.json index 841c3a015d1..859e1a833eb 100644 --- a/Regression/Checksum/benchmarks_json/Python_LaserIonAcc2d.json +++ b/Regression/Checksum/benchmarks_json/Python_LaserIonAcc2d.json @@ -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 } } \ No newline at end of file diff --git a/Regression/WarpX-tests.ini b/Regression/WarpX-tests.ini index 13f2e49e266..38b25e81e8b 100644 --- a/Regression/WarpX-tests.ini +++ b/Regression/WarpX-tests.ini @@ -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 @@ -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