Skip to content
Snippets Groups Projects
Commit 0fb9fb1b authored by Ansgar Burchardt's avatar Ansgar Burchardt
Browse files

MultigridStep: throw exception when no smoother is provided

Otherwise there will be a less user-friendly null-pointer dereference
in `iterate()`.
parent ca17537d
No related branches found
No related tags found
1 merge request!27MultigridStep: throw exception when no smoother is provided
Pipeline #12867 passed
...@@ -98,7 +98,18 @@ void MultigridStep<MatrixType, VectorType, BitVectorType>::preprocess() ...@@ -98,7 +98,18 @@ void MultigridStep<MatrixType, VectorType, BitVectorType>::preprocess()
presmoother_[i] = postsmoother_[i] = levelSmoother->second; presmoother_[i] = postsmoother_[i] = levelSmoother->second;
else else
{ {
if (not presmootherDefault_) {
DUNE_THROW(
SolverError,
"Falling back to default presmoother on level " << i << ", but no default was set");
}
presmoother_[i] = presmootherDefault_; 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_; postsmoother_[i] = postsmootherDefault_;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment