From d0262a044f70d0ee9c15383641c18c8050b0d120 Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Sun, 25 Dec 2011 13:55:46 +0100
Subject: [PATCH] Handle the case of a zero-correction

This happens for mu = 0 e.g.
---
 dune/tectonic/myblockproblem.hh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/dune/tectonic/myblockproblem.hh b/dune/tectonic/myblockproblem.hh
index 1cf7ede0..9a344646 100644
--- a/dune/tectonic/myblockproblem.hh
+++ b/dune/tectonic/myblockproblem.hh
@@ -77,6 +77,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;
 
     v /= vnorm; // Rescale for numerical stability
 
-- 
GitLab