aboutsummaryrefslogtreecommitdiff
path: root/Examples
diff options
context:
space:
mode:
Diffstat (limited to 'Examples')
-rwxr-xr-xExamples/Tests/SingleParticle/bilinear_filter_analysis.py14
-rwxr-xr-xExamples/Tests/photon_pusher/check.py4
2 files changed, 13 insertions, 5 deletions
diff --git a/Examples/Tests/SingleParticle/bilinear_filter_analysis.py b/Examples/Tests/SingleParticle/bilinear_filter_analysis.py
index 1a47796fb..269a4d329 100755
--- a/Examples/Tests/SingleParticle/bilinear_filter_analysis.py
+++ b/Examples/Tests/SingleParticle/bilinear_filter_analysis.py
@@ -5,10 +5,17 @@ import yt ; yt.funcs.mylog.setLevel(0)
import numpy as np
from scipy import signal
-# Build Jx without filter (from other simulation)
+# Build Jx without filter. This can be obtained by running this test without
+# a filter, e.g., execute
+# > OMP_NUM_THREADS=2 mpirun -np 2 ~/warpx/Bin/main2d.gnu.TPROF.MPI.OMP.ex \
+# inputs warpx.use_filter=0
+# instead of
+# > OMP_NUM_THREADS=2 mpirun -np 2 ~/warpx/Bin/main2d.gnu.TPROF.MPI.OMP.ex \
+# inputs warpx.use_filter=1 warpx.filter_npass_each_dir=1 5
+# and then print the values in the array F_filtered below.
my_F_nofilter = np.zeros([16,16])
-my_F_nofilter[8,8] = -1.601068065642412e-11
-my_F_nofilter[8,7] = -1.601068065642412e-11
+my_F_nofilter[8,8] = -1.601068237523421e-11
+my_F_nofilter[8,7] = -1.601068237523421e-11
# Build 2D filter
filter0 = np.array([.25,.5,.25])
@@ -35,4 +42,5 @@ F_filtered = all_data_level_0['boxlib', 'jx'].v.squeeze()
# Compare theory and PIC for filtered value
error = np.sum( np.abs(F_filtered - my_F_filtered) ) / np.sum( np.abs(my_F_filtered) )
+print( "error: %s" %error )
assert( error < 1.e-14 )
diff --git a/Examples/Tests/photon_pusher/check.py b/Examples/Tests/photon_pusher/check.py
index b7601d085..b1f6d916c 100755
--- a/Examples/Tests/photon_pusher/check.py
+++ b/Examples/Tests/photon_pusher/check.py
@@ -12,8 +12,8 @@ import sys
#Physical constants
-c = 299792458.0
-m_e = 9.10938291e-31
+c = 299792458.
+m_e = 9.1093837015e-31
#________________________________________
#Test cases