<div class="gmail_quote">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>-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> </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>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">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESComputeJacobian.html</a></div></div>