def read(filename):
import h5py<EOL>f = h5py.File(filename, "<STR_LIT:r>")<EOL>dset = f["<STR_LIT>"]<EOL>points = dset["<STR_LIT>"]["<STR_LIT>"][()]<EOL>point_data = {}<EOL>if "<STR_LIT>" in dset["<STR_LIT>"]:<EOL><INDENT>for name, dataset in dset["<STR_LIT>"]["<STR_LIT>"].items():<EOL><INDENT>point_data[name] = dataset[()]<EOL><DEDENT><DEDENT>h5m_to_meshio_type = {"<STR_LIT>": "<STR_LIT>", "<STR_LIT>": "<STR_LIT>", "<STR_LIT>": "<STR_LIT>"}<EOL>cells = {}<EOL>cell_data = {}<EOL>for h5m_type, data in dset["<STR_LIT>"].items():<EOL><INDENT>meshio_type = h5m_to_meshio_type[h5m_type]<EOL>conn = data["<STR_LIT>"]<EOL>cells[meshio_type] = conn[()] - <NUM_LIT:1><EOL><DEDENT>field_data = {}<EOL>return Mesh(<EOL>points, cells, point_data=point_data, cell_data=cell_data, field_data=field_data<EOL>)<EOL>
Reads H5M files, cf.
    https://trac.mcs.anl.gov/projects/ITAPS/wiki/MOAB/h5m.