# DMPlexComputeBdIntegral
Form the integral over the specified boundary from the global input X using pointwise functions specified by the user 
## Synopsis
```
#include "petscdmplex.h"   
PetscErrorCode DMPlexComputeBdIntegral(DM dm, Vec X, DMLabel label, PetscInt numVals, const PetscInt vals[], void (*func)(PetscInt, PetscInt, PetscInt, const PetscInt[], const PetscInt[], const PetscScalar[], const PetscScalar[], const PetscScalar[], const PetscInt[], const PetscInt[], const PetscScalar[], const PetscScalar[], const PetscScalar[], PetscReal, const PetscReal[], const PetscReal[], PetscInt, const PetscScalar[], PetscScalar[]), PetscScalar *integral, void *user)
```

## Input Parameters

- ***dm      -*** The mesh
- ***X       -*** Global input vector
- ***label   -*** The boundary `DMLabel`
- ***numVals -*** The number of label values to use, or `PETSC_DETERMINE` for all values
- ***vals    -*** The label values to use, or NULL for all values
- ***func    -*** The function to integrate along the boundary
- ***user    -*** The user context



## Output Parameter

- ***integral -*** Integral for each field





## See Also
 [](chapter_unstructured), `DM`, `DMPLEX`, `DMPlexComputeIntegralFEM()`, `DMPlexComputeBdResidualFEM()`

## Level
developer

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex12.c.html">src/snes/tutorials/ex12.c.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/plex/plexfem.c.html#DMPlexComputeBdIntegral_Internal(DM dm, Vec locX, IS pointIS, void (*func)">DMPlexComputeBdIntegral_Internal(DM dm, Vec locX, IS pointIS, void (*func) in src/dm/impls/plex/plexfem.c</A><BR>


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


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