[petsc-users] -snes_type test
Jed Brown
jed at 59A2.org
Fri Mar 18 06:54:33 CDT 2011
On Fri, Mar 18, 2011 at 12:41, Gianluca Meneghello <gianmail at gmail.com>wrote:
> One more thing: what does the three lines stand for then? I was
> thinking it was three Newton steps, but I understand it's not...
>
It is your Jacobian evaluated at user-defined state, constant -1.0, and
constant 1.0. I added this to the output for petsc-dev:
$ ./ex5 -snes_type test
Testing hand-coded Jacobian, if the ratio is
O(1.e-8), the hand-coded Jacobian is probably correct.
Run with -snes_test_display to show difference
of hand-coded and finite difference Jacobian.
Norm of matrix ratio 2.77166e-08 difference 2.17871e-07 (user-defined state)
Norm of matrix ratio 1.34123e-08 difference 1.23213e-07 (constant state
-1.0)
Norm of matrix ratio 1.31875e-07 difference 9.05494e-07 (constant state 1.0)
[0]PETSC ERROR: SNESSolve() line 2360 in
/home/jed/petsc/src/snes/interface/snes.c
[0]PETSC ERROR: main() line 220 in src/snes/examples/tutorials/ex5.c
>
> The output I sent was actually the output of one of your examples. The
> one from my own code is
>
> Testing hand-coded Jacobian, if the ratio is
> O(1.e-8), the hand-coded Jacobian is probably correct.
> Run with -snes_test_display to show difference
> of hand-coded and finite difference Jacobian.
> Norm of matrix ratio 9.17257e-08 difference 2.58876e-05
>
Is your starting state zero?
> Norm of matrix ratio 1.45865e-06 difference 0.000430034
> Norm of matrix ratio 1.47148e-06 difference 0.000429436
>
If your problem is ill-conditioned, this might come from differencing error.
Try with -mat_fd_type ds to use a slightly more robust scheme. You can also
run with -ksp_rtol 1e-12 -pc_type lu -snes_monitor and check if you see
quadratic convergence.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110318/42d2eb72/attachment.htm>
More information about the petsc-users
mailing list