diff options
author | 2022-10-24 09:42:58 -0700 | |
---|---|---|
committer | 2022-10-24 09:42:58 -0700 | |
commit | b96e6a95f83e095e364c06e4416e81c0fbcf0ec0 (patch) | |
tree | 55df8e8191108098fae2ce69101fb054df0d8def /Examples/Modules/embedded_boundary_cube/analysis_fields_2d.py | |
parent | c27b85db2b606f4474e5b331e4f9aeebaaf2da30 (diff) | |
download | WarpX-b96e6a95f83e095e364c06e4416e81c0fbcf0ec0.tar.gz WarpX-b96e6a95f83e095e364c06e4416e81c0fbcf0ec0.tar.zst WarpX-b96e6a95f83e095e364c06e4416e81c0fbcf0ec0.zip |
Fix stair-case solver in 2D Cartesian (#2942)
* Fix stair-case solver in 2D Cartesian
* Generalization for the macroscropic solver
* Update automated test
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update benchmark
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Diffstat (limited to 'Examples/Modules/embedded_boundary_cube/analysis_fields_2d.py')
-rwxr-xr-x | Examples/Modules/embedded_boundary_cube/analysis_fields_2d.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Examples/Modules/embedded_boundary_cube/analysis_fields_2d.py b/Examples/Modules/embedded_boundary_cube/analysis_fields_2d.py index 227048be9..67e893b19 100755 --- a/Examples/Modules/embedded_boundary_cube/analysis_fields_2d.py +++ b/Examples/Modules/embedded_boundary_cube/analysis_fields_2d.py @@ -48,7 +48,6 @@ for i in range(ncells[0]): (-Lx / 2 <= x < Lx / 2) * (-Lz / 2 <= z < Lz / 2) * np.cos(np.pi / Lx * c * t)) - rel_tol_err = 1e-3 # Compute relative l^2 error on By @@ -56,6 +55,10 @@ By_sim = data['By'].to_ndarray() rel_err_y = np.sqrt(np.sum(np.square(By_sim - By_th)) / np.sum(np.square(By_th))) assert (rel_err_y < rel_tol_err) +# Compute relative l^2 error on Ey +Ey_sim = data['Ey'].to_ndarray() +rel_err_y = np.sqrt(np.sum(np.square(Ey_sim/c - By_th)) / np.sum(np.square(By_th))) + test_name = os.path.split(os.getcwd())[1] checksumAPI.evaluate_checksum(test_name, filename) |