# PCGAMGSetCoarseEqLim
Set maximum number of equations on the coarsest grid of `PCGAMG` 
## Synopsis
```
#include "petscpc.h" 
#include "petscksp.h" 
PetscErrorCode PCGAMGSetCoarseEqLim(PC pc, PetscInt n)
```
Collective


## Input Parameters

- ***pc -*** the preconditioner context
- ***n -*** maximum number of equations to aim for



## Options Database Key

- ***-pc_gamg_coarse_eq_limit <limit> -*** set the limit



## Note
For example -pc_gamg_coarse_eq_limit 1000 will stop coarsening once the coarse grid
has less than 1000 unknowns.




## See Also
 `PCGAMG`, `PCGAMGSetProcEqLim()`, `PCGAMGSetRankReductionFactors()`, `PCGAMGSetRepartition()`

## Level
intermediate

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/gamg/gamg.c.html#PCGAMGSetCoarseEqLim_GAMG">PCGAMGSetCoarseEqLim_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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
