petsc-3.7.1 2016-05-15
Report Typos and Errors

MatGetLocalSubMatrix

Gets a reference to a submatrix specified in local numbering

Synopsis

#include "petscmat.h" 
PetscErrorCode MatGetLocalSubMatrix(Mat mat,IS isrow,IS iscol,Mat *submat)
Not Collective Many br

Input Arguments

mat - matrix to extract local submatrix from Many brisrow - local row indices for submatrix Many briscol - local column indices for submatrix Many br

Output Arguments

submat - the submatrix Many br

Many br

Notes

The submat should be returned with MatRestoreLocalSubMatrix(). Many br

Depending on the format of mat, the returned submat may not implement MatMult(). Its communicator may be Many brthe same as mat, it may be PETSC_COMM_SELF, or some other subcomm of mat's. Many br

The submat always implements MatSetValuesLocal(). If isrow and iscol have the same block size, then Many brMatSetValuesBlockedLocal() will also be implemented. Many br

The mat must have had a ISLocalToGlobalMapping provided to it with MatSetLocalToGlobalMapping(). Note that Many brmatrices obtained with DMCreateMat() generally already have the local to global mapping provided. Many br

See Also

MatRestoreLocalSubMatrix(), MatCreateLocalRef(), MatSetLocalToGlobalMapping()

Level:intermediate
Location:
src/mat/interface/matrix.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/snes/examples/tutorials/ex28.c.html
src/ts/examples/tutorials/ex14.c.html