def create_DMPlex_from_hdf5(file):
    """
    Creates a DMPlex object from an HDF5 file.
    This is useful for rebuilding a mesh that is saved from a
    previous simulation.

    Parameters
    ----------
     file : string
        point to the location of hdf5 file

    Returns
    -------
     DM : object
        PETSc DMPlex object

    Notes
    -----
     This function requires petsc4py >= 3.8
    """
    from petsc4py import PETSc
    file = str(file)
    if not file.endswith('.h5'):
        file += '.h5'
    dm = PETSc.DMPlex().createFromFile(file)
    origSect = dm.createSection(1, [1, 0, 0])
    origSect.setFieldName(0, 'points')
    origSect.setUp()
    dm.setDefaultSection(origSect)
    origVec = dm.createGlobalVector()
    if PETSc.COMM_WORLD.size > 1:
        sf = dm.distribute(overlap=1)
        newSect, newVec = dm.distributeField(sf, origSect, origVec)
        dm.setDefaultSection(newSect)
    return dm
