diff --git a/dune/solvers/iterationsteps/amgstep.hh b/dune/solvers/iterationsteps/amgstep.hh index a0f37001b9b4eebdcd53209e1754025c96395c18..4dfa8834020febc130c188c00defece4d3ae1a9b 100644 --- a/dune/solvers/iterationsteps/amgstep.hh +++ b/dune/solvers/iterationsteps/amgstep.hh @@ -49,7 +49,7 @@ public: setProblem(*stiffnessMatrix, x, rhs); fop_ = std::unique_ptr<Operator>(new Operator(*stiffnessMatrix)); - amg_ = std::unique_ptr<AMG>(new AMG(*fop_, coarseningCriterion, smootherArgs, 1, 1, 1, false)); + amg_ = std::unique_ptr<AMG>(new AMG(*fop_, coarseningCriterion, smootherArgs)); amg_->pre(*this->x_, residual_); } @@ -94,12 +94,21 @@ private: std::unique_ptr<AMG> amg_; VectorType residual_; + + void setupCoarseningCriterion() + { + coarseningCriterion_.setNoPreSmoothSteps(1); + coarseningCriterion_.setNoPostSmoothSteps(1); + coarseningCriterion_.setGamma(1); + coarseningCriterion_.setAdditive(false); + } }; template <class MatrixType, class VectorType> void AMGStep<MatrixType,VectorType>::preprocess() { - amg_ = std::unique_ptr<AMG>(new AMG(*fop_, coarseningCriterion_, smootherArgs_, 1, 1, 1, false)); + setupCoarseningCriterion(); + amg_ = std::unique_ptr<AMG>(new AMG(*fop_, coarseningCriterion_, smootherArgs_)); amg_->pre(*this->x_, residual_); }