# How to import a Gmsh-generated quad mesh geo file into FEniCS?

**URL:** <https://fenicsproject.discourse.group/t/how-to-import-a-gmsh-generated-quad-mesh-geo-file-into-fenics/14766>\
**Category:** General\
**Created:** [May 23, 2024, 2:55am UTC](https://fenicsproject.discourse.group/t/how-to-import-a-gmsh-generated-quad-mesh-geo-file-into-fenics/14766 "2024-05-23T02:55:01Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![French\_fries](https://avatars.discourse-cdn.com/v4/letter/f/71c47a/32.png) [@French\_fries](https://fenicsproject.discourse.group/u/French_fries)\
**Post date:** [May 23, 2024, 2:55am UTC](https://fenicsproject.discourse.group/t/how-to-import-a-gmsh-generated-quad-mesh-geo-file-into-fenics/14766/1 "2024-05-23T02:55:01Z")

</div>

Hello, how can I import a quad mesh geo file generated by Gmsh into FEniCS? This is the command I am using, but the generated file lacks the facet\_region (I have checked that the Physical Curve in the geo file exists)

```auto
gmsh trapezoid.geo -format msh2 -2
dolfin-convert trapezoid.msh trapezoid.xml

```

![30998fa7387d1de6d20007c6d0cec82](https://global.discourse-cdn.com/free1/uploads/fenicsproject1/original/2X/1/1ac589b1159066742f6af65a87d13af08c9121c5.png)

---

<div class="post-metadata">

**Author:** ![SvenH](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@SvenH](https://fenicsproject.discourse.group/u/SvenH)\
**Post date:** [May 23, 2024, 5:42am UTC](https://fenicsproject.discourse.group/t/how-to-import-a-gmsh-generated-quad-mesh-geo-file-into-fenics/14766/2 "2024-05-23T05:42:55Z")

</div>

Hi, I think that legacy dolfin only supports triangular meshes. See [this post](https://fenicsproject.discourse.group/t/msh-to-xml-for-quad-elements/10700)

---

<div class="post-metadata">

**Author:** ![French\_fries](https://avatars.discourse-cdn.com/v4/letter/f/71c47a/32.png) [@French\_fries](https://fenicsproject.discourse.group/u/French_fries)\
**Post date:** [May 23, 2024, 7:57am UTC](https://fenicsproject.discourse.group/t/how-to-import-a-gmsh-generated-quad-mesh-geo-file-into-fenics/14766/3 "2024-05-23T07:57:17Z")

</div>

I have a question, if I install dolfinx on top of the existing dolfin, will it overwrite dolfin? I don’t want to affect the use of dolfin.

---

<div class="post-metadata">

**Author:** ![SvenH](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@SvenH](https://fenicsproject.discourse.group/u/SvenH)\
**Post date:** [May 23, 2024, 8:04am UTC](https://fenicsproject.discourse.group/t/how-to-import-a-gmsh-generated-quad-mesh-geo-file-into-fenics/14766/4 "2024-05-23T08:04:11Z")

</div>

Then I would recommend using a Docker container for dolfinx. This way all libraries are localized in this container

---

<div class="post-metadata">

**Author:** ![French\_fries](https://avatars.discourse-cdn.com/v4/letter/f/71c47a/32.png) [@French\_fries](https://fenicsproject.discourse.group/u/French_fries)\
**Post date:** [May 23, 2024, 8:22am UTC](https://fenicsproject.discourse.group/t/how-to-import-a-gmsh-generated-quad-mesh-geo-file-into-fenics/14766/5 "2024-05-23T08:22:58Z")

</div>

I installed dolfin through conda, if I continue to install dolfinx, will it affect the old dolfin?

---

<div class="post-metadata">

**Author:** ![francesco-ballarin](https://avatars.discourse-cdn.com/v4/letter/f/f05b48/32.png) [@francesco-ballarin](https://fenicsproject.discourse.group/u/francesco-ballarin)\
**Post date:** [May 23, 2024, 8:57am UTC](https://fenicsproject.discourse.group/t/how-to-import-a-gmsh-generated-quad-mesh-geo-file-into-fenics/14766/6 "2024-05-23T08:57:30Z")

</div>

Can you create a new conda environment? In that way, you’ll have an environment with dolfin, and a separate one with dolfinx.

---

<div class="post-metadata">

**Author:** ![French\_fries](https://avatars.discourse-cdn.com/v4/letter/f/71c47a/32.png) [@French\_fries](https://fenicsproject.discourse.group/u/French_fries)\
**Post date:** [May 23, 2024, 9:26am UTC](https://fenicsproject.discourse.group/t/how-to-import-a-gmsh-generated-quad-mesh-geo-file-into-fenics/14766/7 "2024-05-23T09:26:07Z")

</div>

I am not sure if it is possible to create two conda environments in the Ubuntu system, do you know?

---

<div class="post-metadata">

**Author:** ![francesco-ballarin](https://avatars.discourse-cdn.com/v4/letter/f/f05b48/32.png) [@francesco-ballarin](https://fenicsproject.discourse.group/u/francesco-ballarin)\
**Post date:** [May 23, 2024, 9:36am UTC](https://fenicsproject.discourse.group/t/how-to-import-a-gmsh-generated-quad-mesh-geo-file-into-fenics/14766/8 "2024-05-23T09:36:38Z")

</div>

I am not a conda user, but [Managing environments — conda 24.5.1.dev20 documentation](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands) has commands to create conda environments, and I don’t see why ubuntu (or any other OS) should disable that functionality.

---

<div class="post-metadata">

**Author:** ![French\_fries](https://avatars.discourse-cdn.com/v4/letter/f/71c47a/32.png) [@French\_fries](https://fenicsproject.discourse.group/u/French_fries)\
**Post date:** [May 23, 2024, 9:48am UTC](https://fenicsproject.discourse.group/t/how-to-import-a-gmsh-generated-quad-mesh-geo-file-into-fenics/14766/9 "2024-05-23T09:48:53Z")

</div>

Thanks for your reply!

---

<div class="post-metadata">

**Author:** ![Rene\_Thierry\_Djoumes](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/rene_thierry_djoumes/32/4874_2.png) [@Rene\_Thierry\_Djoumes](https://fenicsproject.discourse.group/u/Rene_Thierry_Djoumes)\
**Post date:** [May 27, 2024, 1:01pm UTC](https://fenicsproject.discourse.group/t/how-to-import-a-gmsh-generated-quad-mesh-geo-file-into-fenics/14766/10 "2024-05-27T13:01:28Z")

</div>

The Legacy version does not support quad mesh. dolfinx is a good aternative.
