# Load mesh and facet tags in dolfinx from .msh or .xdmf file

**URL:** <https://fenicsproject.discourse.group/t/load-mesh-and-facet-tags-in-dolfinx-from-msh-or-xdmf-file/9977>\
**Category:** mesh\
**Created:** [December 15, 2022, 11:51am UTC](https://fenicsproject.discourse.group/t/load-mesh-and-facet-tags-in-dolfinx-from-msh-or-xdmf-file/9977 "2022-12-15T11:51:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JLorenteMacias](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/jlorentemacias/32/4742_2.png) [@JLorenteMacias](https://fenicsproject.discourse.group/u/JLorenteMacias)\
**Post date:** [December 15, 2022, 11:51am UTC](https://fenicsproject.discourse.group/t/load-mesh-and-facet-tags-in-dolfinx-from-msh-or-xdmf-file/9977/1 "2022-12-15T11:51:30Z")

</div>

Dear all,

I have a .msh file and a .xdmf file containitng the mesh and facet tags that I am using to solve a problem.  
Because I don’t want to perform the meshing process every time I run the code, I was wondering what would be the most efficient way of loading the mesh in dolfinx (including facet tags) from the .msh or .xdmf file.

Any suggestion?

Thank you all in advance.

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [December 15, 2022, 1:27pm UTC](https://fenicsproject.discourse.group/t/load-mesh-and-facet-tags-in-dolfinx-from-msh-or-xdmf-file/9977/2 "2022-12-15T13:27:08Z")

</div>

The most efficient way is using XDMF, as it reads in data over multiple processes (if you use multiple processes with `mpirun`). Using `msh`, an ascii based format, you would need to read the data in on a single process, and then distribute it (this is what `dolfinx.mesh.create_mesh` does).
