Skip to content

Commit

Permalink
Debug test_3d_particle_boundaries
Browse files Browse the repository at this point in the history
  • Loading branch information
EZoni committed Mar 6, 2025
1 parent ed02ef0 commit 694fce6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Examples/Tests/boundaries/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,11 @@ def do_periodic(x):
assert len(a_id) == 1, "Absorbing particles not absorbed"
assert np.all(vx == -vx0), "Reflecting particle velocity not correct"
assert np.all(vz == +vz0), "Periodic particle velocity not correct"
assert np.all(np.abs((xx - xxa) / xx) < 1.0e-15), (
"Reflecting particle position not correct"
rel_err_xx = np.abs((xx - xxa) / xx)
assert np.all(rel_err_xx < 1e-15), (
f"Reflecting particle position along x not correct. Maximum relative error: {np.max(rel_err_xx)}"
)
assert np.all(np.abs((zz - zza) / zz) < 1.0e-15), (
"Periodic particle position not correct"
rel_err_zz = np.abs((zz - zza) / zz)
assert np.all(rel_err_zz < 1e-15), (
f"Periodic particle position along z not correct. Maximum relative error: {np.max(rel_err_zz)}"
)

0 comments on commit 694fce6

Please sign in to comment.