[petsc-users] Analytic Jacobian verfication
Tian(ICT)
rongtian at ncic.ac.cn
Fri Jun 17 05:59:52 CDT 2011
Appreciate the quick answering. I DID get the identical solution, exact to all digital numbers (w and w/o -snes_mf_operator).
so second quick question: if the mesh happen to be structured (say one square element), can finite differenced Jacobian be the exactly same as the analytic one? Or the exactly same solution whether -snes_mf_operator or not implies something wrong in my code?
Rong
----- Original Message -----
From: Jed Brown
To: PETSc users list
Sent: Friday, June 17, 2011 6:50 PM
Subject: Re: [petsc-users] Analytic Jacobian verfication
On Fri, Jun 17, 2011 at 12:35, Tian(ICT) <rongtian at ncic.ac.cn> wrote:
If I test the code with and without -snes_mf_operator and the SNES solve gives the "exactly" same solution (can they be the exactly same?
They won't be exactly the same because the finite differenced Jacobian has more and different rounding errors from an analytic Jacobian. But they should agree to about sqrt(epsilon) which is about 7 significant digits for double precision.
, can I say the analytic Jacobian is correct?
Yes, provided the problem you ran it on exercises all nonlinear terms in your equations.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110617/5f4bf4e8/attachment.htm>
More information about the petsc-users
mailing list