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

# MatGetSchurComplement

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

### Synopsis

    #include "petscksp.h"
    PetscErrorCode  MatGetSchurComplement(Mat A,IS isrow0,IS iscol0,IS isrow1,IS iscol1,MatReuse mreuse,Mat *S,MatSchurComplementAinvType ainvtype,MatReuse preuse,Mat *Sp)

Collective on Mat Many br

### Input Parameters

| A | - matrix in which the complement is to be taken Many br
| isrow0 | - rows to eliminate Many br
| iscol0 | - columns to eliminate, (isrow0,iscol0) should be square and nonsingular Many br
| isrow1 | - rows in which the Schur complement is formed Many br
| iscol1 | - columns in which the Schur complement is formed Many br
| mreuse | - MAT_INITIAL_MATRIX or MAT_REUSE_MATRIX, use MAT_IGNORE_MATRIX to put nothing in S Many br
| plump | - the type of approximation used for the inverse of the (0,0) block used in forming Sp: Many brMAT_SCHUR_COMPLEMENT_AINV_DIAG or MAT_SCHUR_COMPLEMENT_AINV_LUMP Many br
| preuse | - MAT_INITIAL_MATRIX or MAT_REUSE_MATRIX, use MAT_IGNORE_MATRIX to put nothing in Sp Many br

### Output Parameters

| S | - exact Schur complement, often of type MATSCHURCOMPLEMENT which is difficult to use for preconditioning Many br
| Sp | - approximate Schur complement suitable for preconditioning Many br

### Note

Since the real Schur complement is usually dense, providing a good approximation to newpmat usually requires Many brapplication-specific information. The default for assembled matrices is to use the inverse of the diagonal of Many brthe (0,0) block A00 in place of A00^{-1}. This rarely produce a scalable algorithm. Optionally, A00 can be lumped Many brbefore forming inv(diag(A00)). Many br

Sometimes users would like to provide problem-specific data in the Schur complement, usually only for special row Many brand column index sets. In that case, the user should call PetscObjectComposeFunction() on the *S matrix and pass mreuse of MAT_REUSE_MATRIX to set Many br"MatGetSchurComplement_C" to their function. If their function needs to fall back to the default implementation, it Many brshould call MatGetSchurComplement_Basic(). Many br

Many br

### See Also

MatGetSubMatrix(), PCFIELDSPLIT, MatCreateSchurComplement(), MatSchurComplementAinvType

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