# DMPlexDistribute
Distributes the mesh and any associated sections. 
## Synopsis
```
#include "petscdmplex.h"   
#include "petscdmlabel.h"  
PetscErrorCode DMPlexDistribute(DM dm, PetscInt overlap, PetscSF *sf, DM *dmParallel)
```
Collective on dm


## Input Parameters

- ***dm  -*** The original DMPlex object
- ***overlap -*** The overlap of partitions, 0 is the default



## Output Parameters

- ***sf -*** The PetscSF used for point distribution, or NULL if not needed
- ***dmParallel -*** The distributed DMPlex object


Note: If the mesh was not distributed, the output dmParallel will be NULL.

The user can control the definition of adjacency for the mesh using DMSetAdjacency(). They should choose the combination appropriate for the function
representation on the mesh.




## See Also
 `DMPlexCreate()`, `DMSetAdjacency()`, `DMPlexGetOverlap()`

## Level
intermediate

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/tutorials/ex20.c.html">src/dm/tutorials/ex20.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/tutorials/ex21.c.html">src/dm/tutorials/ex21.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/label/tutorials/ex1.c.html">src/dm/label/tutorials/ex1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/label/tutorials/ex1f90.F90.html">src/dm/label/tutorials/ex1f90.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex56.c.html">src/snes/tutorials/ex56.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex11_sa.c.html">src/ts/tutorials/ex11_sa.c.html</A><BR>


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