Skip to content
Snippets Groups Projects
Commit fb5aea62 authored by lh1887's avatar lh1887
Browse files

Revert "Add setMatrix() method to DenseMultigridTransfer"

This reverts commit 849db9b0
parent 849db9b0
No related branches found
No related tags found
No related merge requests found
Pipeline #
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_SOLVERS_FIXEDSTEPSOLVER_HH
#define DUNE_SOLVERS_FIXEDSTEPSOLVER_HH
#include <memory>
#include <dune/solvers/common/defaultbitvector.hh>
#include <dune/solvers/common/resize.hh>
namespace Dune {
namespace Solvers {
/**
* \brief An iterative solver using a fixed number of iterations
*
* \tparam Matrix Matrix type of the system
* \tparam Vector Vector type of the system
*/
template<class Matrix, class Vector, class Step>
class FixedStepSolver
{
using BitVector = Dune::Solvers::DefaultBitVector_t<Vector>;
public:
/** \brief Constructor
* \param step The iteration step object to use
* \param noOfSteps The number of steps to take
*/
FixedStepSolver(const std::shared_ptr<Step> step, unsigned int noOfSteps=1)
: step_(step),
noOfSteps_(noOfSteps)
{}
/** \brief Solve */
void operator()(Vector& x, const Matrix& m, const Vector& r)
{
Dune::Solvers::resizeInitialize(ignore_, x, false);
step_->setIgnore(ignore_);
step_->setProblem(m, x, r);
step_->preprocess();
for (unsigned int i=0; i<noOfSteps_; i++)
step_->iterate();
}
private:
std::shared_ptr<Step> step_;
unsigned int noOfSteps_;
BitVector ignore_;
};
} // end namespace Solvers
} // end namespace Dune
#endif // DUNE_SOLVERS_FIXEDSTEPSOLVER_HH
...@@ -121,11 +121,6 @@ public: ...@@ -121,11 +121,6 @@ public:
return matrix_; return matrix_;
} }
/** \brief Set matrix */
template<class M>
void setMatrix(M&& m) {
matrix_ = std::forward<M>(m);
}
protected: protected:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment