From 50a3647a235f39c00feeeb4492038f72008c3abf Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Mon, 11 Jul 2016 22:27:14 +0200
Subject: [PATCH] Do not call check() on preconditioners

Preconditioners are supposed to be used through the

  setMatrix(M);
  apply(x, b);

interface. The members M, x, and b inherited from LinearIterationStep
will thus not be set upfront, yet if LinearIterationStep::check
was to check for anything, it should be those (pointer!) members.
---
 dune/solvers/iterationsteps/cgstep.cc | 2 --
 dune/solvers/solvers/cgsolver.cc      | 3 ---
 2 files changed, 5 deletions(-)

diff --git a/dune/solvers/iterationsteps/cgstep.cc b/dune/solvers/iterationsteps/cgstep.cc
index 3eda02e6..a34354a3 100644
--- a/dune/solvers/iterationsteps/cgstep.cc
+++ b/dune/solvers/iterationsteps/cgstep.cc
@@ -4,8 +4,6 @@
 template <class MatrixType, class VectorType>
 void CGStep<MatrixType, VectorType>::check() const
 {
-    if (preconditioner_)
-        preconditioner_->check();
     if (this->ignoreNodes_ == nullptr)
         DUNE_THROW(SolverError, "ignoreNodes_ member not set");
 }
diff --git a/dune/solvers/solvers/cgsolver.cc b/dune/solvers/solvers/cgsolver.cc
index 7233e609..d6cc5f5c 100644
--- a/dune/solvers/solvers/cgsolver.cc
+++ b/dune/solvers/solvers/cgsolver.cc
@@ -8,9 +8,6 @@
 template <class MatrixType, class VectorType>
 void CGSolver<MatrixType, VectorType>::check() const
 {
-    if (preconditioner_)
-        preconditioner_->check();
-
     if (!errorNorm_)
         DUNE_THROW(SolverError, "You need to supply a norm to a CG solver!");
 
-- 
GitLab