From 5e724afe95060a4d6a5a46fac9b3541120864791 Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Sat, 30 Mar 2013 12:51:24 +0100
Subject: [PATCH] Do not truncate corrections whose norm is zero

---
 dune/tectonic/myblockproblem.hh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dune/tectonic/myblockproblem.hh b/dune/tectonic/myblockproblem.hh
index fe8f229d..e2628557 100644
--- a/dune/tectonic/myblockproblem.hh
+++ b/dune/tectonic/myblockproblem.hh
@@ -103,8 +103,8 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
     VectorType v = projected_v;
 
     double const vnorm = v.two_norm();
-    if (vnorm == 0) // This can (and needs to be able to) be very small
-      return 0.0;
+    if (vnorm <= 0)
+      return 1.0;
 
     v /= vnorm; // Rescale for numerical stability
 
-- 
GitLab