# Imposed Dirichlet condition on labelled surfaces

**URL:** <https://community.freefem.org/t/imposed-dirichlet-condition-on-labelled-surfaces/3761>\
**Category:** General Discussion\
**Created:** [February 20, 2025, 7:57am UTC](https://community.freefem.org/t/imposed-dirichlet-condition-on-labelled-surfaces/3761 "2025-02-20T07:57:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dominiquebodin](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@dominiquebodin](https://community.freefem.org/u/dominiquebodin)\
**Post date:** [February 20, 2025, 7:57am UTC](https://community.freefem.org/t/imposed-dirichlet-condition-on-labelled-surfaces/3761/1 "2025-02-20T07:57:34Z")

</div>

Dear all,  
considering the " Newton Method for the Steady Navier-Stokes equations" example below:  
[https://doc.freefem.org/tutorials/navierStokesNewton.html](https://doc.freefem.org/tutorials/navierStokesNewton.html)  
I’m wondering how to impose velocities on labelled surfaces if 3D meshes are considered. The meshing and the labelled surfaces are created using Gmsh application.  
Any comment is welcome

---

<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:** [February 24, 2025, 3:51pm UTC](https://community.freefem.org/t/imposed-dirichlet-condition-on-labelled-surfaces/3761/2 "2025-02-24T15:51:53Z")

</div>

you can follow [Import 3D mesh files into FreeFEM - Part 1 · Mojtaba Barzegari](https://mbarzegary.github.io/2021/07/31/import-3d-mesh-into-freefem-part1/)

---

<div class="post-metadata">

**Author:** ![dominiquebodin](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@dominiquebodin](https://community.freefem.org/u/dominiquebodin)\
**Post date:** [February 25, 2025, 6:39am UTC](https://community.freefem.org/t/imposed-dirichlet-condition-on-labelled-surfaces/3761/3 "2025-02-25T06:39:17Z")

</div>

Thanks for the reference

---

<div class="post-metadata">

**Author:** ![dominiquebodin](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@dominiquebodin](https://community.freefem.org/u/dominiquebodin)\
**Post date:** [February 25, 2025, 6:44am UTC](https://community.freefem.org/t/imposed-dirichlet-condition-on-labelled-surfaces/3761/4 "2025-02-25T06:44:32Z")

</div>

my point was related on the unknowns of the problem.  
The reference

[https://doc.freefem.org/tutorials/navierStokesNewton.html](https://doc.freefem.org/tutorials/navierStokesNewton.html)

considers the displacement increments du as unknowns, and I do not see how to impose a condition on displacements u

---

<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:** [February 25, 2025, 10:44am UTC](https://community.freefem.org/t/imposed-dirichlet-condition-on-labelled-surfaces/3761/5 "2025-02-25T10:44:53Z")

</div>

With regards to the document navierStokesNewton, instead of imposing `du1=0, du2=0` , if you want to impose the Dirichlet condition on the updated velocities u\_1^{i+1}=a, u\_2^{i+1}=b, the best way is to write `+ on(1, du1=u1-a, du2=u2-b)`

---

<div class="post-metadata">

**Author:** ![dominiquebodin](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@dominiquebodin](https://community.freefem.org/u/dominiquebodin)\
**Post date:** [February 26, 2025, 10:49am UTC](https://community.freefem.org/t/imposed-dirichlet-condition-on-labelled-surfaces/3761/6 "2025-02-26T10:49:39Z")

</div>

Thanks François,  
by the fact, I already tried this but I did not let enough iterations running, so my conclusions were erroneous.  
You have confirmed the approach, so I let more iterations progressing, and it’s better now.
