# MatCreateSchurComplementPmat
create a preconditioning matrix for the Schur complement by explicitly assembling the sparse matrix Sp = A11 - A10 inv(DIAGFORM(A00)) A01 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode MatCreateSchurComplementPmat(Mat A00, Mat A01, Mat A10, Mat A11, MatSchurComplementAinvType ainvtype, MatReuse preuse, Mat *Sp)
```
Collective on A00


## Input Parameters

- ***A00      -*** the upper-left part of the original matrix A = [A00 A01; A10 A11]
- ***A01      -*** (optional) the upper-right part of the original matrix A = [A00 A01; A10 A11]
- ***A10      -*** (optional) the lower-left part of the original matrix A = [A00 A01; A10 A11]
- ***A11      -*** (optional) the lower-right part of the original matrix A = [A00 A01; A10 A11]
- ***ainvtype -*** type of approximation for DIAGFORM(A00) used when forming Sp = A11 - A10 inv(DIAGFORM(A00)) A01. See MatSchurComplementAinvType.
- ***preuse   -*** `MAT_INITIAL_MATRIX` for a new Sp, or `MAT_REUSE_MATRIX` to reuse an existing Sp, or `MAT_IGNORE_MATRIX` to put nothing in Sp



## Output Parameter

- ***Sp    -*** approximate Schur complement suitable for preconditioning the true Schur complement S = A11 - A10 inv(A00) A01





## See Also
 [](chapter_ksp), `MatCreateSchurComplement()`, `MatGetSchurComplement()`, `MatSchurComplementGetPmat()`, `MatSchurComplementAinvType`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/utils/schurm/schurm.c.html#MatCreateSchurComplementPmat">src/ksp/ksp/utils/schurm/schurm.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/ksp/utils/schurm/schurm.c)


[Index of all KSP routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
