# PCMGGetGridComplexity
compute operator and grid complexity of the `PCMG` hierarchy 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode PCMGGetGridComplexity(PC pc, PetscReal *gc, PetscReal *oc)
```

## Input Parameter

- ***pc -*** the preconditioner context



## Output Parameters

- ***gc -*** grid complexity = sum_i(n_i) / n_0
- ***oc -*** operator complexity = sum_i(nnz_i) / nnz_0





## Note
This is often call the operator complexity in multigrid literature


## See Also
 `PCMG`, `PCMGGetLevels()`, `PCMGSetLevels()`

## Level
advanced

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


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