[petsc-users] TSSetIJacobian is never called

Sharp Stone thronesf at gmail.com
Mon Oct 27 13:02:32 CDT 2014


Hi Matt,

Thank you for your reply and sorry for the confusion.

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.

Thank you in advance!

On Mon, Oct 27, 2014 at 1:57 PM, Matthew Knepley <knepley at gmail.com> wrote:

> On Mon, Oct 27, 2014 at 12:52 PM, Sharp Stone <thronesf at gmail.com> wrote:
>
>> Dear All,
>>
>> 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.
>>
>> How could I fix this problem? Thank you in advance!
>>
>
> I cannot understand the paragraph above.
>
>   1) TS ex17 does call TSSetIJacobian(), unless you choose a matrix-free
> version. You seem to imply above that it does not.
>
>   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
>
>   Thanks,
>
>     Matt
>
>
>>
>>     TSCreate(PETSC_COMM_WORLD, &ts);
>>     TSSetProblemType(ts, TS_NONLINEAR);
>>     TSSetType(ts, TSTHETA);
>>     TSThetaSetTheta(ts, 1.0);
>>     TSSetIFunction(ts, NULL, FormIFunction, &appctx);
>>     DMSetMatType(da, MATAIJ);
>>     DMCreateMatrix(da, &J);
>>     TSSetDM(ts, da);
>>     TSSetIJacobian(ts, J, J, FormIJacobian, &appctx);
>>     TSSetDuration(ts, timeStepsMax, Tend);
>>     // Evaluate initial conditions
>>     FormInitialSolution(&appctx);
>>     TSSetSolution(ts, solution);
>>     dt = 1.0;
>>     TSSetInitialTimeStep(ts, 0.0, dt);
>>     TSSolve(ts, solution);
>>
>> --
>> Best regards,
>>
>> Feng
>>
>
>
>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>



-- 
Best regards,

Feng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20141027/6630ffa6/attachment.html>


More information about the petsc-users mailing list