[petsc-users] Problem with SNES

Jed Brown jedbrown at mcs.anl.gov
Mon Aug 29 07:43:08 CDT 2011


On Mon, Aug 29, 2011 at 06:39, Milan Mitrovic <milan.v.mitrovic at gmail.com>wrote:

> so I guess this means that it is slightly wrong :)
>

Or your system is somewhat ill-conditioned. If you add '-mat_fd_type ds' to
the last command line, are the errors similar or improve a bit? A different
way to test for a correct Jacobian is to run with

-snes_mf_operator -pc_type lu

and check that it converges in 1 or occasionally 2 iterations. This also
helps if the Jacobian is incorrect, but not visibly so on the first
iteration (e.g. because nonlinearities are silent for the initial guess).


> can you explain now what it is doing here (and why I get this
> error)...
>

The error to exit early because "test" is not intended to actually solve the
equation, -snes_type test is supposed to do that.


> can I make it try to solve the equation with the
> approximated fd jacobian (is it doing that already?)
>

-snes_mf_operator : solve with matrix-free finite differenced Jacobian,
preconditioned using the matrix you assembled
-snes_fd : assemble the dense FD operator (same as created by -snes_type
test) and solve using that
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110829/62696564/attachment.htm>


More information about the petsc-users mailing list