<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 22, 2013 at 4:30 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"><div dir="ltr">Thank you Peter.<div class="im"><div><br></div><div>Can I simply ignore this step:</div></div><div><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(0,132,38)">
TSSetRHSJacobian(ts, J, J, SNESDefaultComputeJacobian, PETSC_NULL);</p><div class="im">
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(0,132,38)"><br></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(0,132,38)"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">And get the SNES context from TS, then set the Jacobian option this way:</span><br>

</p></div><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(0,132,38)">SNES snes;<br></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(0,132,38)">TSGetSNES(ts, &snes);</p><div class="im">
<p style="margin:0px">
</p><p style="color:rgb(0,132,38);font-family:Menlo;font-size:11px;margin:0px">SNESSetJacobian(snes, J, J, SNESDefaultComputeJacobian, PETSC_NULL);</p><p style="color:rgb(0,132,38);font-family:Menlo;font-size:11px;margin:0px">

<br></p></div></div></div></blockquote><div><br></div><div>This should work as well.  Note that SNESDefaultComputeJacobian is quite expensive and should be used for testing only, which is why I would hesitate to hard-code its use.<br>
<br></div><div>- Peter<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div class="im"><p style="color:rgb(0,132,38);font-family:Menlo;font-size:11px;margin:0px">
</p></div><p style="margin:0px"><font face="arial, sans-serif">(Guess my last email didn't work well)</font></p><span class="HOEnZb"><font color="#888888"><p style="margin:0px"> <br></p></font></span></div></div></blockquote>
</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><span class="HOEnZb"><font color="#888888"><p style="margin:0px"><font face="arial, sans-serif"></font></p>
<p style="margin:0px"><font face="arial, sans-serif">Ling</font></p>
<p></p></font></span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="im">On Wed, May 22, 2013 at 3:17 PM, Peter Brune <span dir="ltr"><<a href="mailto:prbrune@gmail.com" target="_blank">prbrune@gmail.com</a>></span> wrote:<br>

</div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>This may be done with the command-line option:<br><br></div>-snes_fd<span><font color="#888888"><br>

<br></font></span></div><span><font color="#888888">- Peter<br></font></span></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 22, 2013 at 4:03 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"><div dir="ltr">Hi All,<br><br>In 'SNESSetJacobian' I could pass 'SNESDefaultComputeJacobian' to let PETSc do the finite differencing for me to calculate Jacobian, i.e.,<br>


<br>SNESSetJacobian(snes, J, J, SNESDefaultComputeJacobian, PETSC_NULL);<br>
<br><br>In TSSetRHSJacobian, this options seems to be invalid, i.e., it requires a function to evaluate the Jacobian, i.e.,<br><br><br>TSSetRHSJacobian(ts, J, J, FormRHSJacobian, PETSC_NULL);<br><br><br>Is it possible that TS could also use PETSc finite differencing Jacobian as SNES does?<br>



<br><br>Best,<br><br><br>Ling<br></div>
</blockquote></div><br></div>
</div></div></blockquote></div></div></div><br></div>
</blockquote></div><br></div></div>