# DMSwarmSetPointsUniformCoordinates
Set point coordinates in a DMSwarm on a regular (ijk) grid 
## Synopsis
```
#include "petscdmswarm.h"   
PETSC_EXTERN PetscErrorCode DMSwarmSetPointsUniformCoordinates(DM dm, PetscReal min[], PetscReal max[], PetscInt npoints[], InsertMode mode)
```
Collective on dm


## Input parameters

- ***dm -*** the DMSwarm
- ***min -*** minimum coordinate values in the x, y, z directions (array of length dim)
- ***max -*** maximum coordinate values in the x, y, z directions (array of length dim)
- ***npoints -*** number of points in each spatial direction (array of length dim)
- ***mode -*** indicates whether to append points to the swarm (ADD_VALUES), or over-ride existing points (INSERT_VALUES)





## Notes
When using mode = INSERT_VALUES, this method will reset the number of particles in the DMSwarm
to be npoints[0]*npoints[1] (2D) or npoints[0]*npoints[1]*npoints[2] (3D). When using mode = ADD_VALUES,
new points will be appended to any already existing in the DMSwarm


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

## Level
beginner

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

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


---
[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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
