[petsc-users] Matrix-free vs finite differenced Jacobian approximation

Alexander Lindsay alexlindsay239 at gmail.com
Tue Dec 12 09:54:08 CST 2017


I'm working with a relatively new set of physics (new to me) and the
Jacobians are bad. While debugging the Jacobians, I've been running with
different finite difference approximations. I've found in general that
matrix-free approximation of the Jacobian action leads to much better
convergence than explicitly forming the Jacobian matrix using finite
differences. Should I be surprised by this or is this something that's
known? It would be great if anyone has a reference they could point me to.

Just to illustrate the different solves:

Matrix-free (preconditioner formed from finite-differenced approximation of
Jacobian):

 0 Nonlinear |R| = 2.259203e-02
      0 Linear |R| = 2.259203e-02
      1 Linear |R| = 2.259203e-02
      2 Linear |R| = 1.682777e-02
      3 Linear |R| = 9.274378e-09
 1 Nonlinear |R| = 1.744830e-02
      0 Linear |R| = 1.744830e-02
      1 Linear |R| = 2.335817e-08
 2 Nonlinear |R| = 2.704512e-08
      0 Linear |R| = 2.704512e-08
      1 Linear |R| = 1.265577e-14
 3 Nonlinear |R| = 1.478929e-10
 Solve Converged!

Explicit formation of Jacobian using finite-differences (preconditioner
formed from same matrix):

 0 Nonlinear |R| = 2.259203e-02
      0 Linear |R| = 2.259203e-02
      1 Linear |R| = 2.259203e-02
      2 Linear |R| = 1.481452e-12
 1 Nonlinear |R| = 2.258733e-02
      0 Linear |R| = 2.258733e-02
      1 Linear |R| = 2.258520e-02
      2 Linear |R| = 1.594456e-07
 2 Nonlinear |R| = 2.258733e-02
      0 Linear |R| = 2.258733e-02
      1 Linear |R| = 2.258520e-02
      2 Linear |R| = 1.869913e-07
Nonlinear solve did not converge due to DIVERGED_LINE_SEARCH iterations 2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20171212/44d5b540/attachment-0001.html>


More information about the petsc-users mailing list