[petsc-users] MatGetLocalSubMatrix?

Barry Smith bsmith at mcs.anl.gov
Sat Jul 25 15:10:52 CDT 2015


> On Jul 18, 2015, at 12:49 PM, Mark Adams <mfadams at lbl.gov> wrote:
> 
> I have a 4x4 block matrix, in one big AIJ matrix.  I use (global) ISs to address individual fields.  I have a mass matrix for one field.  I would like to add a scaled mass matrix to one field at a time.  
> 
> MatGetLocalSubMatrix looks like what I want but it takes local indices.  My ISs are global.  It seems like I should be able to do this without making a local IS (shift the IS by the first equation index for the process).  Am I missing something?

  I think there also needs to be a MatGetGlobalSubMatrix(), this would be a "smart" matrix that takes global indices. So for example if you have a DMComposite and in it two DMDA then you should be able to pull out either the matrices associated with the DMDA and index into them with global indices just like you had gotten the matrix directly from DMDACreateMatrix().

  Barry


> 
> Mark



More information about the petsc-users mailing list