aboutsummaryrefslogtreecommitdiff
path: root/Examples/Tests/restart/analysis_restart.py
diff options
context:
space:
mode:
authorGravatar Remi Lehe <remi.lehe@normalesup.org> 2021-08-23 16:20:58 -0700
committerGravatar GitHub <noreply@github.com> 2021-08-23 16:20:58 -0700
commit85e16729106e3a293f9be1e9c20dee89c2a6f924 (patch)
treeefd62e28890244e33859d806f7b4b1fdddaa424e /Examples/Tests/restart/analysis_restart.py
parent3fe49d2c0693af0651d2357675130566aeab14c5 (diff)
downloadWarpX-85e16729106e3a293f9be1e9c20dee89c2a6f924.tar.gz
WarpX-85e16729106e3a293f9be1e9c20dee89c2a6f924.tar.zst
WarpX-85e16729106e3a293f9be1e9c20dee89c2a6f924.zip
Enable restart with PSATD (#1367)
* Enable restart with PSATD * Add new restart test * Add new input file * New CI Test: Fix Inputs, Fix Analysis Script * Reuse input for Restart with FDTD * Read time_of_last_gal_shift from Checkpoint * Upload Benchmark for restart_psatd * Update Benchmark for restart_psatd Co-authored-by: Edoardo Zoni <ezoni@lbl.gov>
Diffstat (limited to 'Examples/Tests/restart/analysis_restart.py')
-rwxr-xr-xExamples/Tests/restart/analysis_restart.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Examples/Tests/restart/analysis_restart.py b/Examples/Tests/restart/analysis_restart.py
index 7d5bab405..698ef8a7d 100755
--- a/Examples/Tests/restart/analysis_restart.py
+++ b/Examples/Tests/restart/analysis_restart.py
@@ -1,6 +1,7 @@
#! /usr/bin/env python
import sys
+import re
import yt
import numpy as np
sys.path.insert(1, '../../../../warpx/Regression/Checksum/')
@@ -9,7 +10,9 @@ import checksumAPI
tolerance = sys.float_info.epsilon
print('tolerance = ', tolerance)
-filename = 'restart_plt00010'
+filename = sys.argv[1]
+psatd = True if re.search('psatd', filename) else False
+
ds = yt.load( filename )
ad = ds.all_data()
xb = ad['beam', 'particle_position_x'].to_ndarray()
@@ -17,7 +20,7 @@ xe = ad['plasma_e', 'particle_position_x'].to_ndarray()
zb = ad['beam', 'particle_position_z'].to_ndarray()
ze = ad['plasma_e', 'particle_position_z'].to_ndarray()
-filename = 'orig_restart_plt00010'
+filename = 'orig_restart_psatd_plt00010' if (psatd) else 'orig_restart_plt00010'
ds = yt.load( filename )
ad = ds.all_data()
xb0 = ad['beam', 'particle_position_x'].to_ndarray()