[petsc-users] TSSetIJacobian is never called

Sharp Stone thronesf at gmail.com
Mon Oct 27 12:52:58 CDT 2014


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!


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


More information about the petsc-users mailing list