Skip to main content
`Ctrl`+`K`

# 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

src/dm/impls/plex/plexmetric.c

Index of all DMPlex routines
Table of Contents for all manual pages
Index of all manual pages