# Zero solution by solving the Laplace problem on part of the mes

**URL:** <https://community.freefem.org/t/zero-solution-by-solving-the-laplace-problem-on-part-of-the-mes/3018>\
**Category:** General Discussion\
**Created:** [March 7, 2024, 12:30am UTC](https://community.freefem.org/t/zero-solution-by-solving-the-laplace-problem-on-part-of-the-mes/3018 "2024-03-07T00:30:33Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [March 8, 2024, 1:28pm UTC](https://community.freefem.org/t/zero-solution-by-solving-the-laplace-problem-on-part-of-the-mes/3018/21 "2024-03-08T13:28:31Z")

</div>

Mike,  
I have run your code, I observe on the plot that the vanishing normal derivative condition on the boundary of the road is not satisfied. Indeed one should put `gam0` instead of `Splus` and `Sminus` in the penalty term. Nevertheless doing that I still do not get the right solution. I do not understand well what is happening, but I think that at least there is a difficulty in the fact that the term `dn(vv)` that appears in the 1d integral is discontinuous through `gam0` for `vv` in `P2`. I do not know what FreeFem does in this case. Is it taking the average between left/right values? Is it taking one or the other value randomly? or depending on the orientation of `N` (that would be the most appropriate for us)?  
Next and more importantly the penalty term does not induce any obvious positivity on the underlying matrix. This may induce an unstable behaviour.  
Francois.

---

<div class="post-metadata">

**Author:** ![Anis](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@Anis](https://community.freefem.org/u/Anis)\
**Post date:** [March 8, 2024, 1:33pm UTC](https://community.freefem.org/t/zero-solution-by-solving-the-laplace-problem-on-part-of-the-mes/3018/22 "2024-03-08T13:33:19Z")

</div>

In the code \<\<Transport-mod.edp\>\> that you have proposed, the solution is computed over the entire domain (road + air). However my goal is to have a solution on the road region only.

---

<div class="post-metadata">

**Author:** ![Anis](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@Anis](https://community.freefem.org/u/Anis)\
**Post date:** [March 8, 2024, 1:54pm UTC](https://community.freefem.org/t/zero-solution-by-solving-the-laplace-problem-on-part-of-the-mes/3018/23 "2024-03-08T13:54:57Z")

</div>

Indeed François, I tested the code sent by Mike. It gives almost the same result as the one I sent earlier \<\<laplace(1).edp\>\> with gam0=0 and a homogeneous Neumann condition on gamout. It seems strange to me.  
Could you tell me what to do to have the right code with these two conditions. It is clear that the problem comes from the condition “gam0=0”?  
Here is the code with the new conditions :  
[laplace (1).edp](https://community.freefem.org/uploads/short-url/bm8i6CliCAJStv28Rig126OlC8P.edp) (3.9 KB)

---

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [March 8, 2024, 2:31pm UTC](https://community.freefem.org/t/zero-solution-by-solving-the-laplace-problem-on-part-of-the-mes/3018/24 "2024-03-08T14:31:24Z")

</div>

If you consider the solution `vv_in` of the Laplace problem in the road domain with Homogeneous Dirichlet on gam0 (and whatever you like on `gamin` and `gamout`, let us consider for example the same conditions as before), then the associated problem on the full domain is the same full domain code laplace.edp as before, but taking a large value  
`real U00 = 1e8 ;`  
Indeed this inverts the role of the two subdomains. Then in the air domain you get the solution having Neumann BC on the outside domain and Neumann at the interface. This solution si thus zero in the air domain. Finally you get the solution in the road domain with non homogeneous Dirichlet condition at the interface, but since the air solution is zero, you get indeed homogeneous Dirichlet, which recovers your `vv_in` in the road domain.

The code of Mike (first version with `Splus` and `Sminus` thus no condition on gam0) solves the laplace problem on the entire domain without specifying anything on gam0. Since the nontrivial boundary condition is only on gamin, it is close to zero far from gamin, and it looks like the above solution (but it is different indeed).

About these coupled transmission problems you should read the FreeFem documentation  
[https://doc.freefem.org/pdf/FreeFEM-documentation.pdf](https://doc.freefem.org/pdf/FreeFEM-documentation.pdf)  
p. 625

[Previous page](https://community.freefem.org/t/zero-solution-by-solving-the-laplace-problem-on-part-of-the-mes/3018.md?page=1)
