smash.io.read_mesh#
- smash.io.read_mesh(path)[source]#
Read the Model initialization mesh dictionary from HDF5.
- Parameters:
- pathstr
The file path.
- Returns:
- meshdict[str, Any]
A mesh dictionary loaded from HDF5.
- Raises:
- FileNotFoundError:
If file not found.
- ReadHDF5MethodError:
If file not created with
save_mesh
.
See also
save_mesh
Save the Model initialization mesh dictionary to 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")
Read mesh from HDF5
>>> mesh_rld = read_mesh("mesh.hdf5") >>> mesh_rld {'nac': 383, 'ncol': 28, 'ng': 3, 'nrow': 28 ...}