Thank you Matt. I am working under MOOSE framework, so I am afraid I am not able to do it alone. I will seek help from them.<div><br></div><div>Thanks<br><div><br></div><div>Ling<br><br><div class="gmail_quote">On Wed, Sep 19, 2012 at 2:35 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Wed, Sep 19, 2012 at 3:34 PM, Zou (Non-US), Ling <span dir="ltr"><<a href="mailto:ling.zou@inl.gov" target="_blank">ling.zou@inl.gov</a>></span> wrote:<br>
</div><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>==================================================</div><div>Framework Information:</div><div>SVN Revision:            13656</div><div>PETSc Version:           3.1.0</div><div>Current Time:            Wed Sep 19 14:17:01 2012</div>


<div>Executable Timestamp:    Wed Sep 19 14:14:46 2012</div>==================================================<div><br></div><div>I believe my version is 3.1.0.</div></blockquote><div><br></div></div><div>If you upgrade to the latest release, it will work.</div>

<div><br></div><div>   Matt</div><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Ling</div><div><br></div><div><br></div>
<div><br><div class="gmail_quote">On Wed, Sep 19, 2012 at 2:31 PM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Are you using an older version of PETSc?<div><div><br><br><div class="gmail_quote">On Wed, Sep 19, 2012 at 2:56 PM, Zou (Non-US), Ling <span dir="ltr"><<a href="mailto:ling.zou@inl.gov" target="_blank">ling.zou@inl.gov</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">No Jacobian output showed when I did this,<div><br></div><div>./my-project-opt -i input.i -snes_compare_explicit</div>


<div>
<br></div><div>Any suggestion?</div><span><font color="#888888"><div><br></div><div>Ling</div></font></span><div><div><div><br></div><div><br><br><div class="gmail_quote">
On Wed, Sep 19, 2012 at 1:12 PM, Zou (Non-US), Ling <span dir="ltr"><<a href="mailto:ling.zou@inl.gov" target="_blank">ling.zou@inl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<br><br><div class="gmail_quote"><div>On Wed, Sep 19, 2012 at 1:03 PM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div class="gmail_quote"><div>On Wed, Sep 19, 2012 at 1:54 PM, Zou (Non-US), Ling <span dir="ltr"><<a href="mailto:ling.zou@inl.gov" target="_blank">ling.zou@inl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">






Dear Matt,<div><br></div><div>Thanks again for helping me on the '-snes_type test' issue. This is a great tool which helped us make really good progress recently.</div><div><br></div><div>I have couple of more questions about the '-snes_type test'. From my understanding, this finite difference method is based on a tiny perturbation from a base solution vector. This base solution vector, from my observation, seems to be [1, 1, 1, ....].  However, this solution vector sometimes is very far from real physics, which causes issue, for example a dependent pressure variable get negative value.</div>







<div><br></div><div>I wonder,</div><div>1), if this [1, 1, 1, ...] base solution vector is always used during the real simulation, for example when using the finite difference preconditioner. Or this base solution vector will change as solution gets updated?</div>






</blockquote><div><br></div></div><div>-snes_type test tries three different states: your user-defined state, then constant -1.0, then constant +1.0. It does not solve the system so you can't continue stepping, but you can just look at the result from the first test.</div>





</div></blockquote><div><br></div></div><div>Ahhh....... I see, that's why I always see three comparisons there. The first one should help me better when dealing with real simulation case.</div><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div class="gmail_quote"><div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>2), is it possible to choose a different base solution, for example, [1000, 1000, 1000, 10, 10, 10, 1.e9, 1.e9, 1.e9] as the base solution vector when using the '-snes_type test'  option to test my hand-coded Jacobian.</div>






</blockquote><div><br></div></div><div>You can also use -snes_compare_explicit which shows the matrix (only linearized around your actual state) and actually solves the system. There is also -snes_compare_explicit_draw. If you know that you preallocated correctly, -snes_compare_coloring is better. Details here.</div>






<div><br></div><div><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESComputeJacobian.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESComputeJacobian.html</a></div>





</div></blockquote><div><br></div></div><div>This is something new to me. I'd take a look at the link. Thanks a lot, Jed.</div><div><br></div><div>Best,</div><div><br></div><div>Ling</div></div><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br></div>
</blockquote></div></div><br><br clear="all"><div class="HOEnZb"><div class="h5"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>

-- Norbert Wiener<br>
</div></div></blockquote></div><br></div></div>