:orphan:
# DMSwarmSortGetPointsPerCell
Creates an array of point indices for all points in a cell 
## Synopsis
```
PETSC_EXTERN PetscErrorCode DMSwarmSortGetPointsPerCell(DM dm, PetscInt e, PetscInt *npoints, PetscInt **pidlist)
```
Not Collective


## Input parameters

- ***dm -*** a `DMSWARM` object
- ***e -*** the index of the cell
- ***npoints -*** the number of points in the cell
- ***pidlist -*** array of the indices identifying all points in cell e





## Notes
You must call `DMSwarmSortGetAccess()` before you can call `DMSwarmSortGetPointsPerCell()`

The array `pidlist` is internally created and must be free'd by the user


## See Also
 `DMSWARM`, `DMSwarmSetType()`, `DMSwarmSortGetAccess()`, `DMSwarmSortGetNumberOfPointsPerCell()`

## Level
advanced

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/tutorials/ex20.c.html">src/dm/tutorials/ex20.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex70.c.html">src/ksp/ksp/tutorials/ex70.c</A><BR>


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