aboutsummaryrefslogtreecommitdiff
path: root/Examples/Tests/silver_mueller/analysis_silver_mueller.py
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/Tests/silver_mueller/analysis_silver_mueller.py')
-rwxr-xr-xExamples/Tests/silver_mueller/analysis_silver_mueller.py26
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)