# Define the trace operator

**URL:** <https://community.freefem.org/t/define-the-trace-operator/191>\
**Category:** General Discussion\
**Created:** [December 4, 2019, 3:56pm UTC](https://community.freefem.org/t/define-the-trace-operator/191 "2019-12-04T15:56:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hgauss](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/hgauss/32/75_2.png) [@hgauss](https://community.freefem.org/u/hgauss)\
**Post date:** [December 4, 2019, 3:56pm UTC](https://community.freefem.org/t/define-the-trace-operator/191/1 "2019-12-04T15:56:02Z")

</div>

Hi !

Is there a way or a predefined function to define the trace operator ? For a given fem function u, I would like to define its restriction to the boundary.

Thank you.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [December 4, 2019, 8:57pm UTC](https://community.freefem.org/t/define-the-trace-operator/191/2 "2019-12-04T20:57:41Z")

</div>

If your function is `u`, on a fespace `Vh`, then you can do:

```auto
Vh tr;
varf vTrace(unused, v) = on(boundary, unused = u);
tr[] = vTrace(0, Vh, tgv = -1);

```
