petsc-3.4.2 2013-07-02

# MatGetSchurComplement

Obtain the Schur complement from eliminating part of the matrix in another part.

### Synopsis

    #include "petscksp.h"
    PetscErrorCode  MatGetSchurComplement(Mat mat,IS isrow0,IS iscol0,IS isrow1,IS iscol1,MatReuse mreuse,Mat *newmat,MatReuse preuse,Mat *newpmat)

Collective on Mat

### Input Parameters

| mat | - Matrix in which the complement is to be taken
| isrow0 | - rows to eliminate
| iscol0 | - columns to eliminate, (isrow0,iscol0) should be square and nonsingular
| isrow1 | - rows in which the Schur complement is formed
| iscol1 | - columns in which the Schur complement is formed
| mreuse | - MAT_INITIAL_MATRIX or MAT_REUSE_MATRIX, use MAT_IGNORE_MATRIX to put nothing in newmat
| preuse | - MAT_INITIAL_MATRIX or MAT_REUSE_MATRIX, use MAT_IGNORE_MATRIX to put nothing in newpmat

### Output Parameters

| newmat | - exact Schur complement, often of type MATSCHURCOMPLEMENT which is difficult to use for preconditioning
| newpmat | - approximate Schur complement suitable for preconditioning

### Note

Since the real Schur complement is usually dense, providing a good approximation to newpmat usually requires application-specific information. The default for assembled matrices is to use the diagonal of the (0,0) block which will rarely produce a scalable algorithm.

Sometimes users would like to provide problem-specific data in the Schur complement, usually only for special row and column index sets. In that case, the user should call PetscObjectComposeFunction() to set "MatNestGetSubMat_C" to their function. If their function needs to fall back to the default implementation, it should call MatGetSchurComplement_Basic().

### See Also

MatGetSubMatrix(), PCFIELDSPLIT, MatCreateSchurComplement()

Level:advanced
Location: src/ksp/ksp/utils/schurm.c
Index of all KSP routines
Table of Contents for all manual pages
Index of all manual pages