# DMPlexCreateBallMesh
Creates a simplex mesh on the d-dimensional ball, B^d. 
## Synopsis
```
#include "petscdmplex.h"   
#include "petscdmplex.h"   
PetscErrorCode DMPlexCreateBallMesh(MPI_Comm comm, PetscInt dim, PetscReal R, DM *dm)
```
Collective


## Input Parameters

- ***comm  -*** The communicator for the `DM` object
- ***dim   -*** The dimension
- ***R     -*** The radius



## Output Parameter

- ***dm  -*** The `DM` object



## Options Database Key

- ***bd_dm_refine -*** This will refine the surface mesh preserving the sphere geometry





## See Also
 [](chapter_unstructured), `DM`, `DMPLEX`, `DMPlexCreateSphereMesh()`, `DMPlexCreateBoxMesh()`, `DMSetType()`, `DMCreate()`

## Level
beginner

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/plex/plexcreate.c.html#DMPlexCreateBallMesh_Internal">DMPlexCreateBallMesh_Internal in src/dm/impls/plex/plexcreate.c</A><BR>


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