#include "petscmat.h" PetscErrorCode MatGetLocalSubMatrix(Mat mat,IS isrow,IS iscol,Mat *submat)Not Collective
mat | - matrix to extract local submatrix from | |
isrow | - local row indices for submatrix | |
iscol | - local column indices for submatrix |
submat | - the submatrix |
Depending on the format of mat, the returned submat may not implement MatMult(). Its communicator may be the same as mat, it may be PETSC_COMM_SELF, or some other subcomm of mat's.
The submat always implements MatSetValuesLocal(). If isrow and iscol have the same block size, then MatSetValuesBlockedLocal() will also be implemented.
The mat must have had a ISLocalToGlobalMapping provided to it with MatSetLocalToGlobalMapping(). Note that matrices obtained with DMCreateMatrix() generally already have the local to global mapping provided.