:orphan:
# DMSwarmCreatePointPerCellCount
Count the number of points within all cells in the cell DM 
## Synopsis
```
#include "petscdmswarm.h"   
PETSC_EXTERN PetscErrorCode DMSwarmCreatePointPerCellCount(DM dm, PetscInt *ncells, PetscInt **count)
```
Not Collective


## Input parameter

- ***dm -*** the `DMSWARM`



## Output parameters

- ***ncells -*** the number of cells in the cell `DM` (optional argument, pass `NULL` to ignore)
- ***count -*** array of length ncells containing the number of points per cell





## Notes
The array count is allocated internally and must be free'd by the user.


## See Also
 `DMSWARM`, `DMSwarmSetType()`, `DMSwarmSetCellDM()`, `DMSwarmType`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/swarm/swarmpic.c.html#DMSwarmCreatePointPerCellCount">src/dm/impls/swarm/swarmpic.c</A>


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


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