From b0d685c23b9d2293b521d3c66135da13982fc936 Mon Sep 17 00:00:00 2001
From: Vladimir Ivannikov <vladimir.ivannikov@hzg.de>
Date: Mon, 5 Dec 2022 11:20:26 +0100
Subject: [PATCH] Clear history for a new step

---
 source/lac/solver_control.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/source/lac/solver_control.cc b/source/lac/solver_control.cc
index 8c13529801..f5a0d9eb40 100644
--- a/source/lac/solver_control.cc
+++ b/source/lac/solver_control.cc
@@ -57,6 +57,9 @@ SolverControl::check(const unsigned int step, const double check_value)
   if (step == 0)
     {
       initial_val = check_value;
+
+      if (history_data_enabled)
+        history_data.clear();
     }
 
   if (m_log_history && ((step % m_log_frequency) == 0))
@@ -264,6 +267,9 @@ ReductionControl::check(const unsigned int step, const double check_value)
     {
       initial_val = check_value;
       reduced_tol = check_value * reduce;
+
+      if (history_data_enabled)
+        history_data.clear();
     }
 
   // check whether desired reduction
-- 
2.39.5