From 43ea641f3a32d7beb9b56cbe65fd4833ddcac29e Mon Sep 17 00:00:00 2001
From: Markus Blatt <mblatt@dune-project.org>
Date: Tue, 4 Oct 2005 08:07:56 +0000
Subject: [PATCH] There are no smoothers and aggregates maps on the coarsest
 level.

[[Imported from SVN: r332]]
---
 istl/paamg/amg.hh | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/istl/paamg/amg.hh b/istl/paamg/amg.hh
index 34ac5667c..d278d8dc5 100644
--- a/istl/paamg/amg.hh
+++ b/istl/paamg/amg.hh
@@ -202,19 +202,25 @@ namespace Dune
         ++lhs;
         ++update;
         ++defect;
-        ++smoother;
         ++matrix;
-        ++aggregates;
         ++level;
         *lhs=0;
 
+        if(matrix != matrices_->matrices().coarsest()) {
+          ++smoother;
+          ++aggregates;
+        }
+
         // next level
         mgc(smoother, matrix, aggregates, lhs, update, rhs, defect);
 
+        if(matrix != matrices_->matrices().coarsest()) {
+          --smoother;
+          --aggregates;
+        }
         --level;
         //prolongate (coarse x is the new update)
         --matrix;
-        --aggregates;
         --update;
         Transfer<typename MatrixHierarchy::AggregatesMap::AggregateDescriptor,Range>
         ::prolongate(*(*aggregates), *update, *lhs, 0.8);
@@ -222,7 +228,6 @@ namespace Dune
         --lhs;
         --rhs;
         --defect;
-        --smoother;
 
         // postsmoothing
         for(std::size_t i=0; i < steps_; ++i) {
-- 
GitLab