[petsc-users] Assembling a matrix from submatrices

Jan Essert netz at essert.name
Tue Apr 23 01:54:49 CDT 2013

Dear Jed,

> This won't work either because MatGetLocalSubMatrix() does not work that
> way and because MAT_REUSE_MATRIX requires that you have already used
> that matrix for the given operation.
> You can create a MATNEST for the coupled matrix, but if you want it
> fully assembled, you'll have to loop over the rows and call
> MatSetValues.  We have a partial implementation of MatConvert_Nest_AIJ
> that, once completed, will provide a nicer interface for this.

Thank you, looping over the rows worked fine.
I was just confused since the other method looked as if it was the right
way to do this.

Sorry for bothering you with this..

More information about the petsc-users mailing list