smash.read_mesh#
- smash.read_mesh(path)[source]#
Read Model initialization mesh dictionary.
- Parameters:
- pathstr
The file path.
- Returns:
- dict
A mesh dictionary loaded from HDF5 file.
- Raises:
- FileNotFoundError:
If file not found.
- ReadHDF5MethodError:
If file not created with
save_mesh.
See also
save_meshSave Model initialization mesh dictionary.
Examples
>>> setup, mesh = smash.load_dataset("cance") >>> mesh {'dx': 1000.0, 'nac': 383, 'ncol': 28, 'ng': 3, 'nrow': 28 ...}
Save mesh
>>> smash.save_mesh(mesh, "mesh.hdf5")
Read mesh
>>> mesh_rld = smash.read_mesh("mesh.hdf5") {'dx': 1000.0, 'nac': 383, 'ncol': 28, 'ng': 3, 'nrow': 28, ...}