From ff28ba1b29e3f26aa994a302391e37b9d5702d8a Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Sun, 25 Dec 2011 13:56:40 +0100
Subject: [PATCH] Catch nonsensical corrections for now

Bisection will run for ages otherwise
---
 dune/tectonic/myblockproblem.hh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dune/tectonic/myblockproblem.hh b/dune/tectonic/myblockproblem.hh
index 9a344646..a8d2818d 100644
--- a/dune/tectonic/myblockproblem.hh
+++ b/dune/tectonic/myblockproblem.hh
@@ -99,6 +99,12 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
     MyDirectionalConvexFunction<Dune::GlobalNonlinearity<block_size>> const psi(
         localA, localb, problem.phi, u, v);
 
+    Interval<double> D;
+    psi.subDiff(0, D);
+    // FIXME: this should never happen to begin with
+    if (D[1] >= 0)
+      return 0.0;
+
     int bisectionsteps = 0;
     Bisection bisection(0.0, 1.0, 1e-12, true, 0);                      // TODO
     return bisection.minimize(psi, vnorm, 0.0, bisectionsteps) / vnorm; // TODO
-- 
GitLab