questions about TS functions

Matthew Knepley knepley at
Tue Sep 9 06:48:36 CDT 2008

2008/9/9 tsjb00 <tsjb00 at>:
> Hi! I have some questions about TS functions.
> 1. I tried to use TSDefaultComputeJacobian to provide the Jacobian matrix.
> It worked fine with TS_BEULER, but when I tried to use TS_CN, it didn't
> work. The error message indicates that it is not supported for
> Crank-Nicholson. Is it true or I might do something wrong?

Please always send the complete error message. That default just uses finite
differences to compute the Jacobian. However, for nonlinear problems with
changing Jacobians, we manipulate the matrix directly in CN. In order to use
the FD code, we would need to recode this using a MatShell.

> 2. Is there a specific PETSc function to evaluate Jacobian for TS_CN? Any
> example of using TS_CN that I can refer to?

No. You would need to form the Jacobian yourself.

> 3. I tried to solve a simple time evolving diffusion problem with TS, using
> TS_BEULER and non-linear solver. When I tried to use big time step, sever
> over-prediction is observed. I would appreciate any suggestion on the
> criteria of maximum time step allowed. If I really need to use big time
> steps, any tips to set up TS to improve the results?

Its not clear from your description whether this is a stability or
accuracy problem.


> Many thanks in advance!
> BJ
> ________________________________
> 一点即聊,MSN推出新功能"点我!" 马上试试!
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

More information about the petsc-users mailing list