# SNESSetGridSequence
sets the number of steps of grid sequencing that `SNES` will do 
## Synopsis
```
#include "petscsnes.h"  
PetscErrorCode SNESSetGridSequence(SNES snes, PetscInt steps)
```
Logically Collective


## Input Parameters

- ***snes -*** the `SNES` context
- ***steps -*** the number of refinements to do, defaults to 0



## Options Database Key

- ***-snes_grid_sequence <steps> -*** Use grid sequencing to generate initial guess





## Note
Use `SNESGetSolution()` to extract the fine grid solution after grid sequencing.


## See Also
 `SNES`, `SNESSetTrustRegionTolerance()`, `SNESGetLagPreconditioner()`, `SNESSetLagJacobian()`, `SNESGetLagJacobian()`, `SNESGetGridSequence()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/interface/snes.c.html#SNESSetGridSequence">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)  
