# DMPlexSetRefinementFunction
Set the function giving the maximum cell volume for refinement 
## Synopsis
```
#include "petscdmplex.h"   
PetscErrorCode DMPlexSetRefinementFunction(DM dm, PetscErrorCode (*refinementFunc)(const PetscReal[], PetscReal *))
```

## Input Parameters

- ***dm -*** The `DM`
- ***refinementFunc -*** Function giving the maximum cell volume in the refined mesh



## Calling Sequence of refinementFunc
```none
refinementFunc(coords, limit)
```

- ***coords -*** Coordinates of the current point, usually a cell centroid
- ***limit  -*** The maximum cell volume for a cell containing this point





## See Also
 [](chapter_unstructured), `DM`, `DMPLEX`, `DMRefine()`, `DMPlexGetRefinementFunction()`, `DMPlexGetRefinementUniform()`, `DMPlexSetRefinementUniform()`, `DMPlexGetRefinementLimit()`, `DMPlexSetRefinementLimit()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/plex/plexrefine.c.html#DMPlexSetRefinementFunction">src/dm/impls/plex/plexrefine.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/impls/plex/plexrefine.c)


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