write_bed_restart_file¶
- tfv.restart.write_bed_restart_file(restart_file: str | Path, bed_mass: ndarray, time=Timestamp('1990-01-01 00:00:00'), nc3=999999, precision='single')¶
Write TUFLOW FV Bed Restart File.
Function to write a bed restart binary file for sediment transport runs.
If a cell bed layer has zero mass in it, the bed layer will be removed. If you are appending a new bed layer that has zero mass in all cells, that layer will be removed for compatibility with TUFLOW FV. To get around this, use
np.clip(bed_mass, 1e-4, None)to set a small amount of mass in every cell.- Parameters:
restart_file (str or Path) – Full path to where the sediment restart file should be written.
bed_mass (np.ndarray) – Bed mass array with shape (nc2, maxnl, ng), i.e. 2D cells, bed layers, and grain fractions.
time (pd.Timestamp, optional) – Timestamp written into the file header. Not used by TUFLOW FV at runtime. Defaults to 1990-01-01.
nc3 (int, optional) – 3D cell count tag written into the file header. Not used by TUFLOW FV at runtime. Defaults to 999999.
precision ({'single', 'double'}, optional) – Floating-point precision for writing bed_mass. Defaults to ‘single’.
- Returns:
This function writes the restart file to disk.
- Return type:
None