# PCSetUp
Prepares for the use of a preconditioner. 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode PCSetUp(PC pc)
```
Collective on pc


## Input Parameter

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





## See Also
 `PC`, `PCCreate()`, `PCApply()`, `PCDestroy()`

## Level
developer

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/bench_pcsetup.c.html">src/ksp/ksp/tutorials/bench_pcsetup.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex76.c.html">src/ksp/ksp/tutorials/ex76.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex70.c.html">src/snes/tutorials/ex70.c.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/amgx/amgx.cxx.html#PCSetUp_AMGX">PCSetUp_AMGX in src/ksp/pc/impls/amgx/amgx.cxx</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/asm/asm.c.html#PCSetUp_ASM">PCSetUp_ASM in src/ksp/pc/impls/asm/asm.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/bddc/bddc.c.html#PCSetUp_BDDC">PCSetUp_BDDC in src/ksp/pc/impls/bddc/bddc.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/bddc/bddc.c.html#PCSetUp_BDDCIPC">PCSetUp_BDDCIPC in src/ksp/pc/impls/bddc/bddc.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/bjacobi/bjacobi.c.html#PCSetUp_BJacobi">PCSetUp_BJacobi in src/ksp/pc/impls/bjacobi/bjacobi.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/bjacobi/bjkokkos/bjkokkos.kokkos.cxx.html#PCSetUp_BJKOKKOS">PCSetUp_BJKOKKOS in src/ksp/pc/impls/bjacobi/bjkokkos/bjkokkos.kokkos.cxx</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/chowiluviennacl/chowiluviennacl.cxx.html#PCSetUp_CHOWILUVIENNACL">PCSetUp_CHOWILUVIENNACL in src/ksp/pc/impls/chowiluviennacl/chowiluviennacl.cxx</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/composite/composite.c.html#PCSetUp_Composite">PCSetUp_Composite in src/ksp/pc/impls/composite/composite.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/cp/cp.c.html#PCSetUp_CP">PCSetUp_CP in src/ksp/pc/impls/cp/cp.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/deflation/deflation.c.html#PCSetUp_Deflation">PCSetUp_Deflation in src/ksp/pc/impls/deflation/deflation.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/eisens/eisen.c.html#PCSetUp_Eisenstat">PCSetUp_Eisenstat in src/ksp/pc/impls/eisens/eisen.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/factor/cholesky/cholesky.c.html#PCSetUp_Cholesky">PCSetUp_Cholesky in src/ksp/pc/impls/factor/cholesky/cholesky.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/factor/icc/icc.c.html#PCSetUp_ICC">PCSetUp_ICC in src/ksp/pc/impls/factor/icc/icc.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/factor/ilu/ilu.c.html#PCSetUp_ILU">PCSetUp_ILU in src/ksp/pc/impls/factor/ilu/ilu.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/factor/lu/lu.c.html#PCSetUp_LU">PCSetUp_LU in src/ksp/pc/impls/factor/lu/lu.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/factor/qr/qr.c.html#PCSetUp_QR">PCSetUp_QR in src/ksp/pc/impls/factor/qr/qr.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/fieldsplit/fieldsplit.c.html#PCSetUp_FieldSplit">PCSetUp_FieldSplit in src/ksp/pc/impls/fieldsplit/fieldsplit.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/galerkin/galerkin.c.html#PCSetUp_Galerkin">PCSetUp_Galerkin in src/ksp/pc/impls/galerkin/galerkin.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/gamg/gamg.c.html#PCSetUp_GAMG">PCSetUp_GAMG in src/ksp/pc/impls/gamg/gamg.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/gasm/gasm.c.html#PCSetUp_GASM">PCSetUp_GASM in src/ksp/pc/impls/gasm/gasm.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/h2opus/pch2opus.c.html#PCSetUp_H2OPUS">PCSetUp_H2OPUS in src/ksp/pc/impls/h2opus/pch2opus.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/hmg/hmg.c.html#PCSetUp_HMG">PCSetUp_HMG in src/ksp/pc/impls/hmg/hmg.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/hpddm/pchpddm.cxx.html#PCSetUp_HPDDMShell">PCSetUp_HPDDMShell in src/ksp/pc/impls/hpddm/pchpddm.cxx</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/hpddm/pchpddm.cxx.html#PCSetUp_HPDDM">PCSetUp_HPDDM in src/ksp/pc/impls/hpddm/pchpddm.cxx</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/hypre/hypre.c.html#PCSetUp_HYPRE">PCSetUp_HYPRE in src/ksp/pc/impls/hypre/hypre.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/hypre/hypre.c.html#PCSetUp_PFMG">PCSetUp_PFMG in src/ksp/pc/impls/hypre/hypre.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/hypre/hypre.c.html#PCSetUp_SysPFMG">PCSetUp_SysPFMG in src/ksp/pc/impls/hypre/hypre.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/hypre/hypre.c.html#PCSetUp_SMG">PCSetUp_SMG in src/ksp/pc/impls/hypre/hypre.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/is/nn/nn.c.html#PCSetUp_NN">PCSetUp_NN in src/ksp/pc/impls/is/nn/nn.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/jacobi/jacobi.c.html#PCSetUp_Jacobi">PCSetUp_Jacobi in src/ksp/pc/impls/jacobi/jacobi.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/ksp/pcksp.c.html#PCSetUp_KSP">PCSetUp_KSP in src/ksp/pc/impls/ksp/pcksp.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/lmvm/lmvmpc.c.html#PCSetUp_LMVM">PCSetUp_LMVM in src/ksp/pc/impls/lmvm/lmvmpc.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/lsc/lsc.c.html#PCSetUp_LSC">PCSetUp_LSC in src/ksp/pc/impls/lsc/lsc.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/mg/mg.c.html#PCSetUp_MG">PCSetUp_MG in src/ksp/pc/impls/mg/mg.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/ml/ml.c.html#PCSetUp_ML">PCSetUp_ML in src/ksp/pc/impls/ml/ml.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/mpi/pcmpi.c.html#PCSetUp_Seq">PCSetUp_Seq in src/ksp/pc/impls/mpi/pcmpi.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/mpi/pcmpi.c.html#PCSetUp_MPI">PCSetUp_MPI in src/ksp/pc/impls/mpi/pcmpi.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/parms/parms.c.html#PCSetUp_PARMS">PCSetUp_PARMS in src/ksp/pc/impls/parms/parms.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/patch/pcpatch.c.html#PCSetUp_PATCH">PCSetUp_PATCH in src/ksp/pc/impls/patch/pcpatch.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/pbjacobi/pbjacobi.c.html#PCSetUp_PBJacobi">PCSetUp_PBJacobi in src/ksp/pc/impls/pbjacobi/pbjacobi.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/redistribute/redistribute.c.html#PCSetUp_Redistribute">PCSetUp_Redistribute in src/ksp/pc/impls/redistribute/redistribute.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/redundant/redundant.c.html#PCSetUp_Redundant">PCSetUp_Redundant in src/ksp/pc/impls/redundant/redundant.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/rowscalingviennacl/rowscalingviennacl.cxx.html#PCSetUp_ROWSCALINGVIENNACL">PCSetUp_ROWSCALINGVIENNACL in src/ksp/pc/impls/rowscalingviennacl/rowscalingviennacl.cxx</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/saviennacl/saviennacl.cxx.html#PCSetUp_SAVIENNACL">PCSetUp_SAVIENNACL in src/ksp/pc/impls/saviennacl/saviennacl.cxx</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/shell/shellpc.c.html#PCSetUp_Shell">PCSetUp_Shell in src/ksp/pc/impls/shell/shellpc.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/spai/ispai.c.html#PCSetUp_SPAI">PCSetUp_SPAI in src/ksp/pc/impls/spai/ispai.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/svd/svd.c.html#PCSetUp_SVD">PCSetUp_SVD in src/ksp/pc/impls/svd/svd.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/telescope/telescope.c.html#PCSetUp_Telescope">PCSetUp_Telescope in src/ksp/pc/impls/telescope/telescope.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/tfs/tfs.c.html#PCSetUp_TFS">PCSetUp_TFS in src/ksp/pc/impls/tfs/tfs.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/vpbjacobi/vpbjacobi.c.html#PCSetUp_VPBJacobi">PCSetUp_VPBJacobi in src/ksp/pc/impls/vpbjacobi/vpbjacobi.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/wb/wb.c.html#PCSetUp_Exotic">PCSetUp_Exotic in src/ksp/pc/impls/wb/wb.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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
