# PCCreate
Creates a preconditioner context, `PC` 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode PCCreate(MPI_Comm comm, PC *newpc)
```
Collective


## Input Parameter

- ***comm -*** MPI communicator



## Output Parameter

- ***pc -*** location to put the preconditioner context



## Note
The default preconditioner for sparse matrices is `PCILU` or `PCICC` with 0 fill on one process and block Jacobi (`PCBJACOBI`) with `PCILU` or `PCICC`
in parallel. For dense matrices it is always `PCNONE`.




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

## Level
developer

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/amgx/amgx.cxx.html#PCCreate_AMGX">PCCreate_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#PCCreate_ASM">PCCreate_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#PCCreate_BDDC">PCCreate_BDDC 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#PCCreate_BJacobi">PCCreate_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#PCCreate_BJKOKKOS">PCCreate_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#PCCreate_CHOWILUVIENNACL">PCCreate_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#PCCreate_Composite">PCCreate_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#PCCreate_CP">PCCreate_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#PCCreate_Deflation">PCCreate_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#PCCreate_Eisenstat">PCCreate_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#PCCreate_Cholesky">PCCreate_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#PCCreate_ICC">PCCreate_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#PCCreate_ILU">PCCreate_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#PCCreate_LU">PCCreate_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#PCCreate_QR">PCCreate_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#PCCreate_FieldSplit">PCCreate_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#PCCreate_Galerkin">PCCreate_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#PCCreate_GAMG">PCCreate_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#PCCreate_GASM">PCCreate_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#PCCreate_H2OPUS">PCCreate_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#PCCreate_HMG">PCCreate_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#PCCreate_HPDDM">PCCreate_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#PCCreate_HYPRE">PCCreate_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#PCCreate_PFMG">PCCreate_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#PCCreate_SysPFMG">PCCreate_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#PCCreate_SMG">PCCreate_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#PCCreate_NN">PCCreate_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#PCCreate_Jacobi">PCCreate_Jacobi in src/ksp/pc/impls/jacobi/jacobi.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/kaczmarz/kaczmarz.c.html#PCCreate_Kaczmarz">PCCreate_Kaczmarz in src/ksp/pc/impls/kaczmarz/kaczmarz.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/ksp/pcksp.c.html#PCCreate_KSP">PCCreate_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#PCCreate_LMVM">PCCreate_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#PCCreate_LSC">PCCreate_LSC in src/ksp/pc/impls/lsc/lsc.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/mat/pcmat.c.html#PCCreate_Mat">PCCreate_Mat in src/ksp/pc/impls/mat/pcmat.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/mg/mg.c.html#PCCreate_MG">PCCreate_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#PCCreate_ML">PCCreate_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#PCCreate_MPI">PCCreate_MPI in src/ksp/pc/impls/mpi/pcmpi.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/none/none.c.html#PCCreate_None">PCCreate_None in src/ksp/pc/impls/none/none.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/parms/parms.c.html#PCCreate_PARMS">PCCreate_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#PCCreate_Patch">PCCreate_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#PCCreate_PBJacobi">PCCreate_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#PCCreate_Redistribute">PCCreate_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#PCCreate_Redundant">PCCreate_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#PCCreate_ROWSCALINGVIENNACL">PCCreate_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#PCCreate_SAVIENNACL">PCCreate_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#PCCreate_Shell">PCCreate_Shell in src/ksp/pc/impls/shell/shellpc.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/sor/sor.c.html#PCCreate_SOR">PCCreate_SOR in src/ksp/pc/impls/sor/sor.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/spai/ispai.c.html#PCCreate_SPAI">PCCreate_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#PCCreate_SVD">PCCreate_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#PCCreate_Telescope">PCCreate_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#PCCreate_TFS">PCCreate_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#PCCreate_VPBJacobi">PCCreate_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#PCCreate_Exotic">PCCreate_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)  
