# DMSwarmInitializeCoordinates
Determine the initial coordinates of particles for a PIC method 
## Synopsis
```
#include "petscdmswarm.h"   
PetscErrorCode DMSwarmInitializeCoordinates(DM sw)
```
Not collective


## Input Parameters
, sw - The DMSwarm

Note: Currently, we randomly place particles in their assigned cell




## See Also
 `DMSwarmComputeLocalSize()`, `DMSwarmInitializeVelocities()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/swarm/swarmpic.c.html#DMSwarmInitializeCoordinates">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)  
