From ce7b7b69457a1a262ba5571c02e482f743f18459 Mon Sep 17 00:00:00 2001 From: Sebastian Proell Date: Sat, 13 May 2023 11:56:17 +0200 Subject: [PATCH] Fix step-77: zero out residual before assembly --- examples/step-77/step-77.cc | 2 ++ tests/sundials/step-77.cc | 2 ++ 2 files changed, 4 insertions(+) diff --git a/examples/step-77/step-77.cc b/examples/step-77/step-77.cc index b58f350b20..ab75a26d72 100644 --- a/examples/step-77/step-77.cc +++ b/examples/step-77/step-77.cc @@ -334,6 +334,8 @@ namespace Step77 std::cout << " Computing residual vector..." << std::flush; + residual = 0.0; + const QGauss quadrature_formula(fe.degree + 1); FEValues fe_values(fe, quadrature_formula, diff --git a/tests/sundials/step-77.cc b/tests/sundials/step-77.cc index 4c427d2636..d8aa4ffd28 100644 --- a/tests/sundials/step-77.cc +++ b/tests/sundials/step-77.cc @@ -243,6 +243,8 @@ namespace Step77 const Vector &evaluation_point, Vector & residual) { + residual = 0.0; + const QGauss quadrature_formula(fe.degree + 1); FEValues fe_values(fe, quadrature_formula, -- 2.39.5