diff options
author | 2023-02-27 13:04:58 -0800 | |
---|---|---|
committer | 2023-02-27 21:04:58 +0000 | |
commit | 3ac71fef9b83a3c3f94a93b492aec58329b546cc (patch) | |
tree | 53393c94f21b046bf777efeee1c55dc632c6956e /Examples/Tests/silver_mueller/analysis_silver_mueller.py | |
parent | ce188a26a22c99f5c4b297c9ffab6fc3c5c0e180 (diff) | |
download | WarpX-3ac71fef9b83a3c3f94a93b492aec58329b546cc.tar.gz WarpX-3ac71fef9b83a3c3f94a93b492aec58329b546cc.tar.zst WarpX-3ac71fef9b83a3c3f94a93b492aec58329b546cc.zip |
Change plotfile RZ allowed diags to r,t from x,y (#3663)
* change plotfile RZ allowed diag to r,t from x,y
* Change labeling in checksums
* add rz silver mueller analysis script
* make analysis_silver_mueller_rz.py executable
* change x,y fields to r,t in more tests
* x->r in MR RZ checksums
* correct analysis for plotfiles saved as 'boxlib'
* add self to creator list
* change rz diags in PICMI
* correct PICMI changes
* another y->t in an rz test
* update picmi plotfile rz btd names
* review suggestion to condense analysis
* Apply suggestions from code review
Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
---------
Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
Diffstat (limited to 'Examples/Tests/silver_mueller/analysis_silver_mueller.py')
-rwxr-xr-x | Examples/Tests/silver_mueller/analysis_silver_mueller.py | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/Examples/Tests/silver_mueller/analysis_silver_mueller.py b/Examples/Tests/silver_mueller/analysis_silver_mueller.py index 9fa7dc9f1..bfab40aa9 100755 --- a/Examples/Tests/silver_mueller/analysis_silver_mueller.py +++ b/Examples/Tests/silver_mueller/analysis_silver_mueller.py @@ -12,6 +12,7 @@ test check that the reflected field at the boundary is negligible. """ import os +import re import sys import numpy as np @@ -24,15 +25,28 @@ filename = sys.argv[1] ds = yt.load( filename ) all_data_level_0 = ds.covering_grid(level=0,left_edge=ds.domain_left_edge, dims=ds.domain_dimensions) -Ex = all_data_level_0['boxlib', 'Ex'].v.squeeze() -Ey = all_data_level_0['boxlib', 'Ey'].v.squeeze() -Ez = all_data_level_0['boxlib', 'Ez'].v.squeeze() +warpx_used_inputs = open('./warpx_used_inputs', 'r').read() +geom_RZ = re.search('geometry.dims = RZ', warpx_used_inputs) +if geom_RZ: + Er = all_data_level_0['boxlib', 'Er'].v.squeeze() + Et = all_data_level_0['boxlib', 'Et'].v.squeeze() + Ez = all_data_level_0['boxlib', 'Ez'].v.squeeze() +else: + Ex = all_data_level_0['boxlib', 'Ex'].v.squeeze() + Ey = all_data_level_0['boxlib', 'Ey'].v.squeeze() + Ez = all_data_level_0['boxlib', 'Ez'].v.squeeze() # The peak of the initial laser pulse is on the order of 6 V/m # Check that the amplitude after reflection is less than 0.01 V/m max_reflection_amplitude = 0.01 -assert np.all( abs(Ex) < max_reflection_amplitude ) -assert np.all( abs(Ey) < max_reflection_amplitude ) -assert np.all( abs(Ez) < max_reflection_amplitude ) + +if geom_RZ: + assert np.all( abs(Er) < max_reflection_amplitude ) + assert np.all( abs(Et) < max_reflection_amplitude ) + assert np.all( abs(Ez) < max_reflection_amplitude ) +else: + assert np.all( abs(Ex) < max_reflection_amplitude ) + assert np.all( abs(Ey) < max_reflection_amplitude ) + assert np.all( abs(Ez) < max_reflection_amplitude ) test_name = os.path.split(os.getcwd())[1] checksumAPI.evaluate_checksum(test_name, filename) |