# Writting an integral of a transmission/interface problem

**URL:** <https://community.freefem.org/t/writting-an-integral-of-a-transmission-interface-problem/2058>\
**Category:** General Discussion\
**Created:** [October 12, 2022, 6:47pm UTC](https://community.freefem.org/t/writting-an-integral-of-a-transmission-interface-problem/2058 "2022-10-12T18:47:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RodZ](https://avatars.discourse-cdn.com/v4/letter/r/ad7895/32.png) [@RodZ](https://community.freefem.org/u/RodZ)\
**Post date:** [October 12, 2022, 6:47pm UTC](https://community.freefem.org/t/writting-an-integral-of-a-transmission-interface-problem/2058/1 "2022-10-12T18:47:21Z")

</div>

Hi everyone,

I have a advection-diffusion problem with an interface, let’s say \Omega = \Omega\_1 \cup \Omega\_2, \Gamma = \partial \Omega\_1 \cap \partial \Omega\_2, where [T] = 0, [k\frac{\partial T}{\partial n}] = 0 on \Gamma.  
I need to write the integral of something like this  
\int\_\Gamma \frac{\partial T\_1}{\partial n} -\frac{\partial T\_2}{\partial n} = \int\_\Gamma (\frac{1}{k\_1} - \frac{1}{k\_2}) k\_1 \frac{\partial T\_1}{\partial n} = \int\_\Gamma (\frac{1}{k\_1} - \frac{1}{k\_2}) k\_2 \frac{\partial T\_2}{\partial n}

How can i write the expression \frac{\partial T\_1}{\partial n}, \frac{\partial T\_2}{\partial n} or in general f(T\_1, T\_2) on \Gamma for a continuos problem?  
I have done T\_1 = T\*(region==1) and T\_2 = T\*(region==2) , and after that compute the normal derivative, but i’m not getting what i want to get, and i think if i do that T\_1 is different to T\_2 in \Gamma.

Any idea?

Best regards,  
Rodrigo

---

<div class="post-metadata">

**Author:** ![lassounon](https://avatars.discourse-cdn.com/v4/letter/l/bbe5ce/32.png) [@lassounon](https://community.freefem.org/u/lassounon)\
**Post date:** [November 14, 2022, 4:56pm UTC](https://community.freefem.org/t/writting-an-integral-of-a-transmission-interface-problem/2058/2 "2022-11-14T16:56:59Z")

</div>

First you must clearly define the Gamma edge and number it for example by gam. Then you do:  
real K1=1./k1;  
real K2=1./k2;  
real K=K1-K2;  
int1d(Th2,gam)(K\*(N.x\*(dx(T2))+N.y\*(dy(T2)));
