# DMSwarmSetPointCoordinates
Set point coordinates in a DMSwarm from a user defined list 
## Synopsis
```
#include "petscdmswarm.h"   
PETSC_EXTERN PetscErrorCode DMSwarmSetPointCoordinates(DM dm, PetscInt npoints, PetscReal coor[], PetscBool redundant, InsertMode mode)
```
Collective on dm


## Input parameters

- ***dm -*** the DMSwarm
- ***npoints -*** the number of points to insert
- ***coor -*** the coordinate values
- ***redundant -*** if set to PETSC_TRUE, it is assumed that npoints and coor[] are only valid on rank 0 and should be broadcast to other ranks
- ***mode -*** indicates whether to append points to the swarm (ADD_VALUES), or over-ride existing points (INSERT_VALUES)





## Notes
If the user has specified redundant = PETSC_FALSE, the cell DM will attempt to locate the coordinates provided by coor[] within
its sub-domain. If they any values within coor[] are not located in the sub-domain, they will be ignored and will not get
added to the DMSwarm.


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

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/swarm/swarmpic.c.html#DMSwarmSetPointCoordinates">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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
