Convert grid file of Comsol to xdmf

Hello everyone, greetings!
I recently installed FEniCS. In my work, I need to convert .stl file to xdmf format, which is readable by FEniCS.
The following code was used to convert a mesh from .stl format to xdmf format but I am getting an error:
meshio.write(“mesh.xdmf”,meshio.Mesh(points = msh.points,cells = {‘tetra’:msh.cells_dict[‘tetra’]}))
error message:KeyError: ‘tetra’

Other methods of switching formats of comsol to xdmf are also needed

Could you please help me to resolve this issue?

Thank you,

-Xiao Li

Your error message is quite clear, the read in mesh has no tetrahedral elements. What is the output of
print(msh.cells_dict.keys())

Thank you very much for your reply.
the output of print(msh.cells_dict.keys()) is dict_keys([‘tetra10’])

With your help, the problem has been solved, thank you again!