def read_geom_h5(xdmf_file, snapshot):
header = {}<EOL>xdmf_root = xmlET.parse(str(xdmf_file)).getroot()<EOL>if snapshot is None:<EOL><INDENT>return None, xdmf_root<EOL><DEDENT>elt_snap = xdmf_root[<NUM_LIT:0>][<NUM_LIT:0>][snapshot]<EOL>header['<STR_LIT>'] = float(elt_snap.find('<STR_LIT>').get('<STR_LIT>'))<EOL>header['<STR_LIT>'] = _maybe_get(elt_snap, '<STR_LIT>', '<STR_LIT>', float)<EOL>header['<STR_LIT>'] = _maybe_get(elt_snap, '<STR_LIT>', '<STR_LIT>',<EOL>float)<EOL>header['<STR_LIT>'] = <NUM_LIT:1><EOL>coord_h5 = []  <EOL>coord_shape = []  <EOL>twod = None<EOL>for elt_subdomain in elt_snap.findall('<STR_LIT>'):<EOL><INDENT>if elt_subdomain.get('<STR_LIT:Name>').startswith('<STR_LIT>'):<EOL><INDENT>header['<STR_LIT>'] = <NUM_LIT:2><EOL>break  <EOL><DEDENT>elt_geom = elt_subdomain.find('<STR_LIT>')<EOL>if elt_geom.get('<STR_LIT>') == '<STR_LIT>' and twod is None:<EOL><INDENT>twod = '<STR_LIT>'<EOL>for data_item in elt_geom.findall('<STR_LIT>'):<EOL><INDENT>coord = data_item.text.strip()[-<NUM_LIT:1>]<EOL>if coord in '<STR_LIT>':<EOL><INDENT>twod += coord<EOL><DEDENT><DEDENT><DEDENT>data_item = elt_geom.find('<STR_LIT>')<EOL>coord_shape.append(_get_dim(data_item))<EOL>coord_h5.append(<EOL>xdmf_file.parent / data_item.text.strip().split('<STR_LIT>', <NUM_LIT:1>)[<NUM_LIT:0>])<EOL><DEDENT>_read_coord_h5(coord_h5, coord_shape, header, twod)<EOL>return header, xdmf_root<EOL>
Extract geometry information from hdf5 files.

    Args:
        xdmf_file (:class:`pathlib.Path`): path of the xdmf file.
        snapshot (int): snapshot number.
    Returns:
        (dict, root): geometry information and root of xdmf document.