# DMPlexGenerate
Generates a mesh. 
## Synopsis
```
#include "petscdmplex.h"   
PetscErrorCode DMPlexGenerate(DM boundary, const char name[], PetscBool interpolate, DM *mesh)
```
Not Collective


## Input Parameters

- ***boundary -*** The `DMPLEX` boundary object
- ***name -*** The mesh generation package name
- ***interpolate -*** Flag to create intermediate mesh elements



## Output Parameter

- ***mesh -*** The `DMPLEX` object



## Options Database Keys

- ***-dm_plex_generate <name> -*** package to generate mesh, for example, triangle, ctetgen or tetgen
- ***-dm_generator <name> -*** package to generate mesh, for example, triangle, ctetgen or tetgen





## See Also
 [](chapter_unstructured), `DM`, `DMPLEX`, `DMPlexCreate()`, `DMRefine()`

## Level
intermediate

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/plex/generators/ctetgen/ctetgenerate.c.html#DMPlexGenerate_CTetgen">DMPlexGenerate_CTetgen in src/dm/impls/plex/generators/ctetgen/ctetgenerate.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/plex/generators/tetgen/tetgenerate.cxx.html#DMPlexGenerate_Tetgen">DMPlexGenerate_Tetgen in src/dm/impls/plex/generators/tetgen/tetgenerate.cxx</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/plex/generators/triangle/trigenerate.c.html#DMPlexGenerate_Triangle">DMPlexGenerate_Triangle in src/dm/impls/plex/generators/triangle/trigenerate.c</A><BR>


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