Skip to content

Commit

Permalink
More tests with openPMD output
Browse files Browse the repository at this point in the history
  • Loading branch information
EZoni committed Aug 17, 2023
1 parent b630f89 commit fcaecc2
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 15 deletions.
9 changes: 6 additions & 3 deletions Examples/Tests/AcceleratorLattice/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
sys.path.insert(1, '../../../../warpx/Regression/Checksum/')
import checksumAPI

filename = sys.argv[1]
ds = yt.load( filename )
plotfile = sys.argv[1]
opmdfile = './diags/diag2'

ds = yt.load(plotfile)
ad = ds.all_data()

gamma_boost = float(ds.parameters.get('warpx.gamma_boost', 1.))
Expand Down Expand Up @@ -113,4 +115,5 @@ def applylens(x0, vx0, vz0, gamma, lens_length, lens_strength):
assert abs(np.abs((ux - ux_sim)/ux)) < 0.002, Exception('error in x particle velocity')

test_name = os.path.split(os.getcwd())[1]
checksumAPI.evaluate_checksum(test_name, filename)
checksumAPI.evaluate_checksum(test_name, output_file=plotfile, output_format='plotfile')
checksumAPI.evaluate_checksum(test_name, output_file=opmdfile, output_format='openpmd')
8 changes: 6 additions & 2 deletions Examples/Tests/AcceleratorLattice/inputs_quad_3d
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ quad2.ds = 0.4
quad2.dEdx = -1.e4

# Diagnostics
diagnostics.diags_names = diag1
diag1.intervals = 50
diagnostics.diags_names = diag1 diag2
diag1.diag_type = Full
diag1.format = plotfile
diag1.intervals = 50
diag2.diag_type = Full
diag2.format = openpmd
diag2.intervals = 50
8 changes: 6 additions & 2 deletions Examples/Tests/AcceleratorLattice/inputs_quad_boosted_3d
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ quad2.ds = 0.4
quad2.dEdx = -1.e4

# Diagnostics
diagnostics.diags_names = diag1
diag1.intervals = 50
diagnostics.diags_names = diag1 diag2
diag1.diag_type = Full
diag1.format = plotfile
diag1.intervals = 50
diag2.diag_type = Full
diag2.format = openpmd
diag2.intervals = 50
8 changes: 6 additions & 2 deletions Examples/Tests/AcceleratorLattice/inputs_quad_moving_3d
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ quad2.ds = 0.4
quad2.dEdx = -1.e4

# Diagnostics
diagnostics.diags_names = diag1
diag1.intervals = 50
diagnostics.diags_names = diag1 diag2
diag1.diag_type = Full
diag1.format = plotfile
diag1.intervals = 50
diag2.diag_type = Full
diag2.format = openpmd
diag2.intervals = 50
10 changes: 4 additions & 6 deletions Examples/Tests/nci_fdtd_stability/inputs_2d
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,9 @@ ions.ymax = +10.e-6 + 1e-7 # adding buffer of fraction of cell-size

# Diagnostics
diagnostics.diags_names = diag1 diag2

diag1.intervals = 10000
diag1.format = plotfile
diag1.diag_type = Full

diag2.intervals = 10000
diag2.format = openpmd
diag1.format = plotfile
diag1.intervals = 10000
diag2.diag_type = Full
diag2.format = openpmd
diag2.intervals = 10000
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"lev=0": {
"Bx": 3.254531465641299e-14,
"By": 3.276809240949724e-14,
"Bz": 1.0615286316115558e-16,
"Ex": 2.30845657253269e-05,
"Ey": 2.2656898931877975e-05,
"Ez": 1.997747654112569e-05,
"jx": 1.7819477343635878e-10,
"jy": 4.2163030523377745e-20,
"jz": 1.037883938249774e-07
},
"electron": {
"x": 0.049960237123814574,
"y": 8.397636119991403e-15,
"z": 0.10931687737912647,
"ux": 0.00021807544879239295,
"uy": 5.350848993804499e-14,
"uz": 0.12701663537367266,
"w": 1.0
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"lev=0": {
"Bx": 0.0,
"By": 0.0,
"Bz": 0.0,
"Ex": 6.0282565190090465e-05,
"Ey": 6.38479659567398e-05,
"Ez": 7.880459213065183e-05,
"jx": 0.0,
"jy": 0.0,
"jz": 0.0
},
"electron": {
"x": 0.03492328774188008,
"y": 9.300626840674328e-11,
"z": 1.4915217664724023,
"ux": 0.0007623569514165381,
"uy": 8.537801353786367e-12,
"uz": 0.10000000000071513,
"w": 1.0
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"lev=0": {
"Bx": 0.0,
"By": 0.0,
"Bz": 0.0,
"Ex": 9.882421146615367e-06,
"Ey": 1.044026104671425e-05,
"Ez": 1.0037396973247306e-05,
"jx": 0.0,
"jy": 0.0,
"jz": 0.0
},
"electron": {
"x": 0.03492328774658799,
"y": 2.2742551618036812e-11,
"z": 1.4915217664612082,
"ux": 0.0007623569511711921,
"uy": 2.2142207983801314e-12,
"uz": 0.09999999999967848,
"w": 1.0
}
}

0 comments on commit fcaecc2

Please sign in to comment.