From 77892183a594c044b60a3461a258d4232f93ebf8 Mon Sep 17 00:00:00 2001 From: Uli Sack <usack@math.fu-berlin.de> Date: Tue, 6 Nov 2012 15:03:11 +0000 Subject: [PATCH] Implemented interface method preprocess() (inherited from Solver). Moved call of iterationStep->preprocess from LoopSolver::solve() to LoopSolver::preprocess() ATTENTION: This might affect your code although it's not an interface change. So far the LoopSolver::preprocess() method was empty and therefore it was working - although against the dune-solvers paradigm - to call LoopSolver::solve() without calling LoopSolver::preprocess() before. Now, YOU NEED TO CALL preprocess() otherwise your iteration step will not be initialized properly. [[Imported from SVN: r7334]] --- dune/solvers/solvers/loopsolver.cc | 8 ++++++-- dune/solvers/solvers/loopsolver.hh | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dune/solvers/solvers/loopsolver.cc b/dune/solvers/solvers/loopsolver.cc index bf98e042..075c760a 100644 --- a/dune/solvers/solvers/loopsolver.cc +++ b/dune/solvers/solvers/loopsolver.cc @@ -16,6 +16,12 @@ void ::LoopSolver<VectorType, BitVectorType>::check() const IterativeSolver<VectorType,BitVectorType>::check(); } +template <class VectorType, class BitVectorType> +void LoopSolver<VectorType, BitVectorType>::preprocess() +{ + this->iterationStep_->preprocess(); +} + template <class VectorType, class BitVectorType> void LoopSolver<VectorType, BitVectorType>::solve() { @@ -25,8 +31,6 @@ void LoopSolver<VectorType, BitVectorType>::solve() // Check whether the solver is set up properly this->check(); - this->iterationStep_->preprocess(); - if (this->verbosity_ != NumProc::QUIET) std::cout << "--- LoopSolver ---\n"; diff --git a/dune/solvers/solvers/loopsolver.hh b/dune/solvers/solvers/loopsolver.hh index 7bb4185b..8312704b 100644 --- a/dune/solvers/solvers/loopsolver.hh +++ b/dune/solvers/solvers/loopsolver.hh @@ -37,6 +37,8 @@ public: */ virtual void check() const; + virtual void preprocess(); + /** \brief Loop, call the iteration procedure * and monitor convergence */ -- GitLab