[petsc-users] TSSetIJacobian is never called

Matthew Knepley knepley at gmail.com
Mon Oct 27 12:57:49 CDT 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20141027/ee6b1767/attachment.html>


More information about the petsc-users mailing list