meshio icon indicating copy to clipboard operation
meshio copied to clipboard

Labels are not conserved when transforming from .mesh to .vtk format

Open oarcelus opened this issue 3 years ago • 3 comments

I am generating a .mesh file with CGAL. The .mesh file saves the labels of each of the mesh points that belong to different phases.

When running the command meshio convert input.mesh output.vtk

However, the resulting .vtk does not save this information. I am doing something wrong here?

oarcelus avatar Jan 11 '22 12:01 oarcelus

I think one problem is that vtk files do not contain any point or element label information but just the arrays of nodes and elements, indexed starting with 0. There is the same issue if you convert from abaqus meshes. You might even have meshes where you are missing a lot of labels, for example because your elements are labeled 1,2,3,1000 and in the VTK mesh you will just get elements 0,1,2,3.

I think conserving labels would be really nice, especially if you read label-agnostic meshes and want to select certain elements/nodes in the mesh. For abaqus meshes, for example, all labels are withdrawn when reading in the mesh.

reox avatar Mar 04 '22 07:03 reox

I could see if the problem still exists in the development version, but I'd need a sample input.mesh.

nschloe avatar May 02 '22 21:05 nschloe

Hi, please find attached the liver.mesh example from CGAL documentation. liver.zip

I just realized that even the meshio.read function does not conserve the labels of mesh elements.

oarcelus avatar May 12 '22 09:05 oarcelus