# SNESFASSetLevels
Sets the number of levels to use with `SNESFAS`. Must be called before any other FAS routine. 
## Synopsis
```
#include "petscsnes.h"  
PetscErrorCode SNESFASSetLevels(SNES snes, PetscInt levels, MPI_Comm *comms)
```

## Input Parameters

- ***snes   -*** the snes context
- ***levels -*** the number of levels
- ***comms  -*** optional communicators for each level; this is to allow solving the coarser
problems on smaller sets of processors.





## Note
If the number of levels is one then the multigrid uses the -fas_levels prefix
for setting the level options rather than the -fas_coarse prefix.


## See Also
 `SNESFAS`, `SNESFASGetLevels()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/fas/fasfunc.c.html#SNESFASSetLevels">src/snes/impls/fas/fasfunc.c</A>


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


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