:orphan:
# DMPlexFilter
Extract a subset of mesh cells defined by a label as a separate mesh 
## Synopsis
```
#include "petscdmplex.h"    
#include "petscdmlabel.h"   
PetscErrorCode DMPlexFilter(DM dm, DMLabel cellLabel, PetscInt value, DM *subdm)
```

## Input Parameters

- ***dm        -*** The original mesh
- ***cellLabel -*** The `DMLabel` marking cells contained in the new mesh
- ***value     -*** The label value to use



## Output Parameter

- ***subdm -*** The new mesh





## Note
This function produces a `DMLabel` mapping original points in the submesh to their depth. This can be obtained using `DMPlexGetSubpointMap()`.


## See Also
 [](ch_unstructured), `DM`, `DMPLEX`, `DMPlexGetSubpointMap()`, `DMGetLabel()`, `DMLabelSetValue()`, `DMPlexCreateSubmesh()`

## Level
developer

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


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


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