:orphan: # KSPGetPC Returns a pointer to the preconditioner context set with `KSPSetPC()`. ## Synopsis ``` #include "petscksp.h" #include "petscmat.h" PetscErrorCode KSPGetPC(KSP ksp, PC *pc) ``` Not Collective ## Input Parameter - ***ksp -*** iterative context obtained from `KSPCreate()` ## Output Parameter - ***pc -*** preconditioner context ## See Also [](ch_ksp), `KSPSetPC()`, `KSP` ## Level developer ## Location src/ksp/ksp/interface/itfunc.c ## Examples src/dm/impls/stag/tutorials/ex1.c
src/dm/impls/stag/tutorials/ex2.c
src/dm/impls/stag/tutorials/ex3.c
src/dm/impls/stag/tutorials/ex4.c
src/dm/impls/swarm/tutorials/ex1.c
src/ksp/ksp/tutorials/bench_kspsolve.c
src/ksp/ksp/tutorials/ex1.c
src/ksp/ksp/tutorials/ex100.c
src/ksp/ksp/tutorials/ex100f.F90
src/ksp/ksp/tutorials/ex12.c
src/ksp/ksp/tutorials/ex13.c
--- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/ksp/interface/itfunc.c) [Index of all KSP routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)