:orphan:
# PCGAMGSetNlevels
Sets the maximum number of levels `PCGAMG` will use 
## Synopsis
```
#include "petscpc.h" 
#include "petscksp.h" 
PetscErrorCode PCGAMGSetNlevels(PC pc, PetscInt n)
```
Not Collective


## Input Parameters

- ***pc -*** the preconditioner
- ***n -*** the maximum number of levels to use



## Options Database Key

- ***-pc_mg_levels <n> -*** set the maximum number of levels to allow





## Developer Note
Should be called `PCGAMGSetMaximumNumberlevels()` and possible be shared with `PCMG`


## See Also
 `PCGAMG`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/gamg/gamg.c.html#PCGAMGSetNlevels">src/ksp/pc/impls/gamg/gamg.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/gamg/gamg.c.html#PCGAMGSetNlevels_GAMG">PCGAMGSetNlevels_GAMG in src/ksp/pc/impls/gamg/gamg.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/pc/impls/gamg/gamg.c)


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