# FreeFem++ code second order normal

**URL:** <https://community.freefem.org/t/freefem-code-second-order-normal/3140>\
**Category:** Feature Request\
**Created:** [April 22, 2024, 4:11pm UTC](https://community.freefem.org/t/freefem-code-second-order-normal/3140 "2024-04-22T16:11:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Monirul25](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/monirul25/32/3287_2.png) [@Monirul25](https://community.freefem.org/u/Monirul25)\
**Post date:** [April 22, 2024, 4:11pm UTC](https://community.freefem.org/t/freefem-code-second-order-normal/3140/1 "2024-04-22T16:11:05Z")

</div>

Can you please tell me what is the code of (del^u)/(del n^2), where n is the outward normal.  
That is i want to know freefem++ code of second order normal that is u\_nn .

---

<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 25, 2024, 3:33pm UTC](https://community.freefem.org/t/freefem-code-second-order-normal/3140/2 "2024-04-25T15:33:34Z")

</div>

Remark, generally we do not use second order derivatives in formulation, we use intergration by part  
to get just first order derivatives.

But they is not problem to compute

```auto
macro D2(u) [[dxx(u),dxy(u)],[dxy(u),dyy(u)]] //
macro dnn(u) ( [N.x,N.y]'* (D2(u) * [N.x,N.y] ))//

```

---

<div class="post-metadata">

**Author:** ![Monirul25](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/monirul25/32/3287_2.png) [@Monirul25](https://community.freefem.org/u/Monirul25)\
**Post date:** [April 26, 2024, 3:04pm UTC](https://community.freefem.org/t/freefem-code-second-order-normal/3140/3 "2024-04-26T15:04:10Z")

</div>

Thank you sir. I also made a code.

---

<div class="post-metadata">

**Author:** ![Monirul25](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/monirul25/32/3287_2.png) [@Monirul25](https://community.freefem.org/u/Monirul25)\
**Post date:** [May 6, 2024, 1:54am UTC](https://community.freefem.org/t/freefem-code-second-order-normal/3140/4 "2024-05-06T01:54:25Z")

</div>

Sir, can you tell me in similar mannar how i write the code for 4th order normal. I have tried but in this case we have to write  
(dxxxx(u) _(N.x) ^4+ 14_dxyxy(u) _(N.x) ^2_(N.y) ^2  
+dyyyy(u) \*(N.y) ^4)

But problem is that dxxxx(u), dyyyy(u) and dxyxy(u)  
is not taking by FreeFem++.  
We have tried to write it like dxxxx(u) =dxx(dxx(u))  
In this fasion. But all are showing error in giving ") ".  
Please help sir. It is urgent.

---

<div class="post-metadata">

**Author:** ![Monirul25](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/monirul25/32/3287_2.png) [@Monirul25](https://community.freefem.org/u/Monirul25)\
**Post date:** [May 6, 2024, 3:57am UTC](https://community.freefem.org/t/freefem-code-second-order-normal/3140/5 "2024-05-06T03:57:23Z")

</div>

I have tried the following code also.

macro D4(u) [[dxxxx(u), dxyxy(u)],[dxyxy(u), dyyyy(u)]]//  
macro dnnnn(u) ([(N.x) ^2, (N.y) ^2]'\*D4(u) \*[(N.x) ^2, (N.y) ^2]) //

Still it is showing error to write dxxxx(u). 🙂🙂🙂  
What to do sir???.

---

<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:** [June 12, 2024, 8:16am UTC](https://community.freefem.org/t/freefem-code-second-order-normal/3140/6 "2024-06-12T08:16:10Z")

</div>

I sorry generally the derivative of order 4 is zero for lot of finite element, you have to think about your numerical scheme.
