# Problem with 1D integral while using movemesh for Poisson Problem with Neumann Boundary Condition

**URL:** <https://community.freefem.org/t/problem-with-1d-integral-while-using-movemesh-for-poisson-problem-with-neumann-boundary-condition/3673>\
**Category:** General Discussion\
**Created:** [January 4, 2025, 2:46pm UTC](https://community.freefem.org/t/problem-with-1d-integral-while-using-movemesh-for-poisson-problem-with-neumann-boundary-condition/3673 "2025-01-04T14:46:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![RaghunathBandha](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/raghunathbandha/32/1843_2.png) [@RaghunathBandha](https://community.freefem.org/u/RaghunathBandha)\
**Post date:** [January 4, 2025, 2:46pm UTC](https://community.freefem.org/t/problem-with-1d-integral-while-using-movemesh-for-poisson-problem-with-neumann-boundary-condition/3673/1 "2025-01-04T14:46:35Z")

</div>

Hello,  
I have tried the Poisson problem with Neumann boundary. I am facing difficulty in the line 1D boundary integral under transformation. If du/dn=q given then q_v_ ds is transformed to Q_V_ dS. If du/dn is not given then what about discretized du/dn. Please look at this-  
[exp1.edp](https://community.freefem.org/uploads/short-url/3P5S64MeR09JJdTInb0JEFh5reA.edp) (939 Bytes)

---

<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:** [January 6, 2025, 6:55pm UTC](https://community.freefem.org/t/problem-with-1d-integral-while-using-movemesh-for-poisson-problem-with-neumann-boundary-condition/3673/2 "2025-01-06T18:55:46Z")

</div>

In any case you have to solve a well-posed problem. On the boundary, possibilities are Dirichlet conditions, Neumann conditions, or a mix of both.  
You can look at [Finite element](https://doc.freefem.org/documentation/finite-element.html)  
section “Weak Form and Boundary Condition”

Your code corrected:  
[exp1.edp](https://community.freefem.org/uploads/short-url/hZCqzGxHLixc4rg84lynn3rfo8g.edp) (1.5 KB)

---

<div class="post-metadata">

**Author:** ![RaghunathBandha](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/raghunathbandha/32/1843_2.png) [@RaghunathBandha](https://community.freefem.org/u/RaghunathBandha)\
**Post date:** [January 7, 2025, 10:16am UTC](https://community.freefem.org/t/problem-with-1d-integral-while-using-movemesh-for-poisson-problem-with-neumann-boundary-condition/3673/3 "2025-01-07T10:16:31Z")

</div>

Thank you for your effort Sir, I have a doubt on how did you get the extra term sqrt(a^2_y^2+b^2_x^2) in  
G=-18._sqrt(x^2+y^2_4./9.)_sqrt(a^2_y^2+b^2\*x^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:** [January 7, 2025, 10:41am UTC](https://community.freefem.org/t/problem-with-1d-integral-while-using-movemesh-for-poisson-problem-with-neumann-boundary-condition/3673/4 "2025-01-07T10:41:51Z")

</div>

For the formulation on the unit disc with variables p,q you have the equation  
-\partial\_p(\frac{b}{a}\partial\_p U)-\partial\_q(\frac{a}{b}\partial\_q U)-fab=0.  
When you integrate the two first terms by parts (after multiplication by V) you get a boundary term  
-\int\_\Gamma V[\frac{b}{a}\partial\_p U,\frac{a}{b}\partial\_q U]\cdot N, thus  
G=[\frac{b}{a}\partial\_p U\_{ex},\frac{a}{b}\partial\_q U\_{ex}]\cdot N   
with U\_{ex}=-18(p^2+q^2) you get the G.

---

<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:** [January 8, 2025, 12:05pm UTC](https://community.freefem.org/t/problem-with-1d-integral-while-using-movemesh-for-poisson-problem-with-neumann-boundary-condition/3673/5 "2025-01-08T12:05:25Z")

</div>

Another way is to change variables on the boundary

 ![change-var-bdry](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/3/304b52531698b5d6e430c94b39103c8265110e3b.png)  
In your example you have P=(p,q) with p^2+q^2=1, \vec\tau'=(-q,p), d\varphi^{-1}\vec\tau'=(-aq,bp),  
thus w=\sqrt{a^2q^2+b^2p^2}.

---

<div class="post-metadata">

**Author:** ![RaghunathBandha](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/raghunathbandha/32/1843_2.png) [@RaghunathBandha](https://community.freefem.org/u/RaghunathBandha)\
**Post date:** [January 8, 2025, 12:29pm UTC](https://community.freefem.org/t/problem-with-1d-integral-while-using-movemesh-for-poisson-problem-with-neumann-boundary-condition/3673/6 "2025-01-08T12:29:43Z")

</div>

Thank you sir for the explanation.
