# DMSwarmInitializeFieldRegister
Initiates the registration of fields to a DMSwarm 
## Synopsis
```
#include "petscdmswarm.h"   
PetscErrorCode DMSwarmInitializeFieldRegister(DM dm)
```
Collective on dm


## Input parameter

- ***dm -*** a DMSwarm





## Notes
After all fields have been registered, you must call DMSwarmFinalizeFieldRegister().


## See Also
 `DMSwarmFinalizeFieldRegister()`, `DMSwarmRegisterPetscDatatypeField()`,
`DMSwarmRegisterUserStructField()`, `DMSwarmRegisterUserDatatypeField()`

## Level
beginner

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/tutorials/swarm_ex1.c.html">src/dm/tutorials/swarm_ex1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/tutorials/swarm_ex2.c.html">src/dm/tutorials/swarm_ex2.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/impls/swarm/swarm.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)  
