[petsc-users] TS with inhomogeneous rhs

Jed Brown jed at 59A2.org
Thu Nov 18 16:48:58 CST 2010


On Thu, Nov 18, 2010 at 23:14, Chetan Jhurani <chetan.jhurani at gmail.com>wrote:

>      M U_t = -K U + f(t)
>
> In addition, how can the code be kept nearly identical to allow different
> TS types to be used (EULER, BEULER, TSRUNGE_KUTTA, TSCRANK_NICHOLSON,
> etc)?  I'd also like to take possible advantages of M and K being
> constants.
>

As Barry says, we are transitioning to a better API for this.  You can use
TSTHETA (theta=0.5 is Crank-Nicolson, theta=1 is Backward Euler) with
TSSetIFunction and TSSetIJacobian (see the man pages or read section 6.1.2
of the users manual).  Note that an "explicit" method for your problem above
needs to solve with the mass matrix at every time step.  Unless it is very
cheap (e.g. block diagonal), then it may not be worth it.  PETSc's explicit
methods do not currently support this, but support for that will be added in
the next few months.  At present, you would need to do the solve in your
RHSFunction.

Jed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20101118/0ddeb01f/attachment.htm>


More information about the petsc-users mailing list