# PCGalerkinGetKSP
Gets the `KSP` object in the `PCGALERKIN` 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode PCGalerkinGetKSP(PC pc, KSP *ksp)
```
Not Collective


## Input Parameter

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



## Output Parameter

- ***ksp -*** the `KSP` object





## Note
Once you have called this routine you can call `KSPSetOperators()` on the resulting ksp to provide the operator for the Galerkin problem,
an alternative is to use `PCGalerkinSetComputeSubmatrix()` to provide a routine that computes the submatrix as needed.


## See Also
 `PCCreate()`, `PCSetType()`, `PCType`, `PCGALERKIN`,
`PCGalerkinSetRestriction()`, `PCGalerkinSetInterpolation()`, `PCGalerkinSetComputeSubmatrix()`

## Level
Intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/galerkin/galerkin.c.html#PCGalerkinGetKSP">src/ksp/pc/impls/galerkin/galerkin.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/galerkin/galerkin.c.html#PCGalerkinGetKSP_Galerkin">PCGalerkinGetKSP_Galerkin in src/ksp/pc/impls/galerkin/galerkin.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/pc/impls/galerkin/galerkin.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)  
