Commit 10876c2f authored by oliver.sander_at_tu-dresden.de's avatar oliver.sander_at_tu-dresden.de
Browse files

Remove fixedsteplinearsolver.hh

This file was introduced originally, because the AcceleratedGSStep
class would only accept linear solvers for the linear correction,
but no iteration steps.  The FixedStepLinearSolver could be used
as a shim to practically turn an iteration step into a solver.

Recently, the TNNMGStep class got generalized and now accepts
LinearIterationStep objects directly, in addition to linear solvers.
This makes the FixedStepLinearSolver class obsolete.

If ever somebody else should need it, it should be in dune-solvers
anyway.
parent 1ed2b029
Pipeline #5374 failed with stage
in 15 seconds
install(FILES
fastamgsolver.hh
fixedsteplinearsolver.hh
ilu0cgsolver.hh
ldlsolver.hh
mgsolver.hh
......
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_TNNMG_LINEARSOLVERS_FIXEDSTEPLINEARSOLVER_HH
#define DUNE_TNNMG_LINEARSOLVERS_FIXEDSTEPLINEARSOLVER_HH
#include <memory>
#include <dune/solvers/common/defaultbitvector.hh>
#include <dune/solvers/common/resize.hh>
#include <dune/solvers/iterationsteps/iterationstep.hh>
#include <dune/solvers/solvers/iterativesolver.hh>
namespace Dune {
namespace TNNMG {
/**
* \brief An iterative solver for linear problems, using a fixed number of iterations
*
* \tparam Vector Vector type of the linear system
*/
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:
/** \brief Constructor
* \param step The iteration step object to use
* \param noOfSteps The number of steps to take
*/
FixedStepLinearSolver(const std::shared_ptr<Step> step, unsigned int noOfSteps=1)
: IterativeSolver<Vector, BitVector>(-1, // tolerance
noOfSteps,
NumProc::QUIET),
noOfSteps_(noOfSteps)
{
this->iterationStep_ = step.get();
}
virtual void preprocess()
{
this->iterationStep_->preprocess();
}
/** \brief Solve */
virtual void solve()
{
for (unsigned int i=0; i<noOfSteps_; i++)
this->iterationStep_->iterate();
}
private:
unsigned int noOfSteps_;
BitVector ignore_;
};
} // end namespace TNNMG
} // end namespace Dune
#endif // DUNE_TNNMG_LINEARSOLVERS_FIXEDSTEPLINEARSOLVER_HH
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