From a25d7b6bb00f5c4b7025d6b384eee41ec4e585c9 Mon Sep 17 00:00:00 2001 From: Chris Neal Date: Wed, 17 Jan 2024 16:13:05 -0500 Subject: [PATCH] [1D] Set overwrite flag when saving debug output files This prevents errors that could occur if the steady-state Newton solver experiences failures after previous successful Newton solves. In this situation, the data group at the highest level already exists in the debug file, and must explicitly be overwritten. --- src/oneD/Sim1D.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/oneD/Sim1D.cpp b/src/oneD/Sim1D.cpp index 331a806371..9ca0b4e52b 100644 --- a/src/oneD/Sim1D.cpp +++ b/src/oneD/Sim1D.cpp @@ -448,22 +448,22 @@ void Sim1D::solve(int loglevel, bool refine_grid) if (loglevel > 6) { save("debug_sim1d.yaml", "debug", - "After successful Newton solve"); + "After successful Newton solve", true); } if (loglevel > 7) { saveResidual("debug_sim1d.yaml", "residual", - "After successful Newton solve"); + "After successful Newton solve", true); } ok = true; } else { debuglog(" failure. \n", loglevel); if (loglevel > 6) { save("debug_sim1d.yaml", "debug", - "After unsuccessful Newton solve"); + "After unsuccessful Newton solve", true); } if (loglevel > 7) { saveResidual("debug_sim1d.yaml", "residual", - "After unsuccessful Newton solve"); + "After unsuccessful Newton solve", true); } if (loglevel > 0) { writelog("Take {} timesteps ", nsteps); @@ -471,11 +471,11 @@ void Sim1D::solve(int loglevel, bool refine_grid) dt = timeStep(nsteps, dt, m_state->data(), m_xnew.data(), loglevel-1); m_xlast_ts = *m_state; if (loglevel > 6) { - save("debug_sim1d.yaml", "debug", "After timestepping"); + save("debug_sim1d.yaml", "debug", "After timestepping", true); } if (loglevel > 7) { saveResidual("debug_sim1d.yaml", "residual", - "After timestepping"); + "After timestepping", true); } if (loglevel == 1) { @@ -506,11 +506,11 @@ void Sim1D::solve(int loglevel, bool refine_grid) dt = m_tstep; } if (new_points && loglevel > 6) { - save("debug_sim1d.yaml", "debug", "After regridding"); + save("debug_sim1d.yaml", "debug", "After regridding", true); } if (new_points && loglevel > 7) { saveResidual("debug_sim1d.yaml", "residual", - "After regridding"); + "After regridding", true); } } else { debuglog("grid refinement disabled.\n", loglevel);