# SNESNGMRESSetSelectType
Sets the selection type for `SNESNGMRES`.  This determines how the candidate solution and combined solution are used to create the next iterate. 
## Synopsis
```
#include "petscsnes.h" 
PetscErrorCode SNESNGMRESSetSelectType(SNES snes, SNESNGMRESSelectType stype)
```
Logically Collective


## Input Parameters

- ***snes -*** the iterative context
- ***stype -*** selection type



## Options Database Key

- ***-snes_ngmres_select_type<difference,none,linesearch> -*** select type





## `SNESNGMRESSelectType`s

- ***`SNES_NGMRES_SELECT_NONE` -*** choose the combined solution all the time
- ***`SNES_NGMRES_SELECT_DIFFERENCE` -*** choose based upon the selection criteria
- ***`SNES_NGMRES_SELECT_LINESEARCH` -*** choose based upon line search combination



## Note
The default line search used is the `SNESLINESEARCHL2` line search and it requires two additional function evaluations.


## See Also
 `SNESNGMRESSelectType()`, `SNES_NGMRES_SELECT_NONE`, `SNES_NGMRES_SELECT_DIFFERENCE`, `SNES_NGMRES_SELECT_LINESEARCH`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/ngmres/snesngmres.c.html#SNESNGMRESSetSelectType">src/snes/impls/ngmres/snesngmres.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/ngmres/snesngmres.c.html#SNESNGMRESSetSelectType_NGMRES">SNESNGMRESSetSelectType_NGMRES in src/snes/impls/ngmres/snesngmres.c</A><BR>


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