Mannually specify a diagonal matrix as a preconditioner?

Shi Jin jinzishuai at
Mon Mar 31 17:44:32 CDT 2008

> Then my answer is the same as my second answer. To first order, I think the time
> is completely negligible, so just use an AIJ matrix. If, after measuring the
> performance, you are unhappy, then put the diagonal matrix in a vector and
> wrap MatDiagonalScale() in a MatShell.
>   Matt
Thank you.  I think I am OK with AIJ matrix and it is working fine.
But I still want to ask the first question about specifying a preconditioning matrix. Right now I am testing a first order element case since I know what it should look like and it should improve performance.  But when I do 

> > >  ierr = KSPSetOperators( solMP, M, lumpedM, SAME_PRECONDITIONER);

The solver takes more iterations to converge.  It this the correct way to specify the lumped matrix?
Thank you very much.


> > >
> > > However, instead of giving faster convergence, it actually takes more
> > > iterations to convergence than the regular one. Therefore, I wonder if
> > > setting lumpedM as Pmat is the correct way to do it. Could you please
> > > advice? I think right now lumpedM is taken as the input to compute the
> > > preconditioning matrix, using whatever method is specified by -pc_type .
> > > What I really want to do is to simply set lumpedM as the precondition
> > > matrix, without spending time to compute anything.
> > > Thank you very much.

Like movies? Here's a limited-time offer: Blockbuster Total Access for one month at no cost.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the petsc-users mailing list