# How to identify the boundary label for an import mesh

**URL:** <https://community.freefem.org/t/how-to-identify-the-boundary-label-for-an-import-mesh/161>\
**Category:** General Discussion\
**Created:** [October 26, 2019, 5:12pm UTC](https://community.freefem.org/t/how-to-identify-the-boundary-label-for-an-import-mesh/161 "2019-10-26T17:12:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lihao](https://avatars.discourse-cdn.com/v4/letter/l/ecd19e/32.png) [@Lihao](https://community.freefem.org/u/Lihao)\
**Post date:** [October 26, 2019, 5:12pm UTC](https://community.freefem.org/t/how-to-identify-the-boundary-label-for-an-import-mesh/161/1 "2019-10-26T17:12:39Z")

</div>

Dear developers,

I tried to use Implicit domain meshing MMG3D to get an adaptive mesh based on 0 value of the level-set function

After reading the mesh into FreeFem++, I need to identify the boundary label in order to apply the boundary condition. Could you please give me some suggestion about this?

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [October 27, 2019, 5:50am UTC](https://community.freefem.org/t/how-to-identify-the-boundary-label-for-an-import-mesh/161/2 "2019-10-27T05:50:10Z")

</div>

Here is one way to do it.

```auto
mesh Th = square(10, 10);
int[int] lab = labels(Th);
varf onG(u, v) = on(lab, u = label);
fespace Vh(Th, P1);
Vh u;
u[] = onG(0, Vh, tgv = -1);
plot(u);

```

---

<div class="post-metadata">

**Author:** ![Lihao](https://avatars.discourse-cdn.com/v4/letter/l/ecd19e/32.png) [@Lihao](https://community.freefem.org/u/Lihao)\
**Post date:** [October 27, 2019, 7:20am UTC](https://community.freefem.org/t/how-to-identify-the-boundary-label-for-an-import-mesh/161/3 "2019-10-27T07:20:42Z")

</div>

Thanks so much for you kind help.  
It does work!  
I tried your method for 2D and 3D problem, it works fine!

Thanks agian.

Sincerely yours,  
Hao
