How do i create this type of mesh?

Hello!
I’m a beginner at using Fenics, and currently working on a hydrodynamic model that uses 3 types of dolfin meshes. One of them is a regular 2D DOLFIN XML mesh that i could convert from another extension using meshio. Meanwhile the other two are DOLFIN XMLs that have the following structure :

image

How do i exactly make this kind of mesh?
Thank you in advance!
And sorry if this is a duplicate thread or already stated somewhere else.

The xml meshes are deprecated, and I would not aim at trying to create anything in that format. The preferred format now is XDMF, and there are plenty of threads on this, see: Transitioning from mesh.xml to mesh.xdmf, from dolfin-convert to meshio - #3 by dokken
and
Accessing and marking imported boundaries - #8 by dokken

1 Like

Thank you for your reply! And that thread helped me find more things i need.
However, i’m using a model with old library so it’s still depending on DOLFIN XMLs. And i am nowhere near competent enough to implement XDMF as the input…

I’m sorry if this is going on tangent, but supposedly i would still use DOLFIN XMLs, how do i create physical region and facet region in that format in DOLFIN XMLs?

Read through the dolfin-convert script
https://bitbucket.org/fenics-project/dolfin/src/0fe9b62bf0202ecdffd9bb9032f6f2d298c284ac/scripts/dolfin-convert/dolfin-convert#lines-79
And you will see it calls a function meshvonvert. Follow the code to that function, and it should help you understand how it works

1 Like

Thank you very much! I got the general gist of how it works and apparently gmsh also exported their own facet and physical region mesh, silly me!

Hi, dokken. I’ve tried using dolfin-convert on a simple box mesh that calls meshconvert but somehow it didn’t create the physical and geometrical XMLs as meshconvert.py implies. Is it because of the mesh structure or am i missing something? I did this on dolfin-version 2019.2.0dev0
Sorry for continuing the thread and any help is appreciated!
Also, the .msh in question if needed :
Simple Box .msh