:orphan:
# DMPlexMetricAverage
Compute the average of a list of metrics 
## Synopsis
```
#include "petscdmplex.h"   
PetscErrorCode DMPlexMetricAverage(DM dm, PetscInt numMetrics, PetscReal weights[], Vec metrics[], Vec metricAvg)
```

## Input Parameters

- ***dm         -*** The `DM`
- ***numMetrics -*** The number of metrics to be averaged
- ***weights    -*** Weights for the average
- ***metrics    -*** The metrics to be averaged



## Output Parameter

- ***metricAvg  -*** The averaged metric





## Notes
The weights should sum to unity.

If weights are not provided then an unweighted average is used.


## See Also
 `DMPLEX`, `DMPlexMetricAverage2()`, `DMPlexMetricAverage3()`, `DMPlexMetricIntersection()`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/plex/plexmetric.c.html#DMPlexMetricAverage">src/dm/impls/plex/plexmetric.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/impls/plex/plexmetric.c)


[Index of all DMPlex routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
