dokken
February 10, 2026, 1:37pm
2
otaolafr:
import meshio
mesh = meshio.read(
'/home/franco/Downloads/dummyFiles/test/hexa.med'
)
mesh.write(
'/home/franco/Downloads/dummyFiles/test/hexa.xdmf' )
Then run it by using python3 test.py, this proven to ‘write’ the mesh in the desired xdmf format, nevertheless, i am having some trouble still:
The groups I have created in salome disappeared, there is only a cell_tags i can see in paraview, that are negative from -12 to 0, where each negative int value looks like it corresponds to one of the groups that i had in salome, from the -12 until the -6 but the -5 to -1 are empty and furthermore the 0 I dont finish of recognizing what corresponds to as it does not completely correspond to anything I have a tag on salome nor the submeshes.
I usually do more than what you have done here when working with meshio.
An example of this (using gmsh) can be found in many posts in the forum, such as):
which points to my tutorial and is similar to:
You are here trying to integrate over the vertices of your mesh?
Then you are not integrating over a facet (“ds”) but a vertex (“dp”).
However, lets take 10 steps backwards, and consider:
import meshio
import gmsh
gmsh.initialize()
gmsh.model.add("my model")
c_r = [0, 0, 0]
c_R = [0, 0, 0]
r = 1
R = 2
resolution = 0.1
print(f"Mesh resolution = {resolution}")
disk_r = gmsh.model.occ.addDisk(c_r[0], c_r[1], c_r[2], r, r)
disk_R = gmsh.model.occ.addDisk(c_R[0], c_R[1], c_R[2], R, R)
ring = gm…
Note that I’ve been rewriting adios4dolfinx to support all kinds of IO backends, including:
pyvista (meshio)
VTKHDF
XDMF
in: General backend support by jorgensd · Pull Request #193 · jorgensd/adios4dolfinx · GitHub
I could help you read the .med file if you provide an example.
For instance I made a bespoke writer for the exodus file format at: GitHub - jorgensd/mesh_converter: A mesh converter from EXODUS 2 to XDMF
There are many demos that does this, for instance at: