# DMDAGetNumCells
Get the number of cells in the local piece of the `DMDA`. This includes ghost cells. 
## Synopsis
```
#include "petscdmda.h"   
PetscErrorCode DMDAGetNumCells(DM dm, PetscInt *numCellsX, PetscInt *numCellsY, PetscInt *numCellsZ, PetscInt *numCells)
```

## Input Parameter

- ***dm -*** The `DMDA` object



## Output Parameters

- ***numCellsX -*** The number of local cells in the x-direction
- ***numCellsY -*** The number of local cells in the y-direction
- ***numCellsZ -*** The number of local cells in the z-direction
- ***numCells -*** The number of local cells





## See Also
 `DM`, `DMDA`, `DMDAGetCellPoint()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/da/dalocal.c.html#DMDAGetNumCells">src/dm/impls/da/dalocal.c</A>


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


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