<div dir="ltr"><div><div><div>Hi Matt,<br><br></div>Thank you for your reply.<br><br></div>That's why I am confused and need help. I set printf routines as I run my code, but it never output it on the screen. <br><br></div>Thanks!<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 27, 2014 at 2:05 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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Mon, Oct 27, 2014 at 1:02 PM, Sharp Stone <span dir="ltr"><<a href="mailto:thronesf@gmail.com" target="_blank">thronesf@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 dir="ltr"><div><div><div>Hi Matt,<br><br></div>Thank you for your reply and sorry for the confusion.<br><br></div>No. What I was trying to say is my code has never called the TSSetIJacobian() routine. I don't know why this happens, and how to resolve this either.<br></div></div></blockquote><div><br></div></span><div>If your code has not called TSSetIJacobian(), I can only assume it is because you did not put it in. However, in</div><div>the code fragment you sent, it was definitely there.</div><div><br></div><div>  Thanks,</div><div><br></div><div>    Matt</div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></div>Thank you in advance!<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 27, 2014 at 1:57 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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Mon, Oct 27, 2014 at 12:52 PM, Sharp Stone <span dir="ltr"><<a href="mailto:thronesf@gmail.com" target="_blank">thronesf@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 dir="ltr"><div><div>Dear All,<br><br></div>I'm using the TS theta solver for backward Euler method. But I found that the TSSetIJacobian() routine has never been called. I did the code just following what the example does: src/ts/examples/tutorials/ex17. I can run the example without errors. But when I run my code, it won't be as good as the example as stated above. I also attached the piece of my setups to this email. <br><br></div>How could I fix this problem? Thank you in advance!<br></div></blockquote><div><br></div></span><div>I cannot understand the paragraph above.</div><div><br></div><div>  1) TS ex17 does call TSSetIJacobian(), unless you choose a matrix-free version. You seem to imply above that it does not.</div><div><br></div><div>  2) Do you mean that you do not call it? You do not have too, since you can use the finite difference approximations offered by SNES</div><div><br></div><div>  Thanks,</div><div><br></div><div>    Matt</div><span><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br>    TSCreate(PETSC_COMM_WORLD, &ts);<br>    TSSetProblemType(ts, TS_NONLINEAR);<br>    TSSetType(ts, TSTHETA);<br>    TSThetaSetTheta(ts, 1.0);<br>    TSSetIFunction(ts, NULL, FormIFunction, &appctx);<br>    DMSetMatType(da, MATAIJ);<br>    DMCreateMatrix(da, &J);<br>    TSSetDM(ts, da);<br>    TSSetIJacobian(ts, J, J, FormIJacobian, &appctx);<br>    TSSetDuration(ts, timeStepsMax, Tend); <br>    // Evaluate initial conditions<br>    FormInitialSolution(&appctx);<br>    TSSetSolution(ts, solution); <br>    dt = 1.0;<br>    TSSetInitialTimeStep(ts, 0.0, dt); <br>    TSSolve(ts, solution);<span><font color="#888888"><br clear="all"><div><div><div><br>-- <br><div dir="ltr"><div>Best regards,</div><div><br></div>Feng</div>
</div></div></div></font></span></div>
</blockquote></span></div><span><font color="#888888"><br><br clear="all"><span><font color="#888888"><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
</font></span></font></span></div></div><span><font color="#888888">
</font></span></blockquote></div><span><font color="#888888"><br><br clear="all"><br>-- <br><div dir="ltr"><div>Best regards,</div><div><br></div>Feng</div>
</font></span></div>
</blockquote></div></div></div><div><div class="h5"><br><br clear="all"><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
</div></div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><div>Best regards,</div><div><br></div>Feng</div>
</div>