Skip to content

Commit

Permalink
Add first restart tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EZoni committed Aug 15, 2024
1 parent 932ffa6 commit a2b4ba9
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 54 deletions.
71 changes: 40 additions & 31 deletions Examples/Tests/pml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,41 +53,50 @@ add_warpx_test(
diags/diag1000300 # output
)

# FIXME
# pml_x_psatd #################################################################
#
#add_warpx_test(
# pml_x_psatd # name
# 2 # dims
# 2 # nprocs
# OFF # eb
# Examples/Tests/pml/inputs_2d_test_pml_x_psatd # inputs
# Examples/Tests/pml/analysis_pml_psatd.py # analysis
# diags/diag1000300 # output
#)
add_warpx_test(
pml_x_psatd # name
2 # dims
2 # nprocs
OFF # eb
Examples/Tests/pml/inputs_2d_test_pml_x_psatd # inputs
Examples/Tests/pml/analysis_pml_psatd.py # analysis
diags/diag1000300 # output
)

# pml_x_psatd_restart #########################################################
#
add_warpx_test(
pml_x_psatd_restart # name
2 # dims
2 # nprocs
OFF # eb
Examples/Tests/pml/inputs_2d_test_pml_x_psatd_restart # inputs
Examples/analysis_default_regression.py # analysis
diags/diag1000300 # output
)

# FIXME
# pml_x_yee ###################################################################
#
#add_warpx_test(
# pml_x_yee # name
# 2 # dims
# 2 # nprocs
# OFF # eb
# Examples/Tests/pml/inputs_2d_test_pml_x_yee # inputs
# Examples/Tests/pml/analysis_pml_yee.py # analysis
# diags/diag1000300 # output
#)
add_warpx_test(
pml_x_yee # name
2 # dims
2 # nprocs
OFF # eb
Examples/Tests/pml/inputs_2d_test_pml_x_yee # inputs
Examples/Tests/pml/analysis_pml_yee.py # analysis
diags/diag1000300 # output
)

# FIXME
# pml_x_yee_eb ################################################################
# pml_x_yee_restart ###########################################################
#
#add_warpx_test(
# pml_x_yee_eb # name
# 2 # dims
# 2 # nprocs
# ON # eb
# Examples/Tests/pml/inputs_2d_test_pml_x_yee_eb # inputs
# Examples/Tests/pml/analysis_pml_yee.py # analysis
# diags/diag1000300 # output
#)
add_warpx_test(
pml_x_yee_restart # name
2 # dims
2 # nprocs
OFF # eb
Examples/Tests/pml/inputs_2d_test_pml_x_yee_restart # inputs
Examples/analysis_default_regression.py # analysis
diags/diag1000300 # output
)
12 changes: 6 additions & 6 deletions Examples/Tests/pml/analysis_pml_psatd.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@

assert(reflectivity < reflectivity_max)

# Check restart data v. original data
sys.path.insert(0, '../../../../warpx/Examples/')
from analysis_default_restart import check_restart

if not galilean:
check_restart(filename)
## Check restart data v. original data
#sys.path.insert(0, '../../../../warpx/Examples/')
#from analysis_default_restart import check_restart
#
#if not galilean:
# check_restart(filename)

test_name = os.path.split(os.getcwd())[1]
checksumAPI.evaluate_checksum(test_name, filename)
10 changes: 5 additions & 5 deletions Examples/Tests/pml/analysis_pml_yee.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@

assert( error_rel < tolerance_rel )

# Check restart data v. original data
sys.path.insert(0, '../../../../warpx/Examples/')
from analysis_default_restart import check_restart

check_restart(filename)
## Check restart data v. original data
#sys.path.insert(0, '../../../../warpx/Examples/')
#from analysis_default_restart import check_restart
#
#check_restart(filename)

test_name = os.path.split(os.getcwd())[1]
checksumAPI.evaluate_checksum(test_name, filename)
2 changes: 0 additions & 2 deletions Examples/Tests/pml/inputs_2d_test_pml_x_psatd
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ FILE = inputs_2d_base

# test input parameters
algo.maxwell_solver = psatd
chk.file_prefix = pml_x_psatd_chk
chk.file_min_digits = 5
diag1.fields_to_plot = Ex Ey Ez Bx By Bz rho divE
warpx.abort_on_warning_threshold = medium
warpx.cfl = 0.7071067811865475
Expand Down
5 changes: 5 additions & 0 deletions Examples/Tests/pml/inputs_2d_test_pml_x_psatd_restart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# base input parameters
FILE = inputs_2d_test_pml_x_psatd

# test input parameters
amr.restart = ../pml_x_psatd/diags/chk000150
2 changes: 0 additions & 2 deletions Examples/Tests/pml/inputs_2d_test_pml_x_yee
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ FILE = inputs_2d_base

# test input parameters
algo.maxwell_solver = yee
chk.file_prefix = pml_x_yee_chk
chk.file_min_digits = 5
7 changes: 0 additions & 7 deletions Examples/Tests/pml/inputs_2d_test_pml_x_yee_eb

This file was deleted.

5 changes: 5 additions & 0 deletions Examples/Tests/pml/inputs_2d_test_pml_x_yee_restart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# base input parameters
FILE = inputs_2d_test_pml_x_yee

# test input parameters
amr.restart = ../pml_x_yee/diags/chk000150
11 changes: 10 additions & 1 deletion Examples/analysis_default_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,17 @@
# Get name of the test
test_name = os.path.split(os.getcwd())[1]

restart = "restart" in test_name

if restart:
test_name = test_name.replace("_restart", "")

# Run checksum regression test
if re.search( 'single_precision', fn ):
checksumAPI.evaluate_checksum(test_name, fn, rtol=2.e-6)
else:
checksumAPI.evaluate_checksum(test_name, fn)
if restart:
checksumAPI.evaluate_checksum(test_name, fn, rtol=1e-12)
else:
# using default relative tolerance
checksumAPI.evaluate_checksum(test_name, fn)

0 comments on commit a2b4ba9

Please sign in to comment.