smash.io.save_mesh#

smash.io.save_mesh(mesh, path)[source]#

Save the Model initialization mesh dictionary to HDF5.

Parameters:
meshdict[str, Any]

The mesh dictionary to be saved to HDF5 file.

pathstr

The file path. If the path not end with .hdf5, the extension is automatically added to the file path.

See also

read_mesh

Read the Model initialization mesh dictionary from HDF5.

Examples

>>> from smash.factory import load_dataset
>>> from smash.io import save_mesh, read_mesh
>>> setup, mesh = load_dataset("cance")
>>> mesh
{'nac': 383, 'ncol': 28, 'ng': 3, 'nrow': 28 ...}

Save mesh to HDF5

>>> save_mesh(mesh, "mesh.hdf5")