:orphan:
# KSPGMRESGetOrthogonalization
Gets the orthogonalization routine used by `KSPGMRES` and `KSPFGMRES`. 
## Synopsis
```
#include "petscksp.h"  
PetscErrorCode KSPGMRESGetOrthogonalization(KSP ksp, PetscErrorCode (**fcn)(KSP, PetscInt))
```
Not Collective


## Input Parameter

- ***ksp -*** iterative context obtained from `KSPCreate()`



## Output Parameter

- ***fcn -*** orthogonalization function



## Calling Sequence of `fcn`
```none
   PetscErrorCode fcn(KSP ksp, PetscInt it);
```


- ***KSP -*** the solver context
- ***it -*** the current iteration



## Options Database Keys

- ***-ksp_gmres_classicalgramschmidt -*** Activates KSPGMRESClassicalGramSchmidtOrthogonalization() (default)
- ***-ksp_gmres_modifiedgramschmidt -*** Activates KSPGMRESModifiedGramSchmidtOrthogonalization()





## Notes
Two orthogonalization routines are predefined, including `KSPGMRESModifiedGramSchmidtOrthogonalization()`, and the default
`KSPGMRESClassicalGramSchmidtOrthogonalization()`

Use `KSPGMRESSetCGSRefinementType()` to determine if iterative refinement is used to increase stability.


## See Also
 [](ch_ksp), `KSPGMRESSetRestart()`, `KSPGMRESSetPreAllocateVectors()`, `KSPGMRESSetCGSRefinementType()`, `KSPGMRESSetOrthogonalization()`,
`KSPGMRESModifiedGramSchmidtOrthogonalization()`, `KSPGMRESClassicalGramSchmidtOrthogonalization()`, `KSPGMRESGetCGSRefinementType()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/gmres/gmres2.c.html#KSPGMRESGetOrthogonalization">src/ksp/ksp/impls/gmres/gmres2.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/gmres/gmres.c.html#KSPGMRESGetOrthogonalization_GMRES">KSPGMRESGetOrthogonalization_GMRES in src/ksp/ksp/impls/gmres/gmres.c</A><BR>


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