:orphan:
# PCFactorGetMatrix
Gets the factored matrix from the preconditioner context.  This routine is valid only for the `PCLU`, `PCILU`, `PCCHOLESKY`, and `PCICC` methods. 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode PCFactorGetMatrix(PC pc, Mat *mat)
```
Not Collective though mat is parallel if pc is parallel


## Input Parameter

- ***pc -*** the preconditioner context



## Output parameters

- ***mat -*** the factored matrix





## Note
Does not increase the reference count for the matrix so DO NOT destroy it


## See Also
 `PC`, `PCLU`, `PCILU`, `PCCHOLESKY`, `PCICC`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/interface/precon.c.html#PCFactorGetMatrix">src/ksp/pc/interface/precon.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex52.c.html">src/ksp/ksp/tutorials/ex52.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex52f.F90.html">src/ksp/ksp/tutorials/ex52f.F90</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex57f.F90.html">src/ksp/ksp/tutorials/ex57f.F90</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex77.c.html">src/ksp/ksp/tutorials/ex77.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex77f.F90.html">src/ksp/ksp/tutorials/ex77f.F90</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/tutorials/ex1.c.html">src/ksp/pc/tutorials/ex1.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/tutorials/ex2.c.html">src/ksp/pc/tutorials/ex2.c</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/factor/factimpl.c.html#PCFactorGetMatrix_Factor">PCFactorGetMatrix_Factor in src/ksp/pc/impls/factor/factimpl.c</A><BR>


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


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