# SNESKSPSetUseEW
Sets `SNES` to the use Eisenstat-Walker method for computing relative tolerance for linear solvers within an inexact Newton method. 
## Synopsis
```
#include "petscsnes.h"  
PetscErrorCode SNESKSPSetUseEW(SNES snes, PetscBool flag)
```
Logically Collective


## Input Parameters

- ***snes -*** `SNES` context
- ***flag -*** `PETSC_TRUE` or `PETSC_FALSE`



## Options Database Keys

- ***-snes_ksp_ew -*** use Eisenstat-Walker method for determining linear system convergence
- ***-snes_ksp_ew_version ver -*** version of  Eisenstat-Walker method
- ***-snes_ksp_ew_rtol0 <rtol0> -*** Sets rtol0
- ***-snes_ksp_ew_rtolmax <rtolmax> -*** Sets rtolmax
- ***-snes_ksp_ew_gamma <gamma> -*** Sets gamma
- ***-snes_ksp_ew_alpha <alpha> -*** Sets alpha
- ***-snes_ksp_ew_alpha2 <alpha2> -*** Sets alpha2
- ***-snes_ksp_ew_threshold <threshold> -*** Sets threshold



## Note
The default is to use a constant relative tolerance for
the inner linear solvers.  Alternatively, one can use the
Eisenstat-Walker method, where the relative convergence tolerance
is reset at each Newton iteration according progress of the nonlinear
solver.




## Reference

- ***- * S. C. Eisenstat and H. F. Walker, "Choosing the forcing terms in an inexact Newton method", SISC 17 (1), pp.16-*** 32, 1996.



## See Also
 `KSP`, `SNES`, `SNESKSPGetUseEW()`, `SNESKSPGetParametersEW()`, `SNESKSPSetParametersEW()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/interface/snes.c.html#SNESKSPSetUseEW">src/snes/interface/snes.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/snes/interface/snes.c)


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