# DMSwarmRestoreCellSwarm
Restores a DMSwarm object obtained with DMSwarmGetCellSwarm(). All fields are copied back into the parent swarm. 
## Synopsis
```
#include "petscdmswarm.h"   
PETSC_EXTERN PetscErrorCode DMSwarmRestoreCellSwarm(DM sw, PetscInt cellID, DM cellswarm)
```
Noncollective


## Input parameters

- ***sw -*** the parent DMSwarm
- ***cellID -*** the integer id of the cell to be copied back into the parent swarm
- ***cellswarm -*** the cell swarm object





## Note
This only supports DMSWARM_PIC types of DMSwarms


## See Also
 `DMSwarmGetCellSwarm()`

## Level
beginner

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


---
[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)  
