# SNESNGSSetSweeps
Sets the number of sweeps of nonlinear GS to use in `SNESNCG` 
## Synopsis
```
#include "petscsnes.h"  
PetscErrorCode SNESNGSSetSweeps(SNES snes, PetscInt sweeps)
```

## Input Parameters

- ***snes   -*** the `SNES` context
- ***sweeps  -*** the number of sweeps of nonlinear GS to perform.



## Options Database Key

- ***-snes_ngs_sweeps <n> -*** Number of sweeps of nonlinear GS to apply





## See Also
 `SNESNCG`, `SNESSetNGS()`, `SNESGetNGS()`, `SNESSetNPC()`, `SNESNGSGetSweeps()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/gs/snesgs.c.html#SNESNGSSetSweeps">src/snes/impls/gs/snesgs.c</A>


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