From 75b35cea0f11959370fc94f55a9d4544f971dc01 Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Fri, 2 Oct 2015 12:33:28 +0200
Subject: [PATCH] MMGStep: Restore precision

---
 dune/solvers/iterationsteps/mmgstep.cc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dune/solvers/iterationsteps/mmgstep.cc b/dune/solvers/iterationsteps/mmgstep.cc
index 95a6554b..510829e5 100644
--- a/dune/solvers/iterationsteps/mmgstep.cc
+++ b/dune/solvers/iterationsteps/mmgstep.cc
@@ -316,8 +316,12 @@ void MonotoneMGStep<MatrixType, VectorType>::iterate()
     }
 
     // Debug: output energy
-    if (level==(int) this->numLevels()-1 && this->verbosity_==NumProc::FULL)
+    if (level==(int) this->numLevels()-1 && this->verbosity_==NumProc::FULL) {
+        std::streamsize const oldPrecision = std::cout.precision()
         std::cout << "Total energy: "
-                  << std::setprecision(10) << computeEnergy(*mat[level], *x[level], rhs[level]) << std::endl;
+                  << std::setprecision(10)
+                  << computeEnergy(*mat[level], *x[level], rhs[level]) << std::endl
+                  << std::setprecision(oldPrecision);
+    }
 
 }
-- 
GitLab