Mannually specify a diagonal matrix as a preconditioner?

Matthew Knepley knepley at gmail.com
Mon Mar 31 17:51:36 CDT 2008


On Mon, Mar 31, 2008 at 5:44 PM, Shi Jin <jinzishuai at yahoo.com> wrote:
>
>
> > 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?

Has nothing to do with lumping. However, I am worried about the
SAME_PRECONDITIONER
flag. Is that what you really mean? This will not recalculate the
preconditioner (meaning
reinvert the diagonal) when the system changes. Also, what PC do you
actually use? It
should be Jacobi.

  Matt

> Thank you very much.
>
> Shi
>
> > > >
> > > > 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.
>
>
>  ________________________________
> OMG, Sweet deal for Yahoo! users/friends: Get A Month of Blockbuster Total
> Access, No Cost. W00t



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which
their experiments lead.
-- Norbert Wiener




More information about the petsc-users mailing list