[petsc-users] V-cycle multigrid with matrix shells

Jed Brown jed at 59A2.org
Thu Oct 7 06:59:42 CDT 2010


On Thu, Oct 7, 2010 at 11:45, Sylvain Barbot <sylbar.vainbot at gmail.com>wrote:
>
> questions:
> 1) is it at all possible to specify this mode of operation, from the
> finest to the coarser level, and back? Any examples out there?
>

-pc_mg_type multiplicative, or

  PCMGSetType(pc,PC_MG_MULTIPLICATIVE);


>
> 2) is it readily possible to use matrix shells with DMMG? I imagine
> the Jacobian matrix may simply be provided as a matrix shell. Is there
> any examples of multi-grid methods with shell matrices online?
>

You can do this, but you will have to define a custom smoother.  For Jacobi,
you can have your MatShell implement MatGetDiagonal and it will work.  I
thought you could implement MatGetDiagonalBlock for PBJacobi, but it's not
currently written that way (though it should be and that would be an easy
change to make).  If you want to use a multiplicative relaxation like SOR,
you would have to implement it yourself.  If you need something like ILU for
a smoother, then you will have to pay for a matrix.  Note that one
possibility is to assemble a matrix on all but the finest level so you can
use stronger smoothers there, then make do with Jacobi on the finest level.


> 3) to deal with non-uniform sampling: can I provide the coordinates of
> the finest grid with DASetCoordinates, then expect DMMG to provide the
> subsampled coordinates at the coarser levels?


Currently no, you have to set them on each level.  Perhaps you could do this
by rolling a loop over levels and applying MatRestrict using the restriction
matrix from DMMG (this might not be the sampling that you want).

Jed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20101007/3aaaeb87/attachment-0001.htm>


More information about the petsc-users mailing list