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 &current_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;


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to