<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19019">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Appreciate the quick answering. I DID get the identical
solution, exact to all digital numbers (w and w/o
-snes_mf_operator).</FONT></DIV>
<DIV><FONT size=2>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?</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Rong</FONT></DIV>
<DIV> </DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px"
dir=ltr>
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B>
<A title=jed@59A2.org href="mailto:jed@59A2.org">Jed Brown</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=petsc-users@mcs.anl.gov
href="mailto:petsc-users@mcs.anl.gov">PETSc users list</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, June 17, 2011 6:50 PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [petsc-users] Analytic
Jacobian verfication</DIV>
<DIV><BR></DIV>
<DIV class=gmail_quote>On Fri, Jun 17, 2011 at 12:35, Tian(ICT) <SPAN
dir=ltr><<A
href="mailto:rongtian@ncic.ac.cn">rongtian@ncic.ac.cn</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>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?</BLOCKQUOTE>
<DIV><BR></DIV>
<DIV>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.</DIV>
<DIV> </DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>, can I say the analytic Jacobian is
correct?</BLOCKQUOTE></DIV><BR>
<DIV>Yes, provided the problem you ran it on exercises all nonlinear terms in
your equations.</DIV></BLOCKQUOTE></BODY></HTML>