diff --git a/dune/solvers/iterationsteps/multigridstep.cc b/dune/solvers/iterationsteps/multigridstep.cc index 220bdfeba6817301d8c17d8b719c5290a660928e..df031e7e54781008316108bdaf3482fd2fb906ae 100644 --- a/dune/solvers/iterationsteps/multigridstep.cc +++ b/dune/solvers/iterationsteps/multigridstep.cc @@ -58,8 +58,8 @@ void MultigridStep<MatrixType, VectorType, BitVectorType>::preprocess() // ///////////////////////////////////////////////////// // Assemble the complete hierarchy of matrices // ///////////////////////////////////////////////////// - for (int i=this->numLevels_-2; i>=0; i--) { - + for (int i=this->numLevels_-2; i>=0; i--) + { this->mat_[i] = Dune::shared_ptr<MatrixType>(new MatrixType); // Compute which entries are present in the (sparse) coarse grid stiffness @@ -133,15 +133,13 @@ else { template<class MatrixType, class VectorType, class BitVectorType> void MultigridStep<MatrixType, VectorType, BitVectorType>::nestedIteration() { - - for (level_ = 0; level_<numLevels_; level_++) { - + for (level_ = 0; level_<numLevels_; level_++) + { iterate(); mgTransfer_[level_]->prolong(x_[level_], x_[level_+1]); - } - + iterate(); } @@ -149,7 +147,6 @@ void MultigridStep<MatrixType, VectorType, BitVectorType>::nestedIteration() template<class MatrixType, class VectorType, class BitVectorType> void MultigridStep<MatrixType, VectorType, BitVectorType>::postprocess() { - } @@ -170,7 +167,7 @@ void MultigridStep<MatrixType, VectorType, BitVectorType>::iterate() basesolver_->solve(); return; } - + // Presmoothing presmoother_[level]->setProblem(*(this->mat_[level]), x[level], rhs[level]); @@ -181,7 +178,7 @@ void MultigridStep<MatrixType, VectorType, BitVectorType>::iterate() // ///////////////////////// // Restriction - + // compute residual // fineResidual = rhs[level] - mat[level] * x[level]; VectorType fineResidual = rhs[level];