DMSwarmType — PETSc 3.22.5 documentation

Skip to main content
`Ctrl`+`K`

# DMSwarmType

Defines the type of `DMSWARM`

## Synopsis

    typedef enum {
      DMSWARM_BASIC = 0,
      DMSWARM_PIC
    } DMSwarmType;

## Values

- `DMSWARM_BASIC` - defines N entries of varied data-types which the user may register.

- `DMSWARM_PIC` - suitable for particle-in-cell methods. Configured as `DMSWARM_PIC`, the swarm will be aware of, another `DM` which serves as the background mesh.

Fields specific to particle-in-cell methods are registered by default. These include spatial coordinates, a unique identifier, a cell index and an index for the owning rank. The background mesh will (by default) define the spatial decomposition of the points defined in the swarm. `DMSWARM_PIC` provides support for particle-in-cell operations such as defining initial point coordinates, communicating particles between sub-domains, projecting particle data fields on to the mesh.

## See Also

DM Basics, `DMSWARM`, `DMSwarmSetType()`

## Level

beginner

## Location

include/petscdmswarm.h

## Examples

src/ts/tutorials/ex77.c
src/dm/tutorials/ex21.c
src/snes/tutorials/ex63.c
src/dm/impls/swarm/tutorials/ex1.c
src/ksp/ksp/tutorials/ex70.c
src/dm/impls/swarm/tutorials/ex1f90.F90
src/dm/tutorials/ex20.c
src/dm/tutorials/swarm_ex3.c

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