From: Roy Stogner <roystgnr@ic...>  20090224 16:48:10

On Tue, 24 Feb 2009, Mladen Jurak wrote: > I have a remark on "lines_search()" method in "NewtonSolver" class. > > The method doesn't update "current_residual" since it is passed to it > by value. The consequence is that the second call > of "test_convergence()" in "NewtonSolver::solve()" is done using > wrong value of "current_residual". Good catch! I presume you've got a test case that's inaccurately reporting divergence? Is the following patch sufficient to fix it? ===================================================================  src/solvers/newton_solver.C (revision 3290) +++ src/solvers/newton_solver.C (working copy) @@ 39,7 +39,7 @@ Real NewtonSolver::line_search(Real tol, Real last_residual,  Real current_residual, + Real ¤t_residual, NumericVector<Number> &newton_iterate, const NumericVector<Number> &linear_solution) { @@ 186,7 +186,7 @@ _system.assembly (true, false); rhs.close();  Real fu = rhs.l2_norm(); + Real fu = current_residual = rhs.l2_norm(); if (!quiet) std::cout << " Current Residual: " << fu << std::endl; 