def METHOD_NAME(tempdir, encoding, cell_type):
    filename = Path(tempdir, "mesh.xdmf")
    mesh = create_unit_square(MPI.COMM_WORLD, 12, 12, cell_type)
    mesh.name = "square"
    with XDMFFile(mesh.comm, filename, "w", encoding=encoding) as file:
        file.write_mesh(mesh)
    with XDMFFile(MPI.COMM_WORLD, filename, "r", encoding=encoding) as file:
        mesh2 = file.read_mesh(name="square")
    assert mesh2.name == mesh.name
    topology, topology2 = mesh.topology, mesh2.topology
    assert topology.index_map(0).size_global == topology2.index_map(0).size_global
    assert topology.index_map(topology.dim).size_global == topology2.index_map(topology.dim).size_global