# \[Help\] How to Generate a 2D .mesh File Compatible with MMG (mmg\_hausd Use Case)

**URL:** <https://forum.mmgtools.org/t/help-how-to-generate-a-2d-mesh-file-compatible-with-mmg-mmg-hausd-use-case/888>\
**Category:** User Help\
**Created:** [April 18, 2025, 4:58pm UTC](https://forum.mmgtools.org/t/help-how-to-generate-a-2d-mesh-file-compatible-with-mmg-mmg-hausd-use-case/888 "2025-04-18T16:58:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiapxiaoyu1981](https://forum.mmgtools.org/user_avatar/forum.mmgtools.org/xiapxiaoyu1981/32/770_2.png) [@xiapxiaoyu1981](https://forum.mmgtools.org/u/xiapxiaoyu1981)\
**Post date:** [April 18, 2025, 4:58pm UTC](https://forum.mmgtools.org/t/help-how-to-generate-a-2d-mesh-file-compatible-with-mmg-mmg-hausd-use-case/888/1 "2025-04-18T16:58:01Z")

</div>

Hi everyone,

I’m a beginner with MMG and would like to seek your advice on using the `mmg-hausd` feature to achieve approximate control over the boundary. I saw that the example “Mesh adaptation to a solution” provided in `mmg_2d` demonstrates this capability. However, the tutorial starts with a file called `hole.mesh`, and I’m not sure how to generate this type of mesh.

I used Gmsh 4.4.1 to create a relatively coarse mesh, defined physical groups, and exported the mesh in `.mesh` format. Although my geometry is 2D, I noticed that the exported `.mesh` file still appears to be in 3D when opened, which is quite confusing to me.

I tried modifying it to be 2D and ran it with `mmg2d_O3`, but the issue still remains.

May I ask if I have misunderstood something in the process? I would really appreciate any suggestions or guidance you could offer.

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![cprigent](https://forum.mmgtools.org/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cprigent](https://forum.mmgtools.org/u/cprigent)\
**Post date:** [July 1, 2025, 9:06am UTC](https://forum.mmgtools.org/t/help-how-to-generate-a-2d-mesh-file-compatible-with-mmg-mmg-hausd-use-case/888/2 "2025-07-01T09:06:55Z")

</div>

Hello,

Please find attached the hole.mesh file that you can use to try out MMG.

However, if you need more guidance on the case that you created, please send it so we can investigate the issue that you have. Please provide the output log from MMG that produces the error as well.

Kind regards,  
Corentin

[hole.mesh](https://forum.mmgtools.org/uploads/short-url/jFpMNimOruGvS9tKwipAAvkL72S.mesh) (513.4 KB)
