Matrix-free multigrid

Barry Smith bsmith at
Mon Aug 24 14:38:05 CDT 2009


     The high-level DMMG interface to PETSc's linear multigrid  
currently only generates AIJ or BAIJ matrices and hence the easy  
support for -dmmg_grid_sequence
only works for AIJ or BAIJ matrices.  Sorry about this.

    A temporary fix for this would be to modify DAGetMatrix() to also  
accept MATMFFD type and generate the right matrix in that case. If you  
know C you can easily add
this; the code is in src/dm/da/utils/fdda.c


My long term plan is for DAGetMatrix() to actually take as input a  
matrix whose type has been set and then just add additional  
information to it. For matrix-free it would
just add the matrix sizes, for AIJ and BAIJ it would add the  
preallocation and nonzero structure.

On Aug 19, 2009, at 10:54 PM, Hal Finkel wrote:

> Hello,
> I'd like to try using a matrix-free Newton method with a multigrid  
> object configured with -dmmg_grid_sequence, but I don't understand  
> how. Using SNES directly, I can set -snes_mf, but this does not  
> seems to work with the multigrid object, and DMMGSetSNES() always  
> allocates a matrix.
> Thank you in advance,
> Hal

More information about the petsc-users mailing list