# KSPFCG
Implements the Flexible Conjugate Gradient method (FCG). Unlike most `KSP` methods this allows the preconditioner to be nonlinear. [](sec_flexibleksp) 
## Options Database Keys

- ***-ksp_fcg_mmax <N>  -*** maximum number of search directions
- ***-ksp_fcg_nprealloc <N> -*** number of directions to preallocate
- ***-ksp_fcg_truncation_type <standard,notay> -*** truncation approach for directions





## Note
Supports left preconditioning only.


## Contributed by
Patrick Sanan


## References

- **** -*** Notay, Y."Flexible Conjugate Gradients", SIAM J. Sci. Comput. 22:4, 2000
- **** -*** Axelsson, O. and Vassilevski, P. S. "A Black Box Generalized Conjugate Gradient Solver with Inner Iterations and Variable step Preconditioning",
SIAM J. Matrix Anal. Appl. 12:4, 1991



## See Also
 [](chapter_ksp), [](sec_flexibleksp), `KSPGCR`, `KSPFGMRES`, `KSPCG`, `KSPFCGSetMmax()`, `KSPFCGGetMmax()`, `KSPFCGSetNprealloc()`, `KSPFCGGetNprealloc()`, `KSPFCGSetTruncationType()`, `KSPFCGGetTruncationType()`,
`KSPFCGGetTruncationType`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/fcg/fcg.c.html#KSPFCG">src/ksp/ksp/impls/fcg/fcg.c</A>

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


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/ksp/impls/fcg/fcg.c)


[Index of all KSP routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
