# TS

Matthew Knepley knepley at gmail.com
Tue Feb 20 17:47:54 CST 2007

```On 2/20/07, Manav Bhatia <manav at u.washington.edu> wrote:
> Hi
>
>      I am preparing my code to use the TS capability of Petsc, and I
> had a few doubts to clear up. These primarily relate to the set up of
> the problem, and I have stated them below. Please correct me if I am
> wrong.
>
> -- For a linear transient problem, I understand that the following
> different combinations are possible:
> 1>  A(t) U_t = f (t)
>         where I will have to call the setLHSMatrix() and setRHSFunction()
> functions during set up.
> 2> A(t) U_t = B(t) U
>         where I will have to call the setLHSMatrix() and setRHSMatrix()
> functions during set up.
> 3> U_t = f(t)
>         where I call only the setRHSfunction()
> 4> U_t = A(t) U
>         where I call only the setRHSMatrix()
>
>
> -- For a nonlinear transient problem, I understand that the following
> different combinations are possible:
> 1>  A(t) U_t = f (U, t)
>         where I will have to call the setLHSMatrix() and setRHSFunction(),
> and setRHSJacobian() functions during set up.
> 2> U_t = f(U, t)
>         where I will have to call the setRHSfunction() and setRHSJacobian()
> functions during set up.

This sounds correct. You do not have to specify the Jacobian, as we can
automatically give a FD approximation, but it is better to do so.

>
> -- setting KSP and PC types
>    From what I understand, I can set up the KSP and PC type of the
> transient solver, which will be used only if I specify an A matrix
> for the problem. In addition, I can independently set the KSP and PC
> type of the SNES used by TS, which is used by the time solver.

The solver is only used if you specify an implicit method. The KSP and PC
type are used by either a SNES or just the KSP itself depending on whether
the problem is nonlinear.

Matt

>
>
> Thanks,
> Manav
>
>

--
One trouble is that despite this system, anyone who reads journals widely
and critically is forced to realize that there are scarcely any bars to eventual
publication. There seems to be no study too fragmented, no hypothesis too
trivial, no literature citation too biased or too egotistical, no design too
warped, no methodology too bungled, no presentation of results too
inaccurate, too obscure, and too contradictory, no analysis too self-serving,
no argument too circular, no conclusions too trifling or too unjustified, and
no grammar and syntax too offensive for a paper to end up in print. --
Drummond Rennie

```