# DMPlexBuildFromCellList
Build `DMPLEX` topology from a list of vertices for each cell (common mesh generator output) 
## Synopsis
```
#include "petscdmplex.h"   
#include "petscdmplex.h"   
PetscErrorCode DMPlexBuildFromCellList(DM dm, PetscInt numCells, PetscInt numVertices, PetscInt numCorners, const PetscInt cells[])
```
Collective on dm


## Input Parameters

- ***dm -*** The `DM`
- ***numCells -*** The number of cells owned by this process
- ***numVertices -*** The number of vertices owned by this process, or `PETSC_DETERMINE`
- ***numCorners -*** The number of vertices for each cell
- ***cells -*** An array of numCells*numCorners numbers, the global vertex numbers for each cell





## Notes
Two triangles sharing a face
```none

        2
      / | \
     /  |  \
    /   |   \
   0  0 | 1  3
    \   |   /
     \  |  /
      \ | /
        1
```

would have input
```none
  numCells = 2, numVertices = 4
  cells = [0 1 2  1 3 2]
```

which would result in the `DMPLEX`
```none

        4
      / | \
     /  |  \
    /   |   \
   2  0 | 1  5
    \   |   /
     \  |  /
      \ | /
        3
```


If numVertices is `PETSC_DETERMINE`, it is computed by PETSc as the maximum vertex index in cells + 1.

Not currently supported in Fortran.


## See Also
 [](chapter_unstructured), `DM`, `DMPLEX`, `DMPlexBuildFromCellListParallel()`, `DMPlexBuildCoordinatesFromCellList()`, `DMPlexCreateFromCellListPetsc()`

## Level
advanced

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


---
[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)  
