Skip to main content

HMF mesh format

Project description


HDF-only XDMF.

gh-actions Code style: black PyPi Version GitHub stars PyPi downloads

The XDMF data and mesh format is arguably one of the best mesh formats out there in terms of file size, I/O speed, and ecosystem support. There is one annoyance though that has bugged me over the years: If using the binary or HDF data type (which you should), an XDMF archive consists of multiple files. When copying things over, it is easy to miss or accidentally replace one of those.

Along comes HMF. It's just like XDMF, except that it restricts itself to HDF data (which most XDMF files use anyway) and puts all the meta data (which for XDMF is found in the XML file) into the HDF file. This way, you're only ever dealing with one file.

This repository contains a Python package that makes working with HMF files easy. Install with

pip install hmftools

and use the command-line tools

hmf-info <input-hmf>                               # print some info about the file
hmf-convert <input-mesh-file> <output-mesh-file>   # convert to/from HMF into other formats
hmf-compress <input-hmf>                           # compress the HMF file
hmf-uncompress <input-hmf>                         # uncompress the HMF file

Note that compressed HMF files (which is the default) tend to be much smaller, but require a bit longer to read. Depending on how often you need to read a file, you might want to hmf-uncompress it first.

ParaView plugin

After installing the hmftools, you can use a plugin to read HMF files with ParaView. Open ParaView, go to

Tools -> Manage Plugins... -> Load New ...

and select the file (typically installed at $HOME/.local/paraview-plugins/ Also activate Auto Load.

After that, you can view any HMF file with ParaView. Note that you might have to start ParaView with

HDF5_DISABLE_VERSION_CHECK=1 paraview out.hmf

to avoid a version warning/error.


The code in this repository is published under the MIT license.

Project details

Release history Release notifications

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for hmftools, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size hmftools-0.0.3-py3-none-any.whl (11.7 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size hmftools-0.0.3.tar.gz (8.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page