# DMPlexComputeClementInterpolant
This function computes the L2 projection of the cellwise values of a function u onto P1, and stores it in a Vec. 
## Synopsis
```
#include "petscdmplex.h"   
PetscErrorCode DMPlexComputeClementInterpolant(DM dm, Vec locX, Vec locC)
```
Collective on dm


## Input Parameters

- ***dm -*** The `DM`
- ***locX  -*** The coefficient vector u_h



## Output Parameter

- ***locC -*** A `Vec` which holds the Clement interpolant of the function





## Note
$ u_h(v_i) = \sum_{T_i \in support(v_i)} |T_i| u_h(T_i) / \sum_{T_i \in support(v_i)} |T_i| $ where $ |T_i| $ is the cell volume


## See Also
 [](chapter_unstructured), `DM`, `DMPLEX`, `DMProjectFunction()`, `DMComputeL2Diff()`, `DMPlexComputeL2FieldDiff()`, `DMComputeL2GradientDiff()`

## Level
developer

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex36.c.html">src/snes/tutorials/ex36.c.html</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)  
