From 71d4eed864fc30de8cd41059c1ba2f9ceaabdb10 Mon Sep 17 00:00:00 2001
From: Jonathan Youett <youett@math.fu-berlin.de>
Date: Thu, 2 Jul 2015 16:01:08 +0200
Subject: [PATCH] Fix bugs introduced by the upstream adjustment that slipped
 through running the dune-fufem tests

---
 dune/fufem/boundarypatchprolongator.hh | 2 +-
 dune/fufem/differencenormsquared.hh    | 4 ++--
 dune/fufem/improvegrid.hh              | 2 +-
 dune/fufem/prolongboundarypatch.hh     | 4 ++--
 dune/fufem/sampleonbitfield.hh         | 7 ++++---
 5 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/dune/fufem/boundarypatchprolongator.hh b/dune/fufem/boundarypatchprolongator.hh
index 6be766c5..99a0bb9f 100644
--- a/dune/fufem/boundarypatchprolongator.hh
+++ b/dune/fufem/boundarypatchprolongator.hh
@@ -69,7 +69,7 @@ public:
         for (int i=1; i<=maxLevel; i++)
             patches[i]->setup(grid.levelGridView(i));
 
-        for (const auto& pIt : patches[0])
+        for (const auto& pIt : *patches[0])
         {
             const Element& inside = pIt.inside();
 
diff --git a/dune/fufem/differencenormsquared.hh b/dune/fufem/differencenormsquared.hh
index 9d62b0af..e2d79896 100644
--- a/dune/fufem/differencenormsquared.hh
+++ b/dune/fufem/differencenormsquared.hh
@@ -136,7 +136,7 @@ public:
                 LevelMultipleCodimMultipleGeomTypeMapper<GridType,Dune::MCMGElementLayout> adaptiveP0Mapper(sourceGrid, 0);
                 int coarseIndex = uniformP0Mapper.map(element);
 
-                typename GridType::LevelGridView sourceLevelView = sourceGrid.levelView(0);
+                typename GridType::LevelGridView sourceLevelView = sourceGrid.levelGridView(0);
 
                 for (auto&& adaptE : elements(sourceLevelView))
                     if (adaptiveP0Mapper.map(adaptE) == coarseIndex) {
@@ -176,7 +176,7 @@ public:
                 //   Sample adaptive function
                 // ////////////////////////////////////////////////////////////////////////
                 sourceFunction.evaluateLocal(element, pos,
-                                            target[indexSet.subIndex(*eIt,i,dim)]);
+                                            target[indexSet.subIndex(e,i,dim)]);
 
             }
 
diff --git a/dune/fufem/improvegrid.hh b/dune/fufem/improvegrid.hh
index 3110fc62..ad75b1bc 100644
--- a/dune/fufem/improvegrid.hh
+++ b/dune/fufem/improvegrid.hh
@@ -126,7 +126,7 @@ void improveGrid(GridType& grid, double threshold)
 
     for (; eIt!=eEndIt; ++eIt) {
 
-        const Entity& father = eIt->father();
+        const EntityType& father = eIt->father();
 
         const typename GridType::template Codim<0>::LocalGeometry geometryInFather = eIt->geometryInFather();
         for (size_t i=0; i<eIt->subEntities(dim); i++) {
diff --git a/dune/fufem/prolongboundarypatch.hh b/dune/fufem/prolongboundarypatch.hh
index 1406e621..ec506b56 100644
--- a/dune/fufem/prolongboundarypatch.hh
+++ b/dune/fufem/prolongboundarypatch.hh
@@ -160,7 +160,7 @@ public:
             for (const auto& i : intersections(levelView,e)) {
 
                 // if the element is a boundary element
-                if (patches[0].contains(nIt)) {
+                if (patches[0].contains(i)) {
 
                     // /////////////////////////////////////////////////////////////////
                     //   This version actually only works for UGGrids, but it works
@@ -248,7 +248,7 @@ public:
             for (const auto& i : intersections(levelView,e)) {
 
                 // if the element is a boundary element
-                if (coarsePatch.contains(nIt)) {
+                if (coarsePatch.contains(i)) {
 
                     // /////////////////////////////////////////////////////////////////
                     //   This version actually only works for UGGrids, but it works
diff --git a/dune/fufem/sampleonbitfield.hh b/dune/fufem/sampleonbitfield.hh
index c2601d4c..317f0425 100644
--- a/dune/fufem/sampleonbitfield.hh
+++ b/dune/fufem/sampleonbitfield.hh
@@ -36,8 +36,9 @@ void sampleOnBitField(const GridType& grid,
     assert((int) dirichletValues[0].size()==grid.size(0,dim));
 
     // Construct GridFunction
+    typename GridType::LevelGridView levelView = grid.levelGridView(0);
     typedef P1NodalBasis<typename GridType::LevelGridView> P1Basis;
-    P1Basis p1Basis(grid.levelGridView(0));
+    P1Basis p1Basis(levelView);
     BasisGridFunction<P1Basis, VectorType> coarseFunction(p1Basis, dirichletValues[0]);
 
     // Set array sizes correctly
@@ -142,7 +143,7 @@ void sampleOnBitField(const GridType& grid,
             coarseFunction.evaluateLocal(element, pos, tmp);
 
             for (int j=0; j<blocksize; j++)
-                 if (dirichletNodes[eIt->level()][fIdx][j])
+                 if (dirichletNodes[e.level()][fIdx][j])
                      fineDirichletValues[fIdx][j] = tmp[j];
         }
 
@@ -189,7 +190,7 @@ void sampleOnBitField(const GridType& grid,
 
         for (size_t i=0; i<e.subEntities(dim); i++) {
 
-            int fIdx = indexSet().subIndex(e, i, dim);
+            int fIdx = indexSet.subIndex(e, i, dim);
 
             // Logical position of the fine grid lagrange point
             // in local coordinates of the coarse grid element
-- 
GitLab