[petsc-users] Rules of choosing KSPType

Jed Brown jedbrown at mcs.anl.gov
Thu Jun 13 16:52:14 CDT 2013


"Zhenglun (Alan) Wei" <zhenglun.wei at gmail.com> writes:

> Dear All,
> I hope you're having a nice day.
> Compared the user manual of PETSc 3.1 and 3.4, I found that there are
> several 'new' KSP types are added. Then, I have some confusions on which
> KSP solver I need to pick. To my knowledge, if the matrix is symmetric,
> positive definite, the CG can be used. 

Yes, if you also have an SPD preconditioner.  (This is often the case
for SPD problems, but not always.)

> Otherwise, I have to use GMRES.  My questions are: 1, What is the
> major difference among 'Conjugate Gradient', 'BiConjugate Gradient'
> and 'Conjugate Gradient Squared'? 

The orthogonality relationship is different.  This is covered in any
book on iterative methods.  You can download Saad's book from his
website, for example.

> As I tested, the CGS is slightly (5%) faster than CG on solving a
> Poisson equation with uniform Cartesian grid with PC = GAMG. The BiCG
> is not tested because it seems not be compatible with PC = GAMG.  2,
> What is the major difference among GMRES, fGMRES and dGMRES.

FGMRES is "flexible" -- the preconditioner can be a nonlinear function
(often a few iterations of another iterative method).

DGMRES is "deflated" -- it can identify some vectors to enrich the
correction, similar to a coarse grid.

> Specially, I want to solve a Poisson equation with non-uniform
> Cartesian grid. 

If you use a finite element discretization, this will be SPD.
Otherwise, it'll be "morally SPD", and any non-symmetric iteration
should be fine.


More information about the petsc-users mailing list