# DMPlexSetCellType
Set the polytope type of a given cell 
## Synopsis
```
#include "petscdmplex.h"   
PetscErrorCode DMPlexSetCellType(DM dm, PetscInt cell, DMPolytopeType celltype)
```
Not Collective


## Input Parameters

- ***dm   -*** The `DMPLEX` object
- ***cell -*** The cell
- ***celltype -*** The polytope type of the cell





## Note
By default, cell types will be automatically computed using `DMPlexComputeCellTypes()` before this function
is executed. This function will override the computed type. However, if automatic classification will not succeed
and a user wants to manually specify all types, the classification must be disabled by calling
DMCreaateLabel(dm, "celltype") before getting or setting any cell types.


## See Also
 [](chapter_unstructured), `DM`, `DMPLEX`, `DMPlexGetCellTypeLabel()`, `DMPlexGetDepthLabel()`, `DMPlexGetDepth()`, `DMPlexComputeCellTypes()`, `DMCreateLabel()`

## Level
advanced

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


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