# DMSwarmInsertPointsUsingCellDM
Insert point coordinates within each cell 
## Synopsis
```
#include "petscdmswarm.h"   
PETSC_EXTERN PetscErrorCode DMSwarmInsertPointsUsingCellDM(DM dm, DMSwarmPICLayoutType layout_type, PetscInt fill_param)
```
Not collective


## Input parameters

- ***dm -*** the DMSwarm
- ***layout_type -*** method used to fill each cell with the cell DM
- ***fill_param -*** parameter controlling how many points per cell are added (the meaning of this parameter is dependent on the layout type)





## Notes

The insert method will reset any previous defined points within the DMSwarm.

When using a DMDA both 2D and 3D are supported for all layout types provided you are using DMDA_ELEMENT_Q1.


## When using a DMPLEX the following case are supported
(i) DMSWARMPIC_LAYOUT_REGULAR: 2D (triangle),
(ii) DMSWARMPIC_LAYOUT_GAUSS: 2D and 3D provided the cell is a tri/tet or a quad/hex,
(iii) DMSWARMPIC_LAYOUT_SUBDIVISION: 2D and 3D for quad/hex and 2D tri.


## See Also
 `DMSwarmPICLayoutType`, `DMSwarmSetType()`, `DMSwarmSetCellDM()`, `DMSwarmType`

## Level
beginner

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/tutorials/ex20.c.html">src/dm/tutorials/ex20.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/tutorials/ex21.c.html">src/dm/tutorials/ex21.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex70.c.html">src/ksp/ksp/tutorials/ex70.c.html</A><BR>


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