[petsc-users] Multigrid preconditioning

Michele Rosso mrosso at uci.edu
Mon Jul 30 16:39:22 CDT 2012


Thank you,

I will try to use option 2 as you suggested.
I'd prefer to implement the multigrid  preconditioner directly inside 
the code
rather then using he command line options.
Could you point me to an example where this (or something similar) is done?

Thank you,

Michele


On 07/30/2012 02:18 PM, Jed Brown wrote:
> On Mon, Jul 30, 2012 at 4:06 PM, Michele Rosso <mrosso at uci.edu 
> <mailto:mrosso at uci.edu>> wrote:
>
>     Hi,
>
>     I am solving a variable coefficients Poisson equation with
>     periodic BCs.
>     The equation is discretized by using the standard 5-points stencil
>     finite differencing scheme.
>     I managed to solve the system successfullywith the PCG method and
>     now I would like to add
>     a preconditioner to speed up the calculation. My idea is to use
>     the multigrid preconditioner.
>
>     Example ex22f.F implements what I think I need.
>     If I understand correctly example ex22f.F, the subroutines
>     "ComputeRHS" and "ComputeMatrix" define how the
>     matrix and rhs-vector have to be computed at each level.
>     In my case tough, both the jacobian and the rhs-vector cannot be
>     computed "analytically", that is, they depend on variables
>     whose values are available only at the finest grid.
>
>     How can I overcome this difficulty?
>
>
> Two possibilities:
>
> 1. homogenize on your own and rediscretize
>
> 2. use Galerkin coarse operators (possibly with algebraic multigrid)
>
>
> Option 2 is much more convenient because it never
>
> For geometric multigrid using DMDA, just use -pc_type mg -pc_mg_galerkin
>
> For algebraic multigrid, use -pc_type gamg -pc_gamg_agg_nsmooths 1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120730/59429f02/attachment.html>


More information about the petsc-users mailing list