OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
HotstartFormat.hpp File Reference

Legacy HSF v4 binary hot-start file — parser / materialiser. More...

#include "FormatTypes.hpp"
#include <string>
Include dependency graph for HotstartFormat.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  openswmm
 
namespace  openswmm::gpkg
 
namespace  openswmm::gpkg::formats
 

Functions

FormatResult openswmm::gpkg::formats::parseHotstartHsf (const std::string &path, HotstartSnapshot &snapshot)
 Parse an HSF v4 file into a HotstartSnapshot.
 
FormatResult openswmm::gpkg::formats::writeHotstartHsf (const std::string &path, const HotstartSnapshot &snapshot)
 Write a HotstartSnapshot to an HSF v4 file at path.
 

Detailed Description

Legacy HSF v4 binary hot-start file — parser / materialiser.

Slice IO-6e. Implements the routing-state portion of the EPA-SWMM hot-start file (saveRouting/readRouting in src/legacy/engine/hotstart.c):

  • Header: "SWMM5-HOTSTART4" + {nSubcatch, nLandUses, nNodes, nLinks, nPollut, flowUnits} (six int32 fields).
  • Per-node state: float depth, lateral_inflow + nPollut quality floats. overflow is not in the legacy HSF; it is preserved through the GPKG schema only and round-trips through HSF as 0.0.
  • Per-link state: float flow, depth, setting + nPollut quality floats. The other GPKG hotstart_link_state fields (volume, target_setting, time_open, time_closed) have no HSF counterpart and round-trip through HSF as 0.0.

The subcatchment-runoff portion of the legacy file (saveRunoff/readRunoff) carries conditional fields whose presence depends on per-subcatchment groundwater / snowpack configuration. That portion is out of scope for IO-6e; this slice covers the routing-state half so the GeoPackage materialiser can round-trip a USE-direction hot-start used to seed routing-only restart scenarios. A follow-up slice extends to runoff state when the subcatchment editor lands.

Endianness: HSF is written little-endian on all SWMM5 platforms. We rely on the SWMM5 convention (no byte-swapping) and document the assumption.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n MIT License