8.1.2. Using PVODE from PETSc

Up: Contents Next: Solving Steady-State Problems with Pseudo-Timestepping Previous: Solving Time-dependent Problems

PVODE is a parallel ODE solver developed by Hindmarsh et al. at LLNL. The TS component provides an interface to use PVODE directly from PETSc. (To install PETSc to use PVODE, see the installation guide, docs/installation.html.)

To use the PVODE integrators, call

  ierr = TSSetType(TS ts,TSType TS_PVODE); 
or use the command line option -ts_type pvode.

PVODE comes with to main integrator families, Adams and BDF (backward differentiation formula). One can select these with

  ierr = TSPVodeSetType(TS ts,TSPVodeType [PVODE_ADAMS,PVODE_BDF]); 
or the command line option -ts_pvode_type <adams,bdf>. BDF is the default.

PVODE does not use the SNES component of PETSc for its nonlinear solvers, so one cannot change the nonlinear solver options via SNES. Rather, PVODE uses the preconditioners within the PC component of PETSc, which can be accessed via

  ierr = TSPVodeGetPC(TS ts,PC *pc); 
The user can then directly set preconditioner options; alternatively, the usual runtime options can be employed via -pc_xxx.

Finally, one can set the PVODE tolerances via

  ierr = TSPVodeSetTolerance(TS ts,double abs,double rel); 
where abs denotes the absolute tolerance and rel the relative tolerance.

Other PETSc-PVode options include

   ierr = TSPVodeSetGramSchmidtType(TS ts,TSPVodeGramSchmidtType type); 
where type is either PVODE_MODIFIED_GS or PVODE_UNMODIFIED_GS. This may be set via the options data base with -ts_pvode_gramschmidt_type <modifed,unmodified>.

The routine

   ierr = TSPVodeSetGMRESRestart(TS ts,int restart); 
sets the number of vectors in the Krylov subpspace used by GMRES. This may be set in the options database with -ts_pvode_gmres_restart restart.


Up: Contents Next: Solving Steady-State Problems with Pseudo-Timestepping Previous: Solving Time-dependent Problems