petsc-3.7.1 2016-05-15
Report Typos and Errors

SNESTEST

Test hand-coded Jacobian against finite difference Jacobian

Options Database

-snes_type test - use a SNES solver that evaluates the difference between hand-code and finite-difference Jacobians Many br
-snes_test_display - display the elements of the matrix, the difference between the Jacobian approximated by finite-differencing and hand-coded Jacobian Many br

Many br

Notes: This solver is not a solver and does not converge to a solution. SNESTEST checks the Jacobian at three Many brpoints: the 0, 1, and -1 solution vectors. At each point the following is reported. Many br

Output

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

Frobenius norm is used in the above throughout. After doing these three tests, it always aborts with the error message Many br"SNESTest aborts after Jacobian test". No other behavior is to be expected. It may be similarly used to check if a Many brSNES function is the gradient of an objective function set with SNESSetObjective(). Many br

See Also

SNESCreate(), SNES, SNESSetType(), SNESUpdateCheckJacobian(), SNESNEWTONLS, SNESNEWTONTR

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