:orphan:
# KSPGetType
Gets the `KSP` type as a string from the KSP object. 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode KSPGetType(KSP ksp, KSPType *type)
```
Not Collective


## Input Parameter

- ***ksp -*** Krylov context



## Output Parameter

- ***name -*** name of the `KSP` method





## See Also
 [](ch_ksp), `KSPType`, `KSP`, `KSPSetType()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/interface/itcreate.c.html#KSPGetType">src/ksp/ksp/interface/itcreate.c</A>

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


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