Read_meshtags issus : "Storage format "" is unknown"

Dear Community,

I am trying to define boundaries from an xdmf file. I read a .med but I meet an issue with the function read_meshtags().
I read a previous discussion on dolfin where it advised to use write_checkpoint and read_checkpoint but how can I solve the " RuntimeError : Storage format “” is unknown" in using dolfinx ?
It seems that there is an issue where I use meshio.write() making datas that read_meshtags() can’t read.

This is the little script :

import matplotlib.pyplot as plt
import meshio
import dolfinx
from mpi4py import MPI
import numpy as np

def create_mesh(mesh, cell_type, prune_z=False):
    cells = mesh.get_cells_type(cell_type)
    points = mesh.points[:,:2] if prune_z else mesh.points
    out_mesh = meshio.Mesh(points=points, cells={cell_type: cells})
    return out_mesh

proc = MPI.COMM_WORLD.rank 
if proc == 0:
    # Read in mesh
    msh = meshio.read("Mesh_quad_v4_1.med")
    # Create and save one file for the mesh, and one file for the facets 
    quad_mesh = create_mesh(msh, "quad")
    line_mesh = create_mesh(msh, "line")
    meshio.write("mesh.xdmf", quad_mesh)
    meshio.write("mt.xdmf", line_mesh)


with dolfinx.io.XDMFFile(MPI.COMM_WORLD, "mesh.xdmf", "r") as xdmf:
    mesh = xdmf.read_mesh(name="Grid")
    ct = xdmf.read_meshtags(mesh, name="Grid") # RunTimeError

Thank you for the help.

Kind regards,

Lamia

I found my mistake. I removed the cell_data but I have to keep the argument.

def create_mesh(mesh, cell_type, prune_z=False):
    cells = mesh.get_cells_type(cell_type)
    cell_data = mesh.get_cell_data("cell_tags", cell_type)
    points = mesh.points[:,:2] if prune_z else mesh.points
    out_mesh = meshio.Mesh(points=points,
                           cells={cell_type: cells},
                           cell_data={"name_to_read":[cell_data]})
    return out_mesh