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

AMGStep: override `apply`

The generic version doesn't know about the `residual_` member.

It would be better if the generic version would call
`setProblem(x, rhs)`, but this variant of `setProblem` doesn't exist.
parent b99d2717
No related branches found
No related tags found
No related merge requests found
...@@ -74,6 +74,8 @@ public: ...@@ -74,6 +74,8 @@ public:
/** \brief Perform one iteration */ /** \brief Perform one iteration */
void iterate() override; void iterate() override;
void apply(VectorType& x, const VectorType& rhs) override;
/** \brief Arguments for the smoother. See the dune-istl documentation for details */ /** \brief Arguments for the smoother. See the dune-istl documentation for details */
SmootherArgs smootherArgs_; SmootherArgs smootherArgs_;
...@@ -114,6 +116,16 @@ void AMGStep<MatrixType,VectorType>::iterate() ...@@ -114,6 +116,16 @@ void AMGStep<MatrixType,VectorType>::iterate()
amg_->apply(*this->x_, residual_); amg_->apply(*this->x_, residual_);
} }
template <class MatrixType, class VectorType>
void AMGStep<MatrixType,VectorType>::apply(VectorType& x, const VectorType& rhs)
{
x = 0;
this->x_ = &x;
residual_ = rhs;
preprocess();
iterate();
}
} /* namespace Solvers */ } /* namespace Solvers */
} /* namespace Dune */ } /* namespace Dune */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment