Skip to main content
`Ctrl`+`K`

# DMSwarmSetPointCoordinatesRandom

Sets initial coordinates for particles in each cell

## Synopsis

    #include "petscdmswarm.h"
    PetscErrorCode DMSwarmSetPointCoordinatesRandom(DM dm, PetscInt Npc)

Collective

## Input Parameters

- dm - the `DMSWARM`

- Npc - The number of particles per cell in the cell `DM`

## Notes

The user must use `DMSwarmSetCellDM()` to set the cell `DM` first. The particles are placed randomly inside each cell. If only one particle is in each cell, it is placed at the centroid.

## See Also

`DM`, `DMSWARM`, `DMSwarmSetCellDM()`

## Level

intermediate

## Location

src/dm/impls/swarm/swarm.c

## Examples

src/ts/tutorials/ex77.c

Index of all DMSwarm routines
Table of Contents for all manual pages
Index of all manual pages