Skip to main content
`Ctrl`+`K`

# KSPGMRESSetCGSRefinementType

Sets the type of iterative refinement to use in the classical Gram-Schmidt orthogonalization used by `KSPGMRES` and other PETSc GMRES implementations.

## Synopsis

    #include "petscksp.h"
    PetscErrorCode KSPGMRESSetCGSRefinementType(KSP ksp, KSPGMRESCGSRefinementType type)

Logically Collective

## Input Parameters

- ksp - the Krylov space solver context

- type - the type of refinement

      KSP_GMRES_CGS_REFINE_NEVER
      KSP_GMRES_CGS_REFINE_IFNEEDED
      KSP_GMRES_CGS_REFINE_ALWAYS

## Options Database Key

- -ksp_gmres_cgs_refinement_type <refine_never,refine_ifneeded,refine_always> - refinement type

## Notes

The default is `KSP_GMRES_CGS_REFINE_NEVER`

For a very small set of problems not using refinement, that is `KSP_GMRES_CGS_REFINE_NEVER` may be unstable, thus causing `KSPSolve()` to not converge.

## See Also

KSP: Linear System Solvers, `KSPGMRES`, `KSPGMRESSetOrthogonalization()`, `KSPGMRESCGSRefinementType`, `KSPGMRESClassicalGramSchmidtOrthogonalization()`, `KSPGMRESGetCGSRefinementType()`, `KSPGMRESGetOrthogonalization()`

## Level

intermediate

## Location

src/ksp/ksp/impls/gmres/gmres.c

## Implementations

KSPGMRESSetCGSRefinementType_GMRES() in src/ksp/ksp/impls/gmres/gmres.c

Index of all KSP routines
Table of Contents for all manual pages
Index of all manual pages