Commit 74ecbecb authored by oliver.sander_at_tu-dresden.de's avatar oliver.sander_at_tu-dresden.de
Browse files

Remove the 'Step' template argument

Now, the step can be anything that inherits from Solvers::IterationStep.
parent 743c1abc
......@@ -7,6 +7,7 @@
#include <dune/solvers/common/defaultbitvector.hh>
#include <dune/solvers/common/resize.hh>
#include <dune/solvers/iterationsteps/iterationstep.hh>
#include <dune/solvers/solvers/iterativesolver.hh>
......@@ -19,11 +20,12 @@ namespace TNNMG {
*
* \tparam Vector Vector type of the linear system
*/
template <class Vector, class Step>
template <class Vector>
class FixedStepLinearSolver
: public IterativeSolver<Vector, Solvers::DefaultBitVector_t<Vector>>
{
using BitVector = Dune::Solvers::DefaultBitVector_t<Vector>;
using Step = Solvers::IterationStep<Vector,Solvers::DefaultBitVector_t<Vector> >;
public:
......@@ -35,23 +37,23 @@ public:
: IterativeSolver<Vector, BitVector>(-1, // tolerance
noOfSteps,
NumProc::QUIET),
step_(step),
noOfSteps_(noOfSteps)
{}
{
this->iterationStep_ = step.get();
}
virtual void preprocess()
{
step_->preprocess();
this->iterationStep_->preprocess();
}
/** \brief Solve */
virtual void solve()
{
for (unsigned int i=0; i<noOfSteps_; i++)
step_->iterate();
this->iterationStep_->iterate();
}
std::shared_ptr<Step> step_;
private:
unsigned int noOfSteps_;
BitVector ignore_;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment