diff --git a/dune/solvers/iterationsteps/multigridstep.cc b/dune/solvers/iterationsteps/multigridstep.cc index af839dc1f49fe0262afda5a6d3e6e041e9535a27..3985e84ab7a185c095e7fbb02fca6893acead040 100644 --- a/dune/solvers/iterationsteps/multigridstep.cc +++ b/dune/solvers/iterationsteps/multigridstep.cc @@ -98,7 +98,18 @@ void MultigridStep<MatrixType, VectorType, BitVectorType>::preprocess() presmoother_[i] = postsmoother_[i] = levelSmoother->second; else { + if (not presmootherDefault_) { + DUNE_THROW( + SolverError, + "Falling back to default presmoother on level " << i << ", but no default was set"); + } presmoother_[i] = presmootherDefault_; + + if (not postsmootherDefault_) { + DUNE_THROW( + SolverError, + "Falling back to default postsmoother on level " << i << ", but no default was set"); + } postsmoother_[i] = postsmootherDefault_; } }