From 628c5b82fd68f5c1e778b1aa4af21f7d2f4b835a Mon Sep 17 00:00:00 2001
From: Jonathan Youett <youett@math.fu-berlin.de>
Date: Mon, 16 Jun 2014 12:20:48 +0200
Subject: [PATCH] Only restrict obstacles for dofs that have an obstacle

---
 dune/solvers/transferoperators/mandelobsrestrictor.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dune/solvers/transferoperators/mandelobsrestrictor.cc b/dune/solvers/transferoperators/mandelobsrestrictor.cc
index b30c278d..69aebce5 100644
--- a/dune/solvers/transferoperators/mandelobsrestrictor.cc
+++ b/dune/solvers/transferoperators/mandelobsrestrictor.cc
@@ -30,6 +30,9 @@ restrict(const std::vector<BoxConstraint<typename DiscFuncType::field_type,block
     // Loop over all coarse grid dofs
     for (size_t i=0; i<transferMat.N(); i++) {
         
+        if (fHasObstacle[i].none())
+            continue;
+
         const RowType& row = transferMat[i];
         
         ColumnIterator cIt    = row.begin();
@@ -37,6 +40,9 @@ restrict(const std::vector<BoxConstraint<typename DiscFuncType::field_type,block
         
         // Loop over all fine grid base functions in the support of tObsIt
         for(; cIt!=cEndIt; ++cIt) {
+
+            if (tHasObstacle[cIt.index()].none())
+                continue;
             
             // Sort out spurious entries due to numerical dirt
             if ((*cIt)[0][0] < 1e-3)
-- 
GitLab