petsc-3.7.3 2016-08-01
Report Typos and Errors

SNESUpdateCheckJacobian

Checks each Jacobian computed by the nonlinear solver comparing the users function with a finite difference computation.

Synopsis

PetscErrorCode SNESUpdateCheckJacobian(SNES snes,PetscInt it)

Options Database

-snes_check_jacobian - use this every time SNESSolve() is called
-snes_check_jacobian_view - Display difference between Jacobian approximated by finite-differencing and the hand-coded Jacobian

Output

difference - ||J - Jd||, the norm of the difference of the hand-coded Jacobian J and the approximate Jacobian Jd obtained by finite-differencing the residual,
ratio - ||J - Jd||/||J||, the ratio of the norms of the above difference and the hand-coded Jacobian.

Notes

Frobenius norm is used in the above throughout. This check is carried out every SNES iteration.

See Also

SNESTEST, SNESCreate(), SNES, SNESSetType(), SNESNEWTONLS, SNESNEWTONTR, SNESSolve()

Level:intermediate
Location:
src/snes/impls/test/snestest.c
Index of all SNES routines
Table of Contents for all manual pages
Index of all manual pages