OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
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, const HsfLayout &layout={})
 Read legacy-layout hot-start records and preserve raw runoff/trailer bytes.
 
FormatResult openswmm::gpkg::formats::writeHotstartHsf (const std::string &path, const HotstartSnapshot &snapshot)
 Write retained legacy hot-start routing records and opaque raw sections.
 

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 section (saveRunoff/readRunoff), whose length depends on the model (HsfLayout), and anything after the link records (an OpenSWMM trailer) are carried verbatim, so a file round-trips byte for byte. A v4 file's per-storage-node residence time float is decoded.

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
Apache-2.0