not necessary but would be an enhancement: is it possible to check that `output_file` *ends* with `_grid.xmf` instead of checking that it contains the string?