aboutsummaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorGravatar David Grote <grote1@llnl.gov> 2023-08-09 03:36:17 -0700
committerGravatar GitHub <noreply@github.com> 2023-08-09 12:36:17 +0200
commit5313c5d93ce652451097a2990dcc34d8ffcc112f (patch)
treed54cc19e776cbc5dbedf5adf076477cf0571e243 /Source
parent66058aaeb9850b53cf6431294e4163feab2f8ff9 (diff)
downloadWarpX-5313c5d93ce652451097a2990dcc34d8ffcc112f.tar.gz
WarpX-5313c5d93ce652451097a2990dcc34d8ffcc112f.tar.zst
WarpX-5313c5d93ce652451097a2990dcc34d8ffcc112f.zip
Add write_diagonstics_on_restart input option (#4091)
* Add write_diagonstics_on_restart input option * Add doc to new variable Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Use correct time step --------- Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Diffstat (limited to '')
-rw-r--r--Source/Initialization/WarpXInitData.cpp8
-rw-r--r--Source/WarpX.H3
-rw-r--r--Source/WarpX.cpp2
3 files changed, 10 insertions, 3 deletions
diff --git a/Source/Initialization/WarpXInitData.cpp b/Source/Initialization/WarpXInitData.cpp
index 0e1bb4aa7..233d03a0c 100644
--- a/Source/Initialization/WarpXInitData.cpp
+++ b/Source/Initialization/WarpXInitData.cpp
@@ -483,15 +483,17 @@ WarpX::InitData ()
// looks at field values will see the composite of the field
// solution and any external field
AddExternalFields();
+ }
+ if (restart_chkfile.empty() || write_diagonstics_on_restart) {
// Write full diagnostics before the first iteration.
- multi_diags->FilterComputePackFlush( -1 );
+ multi_diags->FilterComputePackFlush(istep[0] - 1);
// Write reduced diagnostics before the first iteration.
if (reduced_diags->m_plot_rd != 0)
{
- reduced_diags->ComputeDiags(-1);
- reduced_diags->WriteToFile(-1);
+ reduced_diags->ComputeDiags(istep[0] - 1);
+ reduced_diags->WriteToFile(istep[0] - 1);
}
}
diff --git a/Source/WarpX.H b/Source/WarpX.H
index eeb71f042..3a740d1b0 100644
--- a/Source/WarpX.H
+++ b/Source/WarpX.H
@@ -1540,6 +1540,9 @@ private:
std::string restart_chkfile;
+ /** When `true`, write the diagnostics after restart at the time of the restart. */
+ bool write_diagonstics_on_restart = false;
+
amrex::VisMF::Header::Version plotfile_headerversion = amrex::VisMF::Header::Version_v1;
amrex::VisMF::Header::Version slice_plotfile_headerversion = amrex::VisMF::Header::Version_v1;
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp
index 8d4e98462..27d463c12 100644
--- a/Source/WarpX.cpp
+++ b/Source/WarpX.cpp
@@ -617,6 +617,8 @@ WarpX::ReadParameters ()
}
}
+ pp_warpx.query("write_diagonstics_on_restart", write_diagonstics_on_restart);
+
pp_warpx.queryarr("checkpoint_signals", signals_in);
#if defined(__linux__) || defined(__APPLE__)
for (const std::string &str : signals_in) {