From f08855bd7c4218ac716b199b579621b55da6ffaa Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Wed, 14 May 2014 15:01:59 +0000
Subject: [PATCH] [bugfix] Use FE basis to determine size of toplevel
 hasObstacles array

After much back and forth: this is the correct way.  This size cannot
be taken from the transfer operators, because these operators exist
only if there is more than one level.

[[Imported from SVN: r9728]]
---
 dune/gfe/riemanniantrsolver.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dune/gfe/riemanniantrsolver.cc b/dune/gfe/riemanniantrsolver.cc
index ea77c53d..2f006349 100644
--- a/dune/gfe/riemanniantrsolver.cc
+++ b/dune/gfe/riemanniantrsolver.cc
@@ -213,7 +213,8 @@ setup(const GridType& grid,
     if (rank==0)
     {
         hasObstacle_.resize(numLevels);
-        hasObstacle_.back().resize(dynamic_cast<TruncatedCompressedMGTransfer<CorrectionType>* >(mmgStep->mgTransfer_.back())->getMatrix().N(), true);
+        hasObstacle_.back().resize(basis.size(), true);
+        // If there is more than one level use the transfer operators to determine the correct coarse level system sizes
         for (int i=0; i<hasObstacle_.size()-1; i++)
             hasObstacle_[i].resize(dynamic_cast<TruncatedCompressedMGTransfer<CorrectionType>* >(mmgStep->mgTransfer_[i])->getMatrix().M(),true);
     }
-- 
GitLab