Skip to content

Commit

Permalink
checksum.
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinRayAngus committed Jul 14, 2024
1 parent 5070615 commit 8d764a7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
14 changes: 7 additions & 7 deletions Examples/Tests/collision/analysis_collision_1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@

#############

print(f"Np = {Np}, NpA = {NpA}, NpB = {NpB}")
print(f"wpA = {wpA}, wpB = {wpB}")
#print(f"Np = {Np}, NpA = {NpA}, NpB = {NpB}")
#print(f"wpA = {wpA}, wpB = {wpB}")

sorted_px_sum = np.abs(sorted_px).sum();
sorted_py_sum = np.abs(sorted_py).sum();
Expand Down Expand Up @@ -138,15 +138,15 @@
TBperp = (TBx + TBy)/2.0
TB = (TBx + TBy + TBz)/3.0

print(f"uAx = {uAx/1e3:.{5}f}; uAy = {uAy/1e3:.{5}f}; uAz = {uAz/1e3:.{5}f} [km/s]")
print(f"uBx = {uBx/1e3:.{5}f}; uBy = {uBy/1e3:.{5}f}; uBz = {uBz/1e3:.{5}f} [km/s]")
print(f"TA = {TA:.{5}f}; TAperp = {TAperp:.{5}f}; TApar = {TApar:.{5}f} [eV]")
print(f"TB = {TB:.{5}f}; TBperp = {TBperp:.{5}f}; TBpar = {TBpar:.{5}f} [eV]")
#print(f"uAx = {uAx/1e3:.{5}f}; uAy = {uAy/1e3:.{5}f}; uAz = {uAz/1e3:.{5}f} [km/s]")
#print(f"uBx = {uBx/1e3:.{5}f}; uBy = {uBy/1e3:.{5}f}; uBz = {uBz/1e3:.{5}f} [km/s]")
#print(f"TA = {TA:.{5}f}; TAperp = {TAperp:.{5}f}; TApar = {TApar:.{5}f} [eV]")
#print(f"TB = {TB:.{5}f}; TBperp = {TBperp:.{5}f}; TBpar = {TBpar:.{5}f} [eV]")

TApar_30ps_soln = 6.15e3 # TA parallel solution at t = 30 ps
error = np.abs(TApar-TApar_30ps_soln)/TApar_30ps_soln
tolerance = 0.02
print('error = ', error);
print('TApar at 30ps error = ', error);
print('tolerance = ', tolerance);
assert error < tolerance

Expand Down
1 change: 1 addition & 0 deletions Examples/Tests/collision/inputs_1d
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ particles.species_names = ions

ions.charge = q_c12
ions.mass = m_c12
ions.do_not_deposit = 1

ions.injection_sources = groupA groupB

Expand Down
12 changes: 5 additions & 7 deletions Regression/Checksum/benchmarks_json/collisionZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@
"jz": 0.0
},
"ions": {
"particle_momentum_x": 3.4266327177706956e-16,
"particle_momentum_y": 3.435391408305914e-16,
"particle_momentum_z": 5.531650381094717e-16,
"particle_position_x": 1.0241442531780067,
"particle_position_y": 1.0238915904698023,
"particle_position_z": 1.024005350488445,
"particle_weight": 1.1000000000000997e+24
"particle_momentum_x": 3.4283649966834414e-16,
"particle_momentum_y": 3.4358954060667462e-16,
"particle_momentum_z": 5.530678357178482e-16,
"particle_position_x": 719.9215445002424,
"particle_weight": 1.1000000000001e+24
}
}

0 comments on commit 8d764a7

Please sign in to comment.