[petsc-users] MatSetValues() for MATMPICUSP

Jed Brown jedbrown at mcs.anl.gov
Sat Feb 11 04:43:41 CST 2012


On Sat, Feb 11, 2012 at 00:00, recrusader <recrusader at gmail.com> wrote:

> in
> http://www.mcs.anl.gov/petsc/petsc-dev/src/ksp/ksp/examples/tutorials/ex43.c.html
>
> Why are two matrices set to MATAIJ? if I set MATAIJCUSP, is them changed?
>
> 1468: DMCreateMatrix<http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/DM/DMCreateMatrix.html#DMCreateMatrix>
> (da_Stokes,MATAIJ<http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MATAIJ.html#MATAIJ>
> ,&A);
>
> 1469:   DMCreateMatrix <http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/DM/DMCreateMatrix.html#DMCreateMatrix>(da_Stokes,MATAIJ <http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MATAIJ.html#MATAIJ>,&B);
>
>
You have to follow the code down to where those matrices are used.

1478:   AssembleA_Stokes(A,da_Stokes,da_prop,properties);
1479:   AssembleA_PCStokes(B,da_Stokes,da_prop,properties);

This uses a "block preconditioner", the B matrix is intentionally different
from the A matrix in order to handle the saddle point.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120211/26558454/attachment-0001.htm>


More information about the petsc-users mailing list