<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><br><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);<br clear="all"><div><div><div><br>-- <br><div dir="ltr"><div>Best regards,</div><div><br></div>Feng</div>
</div></div></div></div>