# Normal boundary condition

**URL:** <https://community.freefem.org/t/normal-boundary-condition/341>\
**Category:** General Discussion\
**Created:** [April 10, 2020, 1:55pm UTC](https://community.freefem.org/t/normal-boundary-condition/341 "2020-04-10T13:55:58Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![k-matsushima-19](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/k-matsushima-19/32/2170_2.png) [@k-matsushima-19](https://community.freefem.org/u/k-matsushima-19)\
**Post date:** [March 20, 2024, 11:27am UTC](https://community.freefem.org/t/normal-boundary-condition/341/12 "2024-03-20T11:27:05Z")

</div>

You can use the Lagrange multiplier method if you don’t like the penalization.

For example, let \Omega be a bounded domain of \mathbb{R}^d with boundary \partial\Omega = \overline{\Gamma\_N \cup \Gamma\_S} and consider the following linear elasticity problem:

-\mathrm{div}(C:\varepsilon(u)) = 0 \text{ in }\Omega \\ (C:\varepsilon(u))n = t \text{ on }\Gamma\_N \\ u\cdot n = 0 \text{ on }\Gamma\_S

with the standard fourth-order elasticity tensor C, given traction t\in H^{-1/2}(\Gamma\_N)^d and second-order strain tensor \varepsilon(u). This problem can be rewritten as the variational problem on H^1(\Omega)^d:

\min\_{u\in H^1(\Omega)^d} \frac{1}{2}\int\_\Omega \varepsilon(u):C:\varepsilon(u) dx - \int\_{\Gamma\_N} t\cdot u\mathrm{d}s \\ \text{subject to }u\cdot n = 0 \text{ on }\Gamma\_S.

To solve this, we define the Lagrange functional \mathcal{L}:H^1(\Omega)^d\times H^{-1/2}(\Gamma\_S)\to\mathbb{R} by

\mathcal{L}(u,\varphi) = \frac{1}{2}\int\_\Omega \varepsilon(u):C:\varepsilon(u) dx - \int\_{\Gamma\_N} t\cdot u\mathrm{d}s + \langle \varphi,u\cdot n\rangle\_{H^{1/2}(\Gamma\_S)},

where \langle\cdot,\cdot\rangle\_{H^{1/2}(\Gamma\_S)} is the usual duality pairing. A solution of the variational problem is sought as a stationary point of \mathcal{L}, i.e.,

0 = \langle d\_u\mathcal{L}(u,\varphi),v\rangle\_{H^1(\Omega)^d} = \int\_\Omega \varepsilon(u):C:\varepsilon(v) dx - \int\_{\Gamma\_N} t\cdot v\mathrm{d}s + \langle \varphi,v\cdot n\rangle\_{H^{1/2}(\Gamma\_S)}, \\ 0 = \langle d\_\varphi\mathcal{L}(u,\varphi),\psi\rangle\_{H^{-1/2}(\Gamma\_S)} = \langle \psi,u\cdot n\rangle\_{H^{1/2}(\Gamma\_S)},

for all (v,\psi)\in H^1(\Omega)^d\times H^{-1/2}(\Gamma\_S). In summary, our problem is to find (u,\varphi)\in H^1(\Omega)^d\times H^{-1/2}(\Gamma\_S) such that

\int\_\Omega \varepsilon(u):C:\varepsilon(v) dx + \langle \varphi,v\cdot n\rangle\_{H^{1/2}(\Gamma\_S)} + \langle \psi,u\cdot n\rangle\_{H^{1/2}(\Gamma\_S)} = \int\_{\Gamma\_N} t\cdot v\mathrm{d}s

for all (v,\psi)\in H^1(\Omega)^d\times H^{-1/2}(\Gamma\_S).

To solve this using FreeFEM, we need an fespace corresponding to the product space H^1(\Omega)^d\times H^{-1/2}(\Gamma\_S). Thanks to the [new feature](https://doc.freefem.org/documentation/composite.html) in the latest release, this can be easily implemented.

[lagrange.edp](https://community.freefem.org/uploads/short-url/fbPxHyqMaoBPiFSz3WTIWPKjyAK.edp) (2.4 KB)  
[penalty.edp](https://community.freefem.org/uploads/short-url/e8aHE9vlCrsaVdy3U30D8GIA1A1.edp) (2.1 KB)

---

_[View the full topic](https://community.freefem.org/t/normal-boundary-condition/341)._
