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

Hot start file manager — in-memory representation + I/O. More...

#include <cstdint>
#include <functional>
#include <string>
#include <vector>
Include dependency graph for HotStartManager.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  openswmm::HotStartLidCellRecord
 Node hydraulic state at hot-start save time. More...
 
struct  openswmm::HotStartNodeRecord
 
struct  openswmm::HotStartLinkRecord
 Link hydraulic state at hot-start save time. More...
 
struct  openswmm::HotStartSubcatchRecord
 Subcatchment state at hot-start save time. More...
 
struct  openswmm::HotStartHeader
 In-memory representation of the OPENSWMM_HS_V1 header. More...
 
struct  openswmm::HotStartFile
 In-memory hot start file data. More...
 
struct  openswmm::LegacySpeciesTrailer
 Static utility class for hot start file operations. More...
 
class  openswmm::HotStartManager
 

Namespaces

namespace  openswmm
 
namespace  openswmm::runoff
 
namespace  openswmm::groundwater
 

Detailed Description

Hot start file manager — in-memory representation + I/O.

HotStartManager provides the C++ implementation of the hot start API declared in include/openswmm/engine/openswmm_hotstart.h.

Binary file format

V1 (legacy — no infiltration/GW state): Offset Size Field <hr> 0 16 Magic "OPENSWMM_HS_V1\0" 16 4 Version: uint32_t = 1 ... (nodes, links as before) Per-subcatch: [uint32 name_len, char name[], double runoff, double gwater] EOF-4 4 CRC32: uint32_t

V2 (Gap #54 — includes infiltration model state and GW zone state): 0 16 Magic "OPENSWMM_HS_V1\0" (same magic, version byte changes) 16 4 Version: uint32_t = 2 20 8 Timestamp (Unix seconds): int64_t 28 8 Simulation time at save (decimal days): double 36 8 Start date (OADate): double 44 8 End date (OADate): double 52 4 CRS string length: uint32_t 56 n CRS string (null-terminated) 56+n 4 Node count: uint32_t ... ... Per-node: [uint32 name_len, char name[], double depth, double head, double volume] Link count: uint32_t Per-link: [uint32 name_len, char name[], double flow, double depth, double volume] Subcatch count: uint32_t Per-subcatch V2: [uint32 name_len, char name[], double runoff, double gwater, uint32_t infil_model, double infil[6], double gw_theta, double gw_lower_depth] EOF-4 4 CRC32 of all preceding bytes: uint32_t

V15 keeps the compatible record blocks and appends a complete accepted engine-session checkpoint. It is used for qualified thermal and 2D restarts so water, clocks, thermal stores, and accepted exchange receipts restore together. V15 files restore only into the matching initialized model through SWMMEngine.

Threading

HotStartFile instances are not thread-safe. The C API wraps each handle with a raw pointer cast; callers are responsible for not sharing handles across threads.

See also
include/openswmm/engine/openswmm_hotstart.h — C API
Legacy reference: src/solver/hotstart.c — swmm_saveHotstart()
Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License
Apache-2.0