:orphan:
# DMSwarmCreateMassMatrixSquare
Creates the block-diagonal of the square, M^T_p M_p, of the particle mass matrix M_p 
## Synopsis
```
#include "petscdmswarm.h"   
PetscErrorCode DMSwarmCreateMassMatrixSquare(DM dmCoarse, DM dmFine, Mat *mass)
```
Collective


## Input parameters

- ***dmCoarse -*** a `DMSWARM`
- ***dmFine   -*** a `DMPLEX`



## Output parameter

- ***mass     -*** the square of the particle mass matrix





## Note
We only compute the block diagonal since this provides a good preconditioner and is completely local. It would be possible in the
future to compute the full normal equations.


## See Also
 `DM`, `DMSWARM`, `DMCreateMassMatrix()`

## Level
advanced

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/swarm/tutorials/ex1.c.html">src/dm/impls/swarm/tutorials/ex1.c</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](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
