OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
openswmm_hotstart.h
Go to the documentation of this file.
1
58#ifndef OPENSWMM_ENGINE_HOTSTART_H
59#define OPENSWMM_ENGINE_HOTSTART_H
60
61#include "openswmm_engine.h"
62
63#ifdef __cplusplus
64extern "C" {
65#endif
66
68typedef void* SWMM_HotStart;
69
71#define OPENSWMM_HOTSTART_MAGIC "OPENSWMM_HS_V1\0"
72
74#define OPENSWMM_HOTSTART_VERSION 1
75
76/* =========================================================================
77 * Create / save
78 * ========================================================================= */
79
94SWMM_ENGINE_API int swmm_hotstart_save(SWMM_Engine engine, const char* path);
95
96/* =========================================================================
97 * Open / read
98 * ========================================================================= */
99
110SWMM_ENGINE_API int swmm_hotstart_open(const char* path, SWMM_HotStart* hs);
111
112/* =========================================================================
113 * Apply
114 * ========================================================================= */
115
134
135/* =========================================================================
136 * Modify hot start data
137 * ========================================================================= */
138
151 SWMM_HotStart hs,
152 const char* node_id,
153 double depth
154);
155
164 SWMM_HotStart hs,
165 const char* node_id,
166 double head
167);
168
177 SWMM_HotStart hs,
178 const char* link_id,
179 double flow
180);
181
190 SWMM_HotStart hs,
191 const char* link_id,
192 double depth
193);
194
203 SWMM_HotStart hs,
204 const char* subcatch_id,
205 double runoff
206);
207
208/* =========================================================================
209 * Query hot start metadata
210 * ========================================================================= */
211
219
227SWMM_ENGINE_API int swmm_hotstart_get_crs(SWMM_HotStart hs, char* buf, int buflen);
228
235
242
243/* =========================================================================
244 * Warning access (populated after swmm_hotstart_apply())
245 * ========================================================================= */
246
257
265SWMM_ENGINE_API const char* swmm_hotstart_warning(SWMM_HotStart hs, int index);
266
267/* =========================================================================
268 * Close
269 * ========================================================================= */
270
281
282#ifdef __cplusplus
283} /* extern "C" */
284#endif
285
286#endif /* OPENSWMM_ENGINE_HOTSTART_H */
void * SWMM_Engine
Opaque handle to an OpenSWMM Engine instance.
Definition openswmm_callbacks.h:35
OpenSWMM Engine — primary transparent C API (master header).
#define SWMM_ENGINE_API
Definition openswmm_engine.h:87
SWMM_ENGINE_API int swmm_hotstart_set_node_depth(SWMM_HotStart hs, const char *node_id, double depth)
Modify the stored depth for a node in the hot start file.
Definition openswmm_hotstart_impl.cpp:135
SWMM_ENGINE_API int swmm_hotstart_set_link_flow(SWMM_HotStart hs, const char *link_id, double flow)
Modify the stored flow for a link.
Definition openswmm_hotstart_impl.cpp:153
SWMM_ENGINE_API int swmm_hotstart_set_subcatch_runoff(SWMM_HotStart hs, const char *subcatch_id, double runoff)
Modify the stored runoff for a subcatchment.
Definition openswmm_hotstart_impl.cpp:171
SWMM_ENGINE_API int swmm_hotstart_set_link_depth(SWMM_HotStart hs, const char *link_id, double depth)
Modify the stored depth for a link.
Definition openswmm_hotstart_impl.cpp:162
SWMM_ENGINE_API int swmm_hotstart_set_node_head(SWMM_HotStart hs, const char *node_id, double head)
Modify the stored head for a node.
Definition openswmm_hotstart_impl.cpp:144
SWMM_ENGINE_API int swmm_hotstart_warning_count(SWMM_HotStart hs)
Get the number of warnings generated by the last swmm_hotstart_apply().
Definition openswmm_hotstart_impl.cpp:216
SWMM_ENGINE_API int swmm_hotstart_close(SWMM_HotStart hs)
Close and free the hot start handle.
Definition openswmm_hotstart_impl.cpp:232
SWMM_ENGINE_API int swmm_hotstart_save(SWMM_Engine engine, const char *path)
Save the current engine state to a new hot start file.
Definition openswmm_hotstart_impl.cpp:58
void * SWMM_HotStart
Opaque handle to an open hot start file.
Definition openswmm_hotstart.h:68
SWMM_ENGINE_API int swmm_hotstart_open(const char *path, SWMM_HotStart *hs)
Open an existing hot start file for reading.
Definition openswmm_hotstart_impl.cpp:85
SWMM_ENGINE_API int swmm_hotstart_link_count(SWMM_HotStart hs)
Get the number of links stored in the hot start file.
Definition openswmm_hotstart_impl.cpp:207
SWMM_ENGINE_API const char * swmm_hotstart_warning(SWMM_HotStart hs, int index)
Get the i-th warning message from the last swmm_hotstart_apply().
Definition openswmm_hotstart_impl.cpp:221
SWMM_ENGINE_API int swmm_hotstart_node_count(SWMM_HotStart hs)
Get the number of nodes stored in the hot start file.
Definition openswmm_hotstart_impl.cpp:202
SWMM_ENGINE_API int swmm_hotstart_get_sim_time(SWMM_HotStart hs, double *sim_time)
Get the simulation timestamp stored in the hot start file.
Definition openswmm_hotstart_impl.cpp:184
SWMM_ENGINE_API int swmm_hotstart_get_crs(SWMM_HotStart hs, char *buf, int buflen)
Get the CRS string stored in the hot start file.
Definition openswmm_hotstart_impl.cpp:191
SWMM_ENGINE_API int swmm_hotstart_apply(SWMM_Engine engine, SWMM_HotStart hs)
Apply hot start state to an engine.
Definition openswmm_hotstart_impl.cpp:101