question on DMMG

Barry Smith bsmith at mcs.anl.gov
Tue Oct 10 20:59:46 CDT 2006


  Randy,

  You use DMMGSetKSP() and set the functions to compute the 
matrix and right hand side. With galerkin these will only
be called once on the finest grid. (Without the galerkin option
it will call your matrix function on each level). You 
never "set" a matrix; PETSc calls your function to fill in
the matrix.


   Barry

On Tue, 10 Oct 2006, Randall Mackie wrote:

> Barry,
> 
> If I use DMMGSetUseGalerkinCoarse, then do I need DMMGSetKsp, and
> where do you set up the finest level grid matrix and right hand
> side?
> 
> Randy
> 
> 
> Barry Smith wrote:
> >   Randy,
> > 
> >      Take a look at src/ksp/ksp/examples/tutorials and
> > DASetCoordinates(). 
> >     You should do it all with a DMMG and then it should be
> > pretty easy.
> > 
> >    Barry
> > 
> > Note also: if you do not want to compute coarse matrices
> > you can use DMMGSetGalerkin() or -dmmg_galerkin and have
> > PETSc compute them.
> > 
> > 
> > On Tue, 10 Oct 2006, Randall Mackie wrote:
> > 
> > > I'm interested in trying to use multi-grid techniques to solve my problem,
> > > but it's unclear to me how to define the right-hand side and system matrix
> > > for my case where the grids are not uniform (ie, the grid lengths x,y,z
> > > are
> > > variable, and the grid properties are variable).
> > > 
> > > Right now I'm solving my equations using a DA. So, on the finest scale I
> > > know
> > > how to compute the RHS and the Jacobian. It's unclear to me how PETSc
> > > does the multi-gridding, and therefore how I would write my code.
> > > 
> > > Any pointers would be appreciated.
> > > 
> > > Thanks, Randy
> > > 
> > > 
> > 
> 
> 




More information about the petsc-users mailing list