From 31daaae90af66572f0a8846de92ac204be40a15e Mon Sep 17 00:00:00 2001 From: Bernd Flemisch <bernd@iws.uni-stuttgart.de> Date: Thu, 4 Oct 2012 08:54:23 +0000 Subject: [PATCH] Allow newtonSolveLinear to change the matrix, since this is required by some solvers, e.g. AMG, and we do not want to make the extra effort of copying everything. In general, changing the matrix could have negative consequences for partial reassembly and Jacobian recycling. For AMG, this does not seem to be the case, partial reassembly and recycling work as before. Reviewed by Christoph. git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@9180 2fb0f335-1f38-0410-981e-8018bf24f1b0 --- dumux/boxmodels/common/boxassembler.hh | 4 ++++ dumux/nonlinear/newtoncontroller.hh | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dumux/boxmodels/common/boxassembler.hh b/dumux/boxmodels/common/boxassembler.hh index 6cf1bddc2f..4bd8b67321 100644 --- a/dumux/boxmodels/common/boxassembler.hh +++ b/dumux/boxmodels/common/boxassembler.hh @@ -530,12 +530,16 @@ public: */ const JacobianMatrix& matrix() const { return *matrix_; } + JacobianMatrix& matrix() + { return *matrix_; } /*! * \brief Return constant reference to global residual vector. */ const SolutionVector& residual() const { return residual_; } + SolutionVector& residual() + { return residual_; } private: static bool enableJacobianRecycling_() diff --git a/dumux/nonlinear/newtoncontroller.hh b/dumux/nonlinear/newtoncontroller.hh index 9a16ef892c..ee8418376e 100644 --- a/dumux/nonlinear/newtoncontroller.hh +++ b/dumux/nonlinear/newtoncontroller.hh @@ -368,9 +368,9 @@ public: * \param x The vector which solves the linear system * \param b The right hand side of the linear system */ - void newtonSolveLinear(const JacobianMatrix &A, + void newtonSolveLinear(JacobianMatrix &A, SolutionVector &x, - const SolutionVector &b) + SolutionVector &b) { try { if (numSteps_ == 0) -- GitLab