From 7b1dfa20668e65dafd84f11f6f256dd764536864 Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Fri, 31 May 2013 18:13:01 +0200
Subject: [PATCH] Cleanup

---
 dune/tectonic/myblockproblem.hh | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/dune/tectonic/myblockproblem.hh b/dune/tectonic/myblockproblem.hh
index caa16bbe..58195440 100644
--- a/dune/tectonic/myblockproblem.hh
+++ b/dune/tectonic/myblockproblem.hh
@@ -283,22 +283,15 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
       LocalVectorType &ui, int m,
       typename Dune::BitSetVector<block_size>::const_reference ignore) {
     {
-      int ignore_component = block_size;
-      // Special value that indicates nothing should be ignored
+      int ic =
+          block_size; // Special value that indicates nothing should be ignored
       switch (ignore.count()) {
         case 0: // Full problem
           break;
-        case 1: // 1 Dimension is fixed
-          // Only the X and Y components are allowed to be fixed in this manner
-          if (ignore[0]) {
-            ignore_component = 0;
-            break;
-          }
-          if (ignore[1]) {
-            ignore_component = 1;
-            break;
-          }
-          assert(false);
+        case 1:
+          for (ic = 0; ic < block_size; ++ic)
+            if (ignore[ic])
+              break;
           break;
         case block_size: // Ignore the whole node
           return;
@@ -320,8 +313,7 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
       assert(localA != nullptr);
 
       auto const phi = problem.phi.restriction(m);
-      Dune::EllipticEnergy<block_size> localJ(*localA, localb, phi,
-                                              ignore_component);
+      Dune::EllipticEnergy<block_size> localJ(*localA, localb, phi, ic);
       Dune::minimise(localJ, ui, localsteps, bisection);
     }
   }
-- 
GitLab