# Trace on an internal boundary of a dc finite element

**URL:** <https://community.freefem.org/t/trace-on-an-internal-boundary-of-a-dc-finite-element/2421>\
**Category:** General Discussion\
**Created:** [April 26, 2023, 1:28pm UTC](https://community.freefem.org/t/trace-on-an-internal-boundary-of-a-dc-finite-element/2421 "2023-04-26T13:28:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Morgane](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/morgane/32/3525_2.png) [@Morgane](https://community.freefem.org/u/Morgane)\
**Post date:** [April 26, 2023, 1:28pm UTC](https://community.freefem.org/t/trace-on-an-internal-boundary-of-a-dc-finite-element/2421/1 "2023-04-26T13:28:59Z")

</div>

Dear,

I would like to have access to the trace of a discontinuous finite element function on each side of an internal border of my mesh. Do you know a robust way to do this?

Best  
Morgane

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [April 28, 2023, 8:13am UTC](https://community.freefem.org/t/trace-on-an-internal-boundary-of-a-dc-finite-element/2421/2 "2023-04-28T08:13:15Z")

</div>

Here a small example

remark the normal of internal border is given by the orientation.  
here the normal is (0,1).

```auto
border aa(t=0,pi) { x=cos(t); y= sin(t); label=1;}
border bb(t=pi,2*pi) { x=cos(t); y= sin(t); label=1;}
border cc(t=-1,1) { x=t; y= 0; label=2;}

mesh Th=buildmesh(aa(31)+bb(31)+cc(20));
plot(Th,wait=1);
fespace Vh(Th,P2dc);

Vh u,v;

solve Pb(u,v)= int2d(Th)( v*u) - int2d(Th)(x*v+(region+1)*v);
plot(u,wait=1);
cout << " region top " << Th(0,0.1).region << endl; 
cout << " region down " << Th(0,-0.1).region << endl; 
cout << int1d(Th,2)( jump(u) ) << endl; // jump 
cout << int1d(Th,2)( (u) ) << endl; // top 
cout << int1d(Th,2)( region ) << endl; // top 
cout << int1d(Th,2)( otherside(u) ) << endl; // down 

```
