# PCMGRegisterCoarseSpaceConstructor
Adds a method to the `PCMG` package for coarse space construction. 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode PCMGRegisterCoarseSpaceConstructor(const char name[], PetscErrorCode (*function)(PC, PetscInt, DM, KSP, PetscInt, Mat, Mat *))
```
Not collective


## Input Parameters

- ***name     -*** name of the constructor
- ***function -*** constructor routine



## Calling sequence for the routine
```none
my_csp(PC pc, PetscInt l, DM dm, KSP smooth, PetscInt Nc, Mat initGuess, Mat *coarseSp)
```

- ***pc        -*** The PC object
- ***l         -*** The multigrid level, 0 is the coarse level
- ***dm        -*** The DM for this level
- ***smooth    -*** The level smoother
- ***Nc        -*** The size of the coarse space
- ***initGuess -*** Basis for an initial guess for the space
- ***coarseSp  -*** A basis for the computed coarse space





## Developer Note
How come this is not used by `PCGAMG`?


## See Also
 `PCMG`, `PCMGGetCoarseSpaceConstructor()`, `PCRegister()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/mg/mg.c.html#PCMGRegisterCoarseSpaceConstructor">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)  
