OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm_snow2d.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2
11
12#ifndef OPENSWMM_SNOW2D_H
13#define OPENSWMM_SNOW2D_H
14#include "openswmm_snow.h"
15#ifdef __cplusplus
16extern "C" {
17#endif
18// Shared named packs; all overrides are SI, slope/aspect in degrees.
19// Priority: whole mesh (*), tag, cell. NONE explicitly disables a cell/tag.
20// Cell keys in section text are 1-based, as in the other 2D input sections.
31 double* step_s); // 0 AUTO, 1 YES, 2 NO; 0 step inherits
46// Section 0 options, 1 defaults, 2 cells. Required capacity includes the
47// terminal NUL. Query with buffer=NULL and capacity=0 to obtain that size.
62SWMM_ENGINE_API int swmm_snow2d_get_configuration(SWMM_Engine engine, int section, char* buffer,
63 int capacity, int* required);
64typedef struct SWMM_MeshSnowOverrides {
65 // NaN means inherited. Slope/aspect are either both set or both inherited.
68// Section 1 defaults (cell=-1, tag=* or region); section 2 cells (zero-based
69// cell, empty tag). Reads do not resolve/invent inherited parameter values.
88SWMM_ENGINE_API int swmm_snow2d_get_row(SWMM_Engine engine, int section, int row, int* cell,
89 char* tag, int tag_capacity, char* pack, int pack_capacity,
96// Bulk snapshots in mesh cell order. Unassigned cells have model DEFAULT
97// and NaN quantities, distinguishing unavailable results from a bare pack.
111SWMM_ENGINE_API int swmm_snow2d_get_states(SWMM_Engine engine, int first, int count,
112 SWMM_SnowState* output);
125SWMM_ENGINE_API int swmm_snow2d_get_ledgers(SWMM_Engine engine, int first, int count,
126 SWMM_MeshSnowLedger* output);
127// UEB cover/depth remapping energy [kJ]. Non-UEB and unassigned cells return NaN.
138SWMM_ENGINE_API int swmm_snow2d_get_geometry_energy(SWMM_Engine engine, int first, int count,
139 double* energy_kj);
140// Atomic replacement through the same strict parsers as the INP reader.
141// Empty section bodies clear that section. No section headers are supplied.
157SWMM_ENGINE_API int swmm_snow2d_apply_configuration(SWMM_Engine engine, const char* options,
158 const char* defaults, const char* cells,
159 char* diagnostic, int capacity);
160#ifdef __cplusplus
161}
162#endif
163#endif
#define SWMM_ENGINE_API
Definition openswmm_2d.h:62
void * SWMM_Engine
Opaque handle to an OpenSWMM Engine instance.
Definition openswmm_callbacks.h:55
SWMM_ENGINE_API int swmm_snow2d_get_ledgers(SWMM_Engine engine, int first, int count, SWMM_MeshSnowLedger *output)
Snapshot a contiguous range of accepted mesh-snow ledgers.
Definition openswmm_snow_impl.cpp:771
SWMM_ENGINE_API int swmm_snow2d_get_states(SWMM_Engine engine, int first, int count, SWMM_SnowState *output)
Snapshot a contiguous range of accepted mesh-snow states.
Definition openswmm_snow_impl.cpp:733
SWMM_ENGINE_API int swmm_snow2d_defaults_count(SWMM_Engine engine)
Count authored mesh-snow default/tag rows.
Definition openswmm_snow_impl.cpp:622
SWMM_ENGINE_API int swmm_snow2d_get_configuration(SWMM_Engine engine, int section, char *buffer, int capacity, int *required)
Serialize one mesh-snow section body and report its required capacity.
Definition openswmm_snow_impl.cpp:632
SWMM_ENGINE_API int swmm_snow2d_get_geometry_energy(SWMM_Engine engine, int first, int count, double *energy_kj)
Read accumulated UEB geometry-remapping energy for a cell range.
Definition openswmm_snow_impl.cpp:818
SWMM_ENGINE_API int swmm_snow2d_cells_count(SWMM_Engine engine)
Count authored mesh-snow explicit cell rows.
Definition openswmm_snow_impl.cpp:627
SWMM_ENGINE_API int swmm_snow2d_get_row(SWMM_Engine engine, int section, int row, int *cell, char *tag, int tag_capacity, char *pack, int pack_capacity, SWMM_MeshSnowOverrides *values)
Read an authored mesh-snow assignment without resolving inherited overrides.
Definition openswmm_snow_impl.cpp:697
SWMM_ENGINE_API int swmm_snow2d_apply_configuration(SWMM_Engine engine, const char *options, const char *defaults, const char *cells, char *diagnostic, int capacity)
Validate and atomically replace all mesh-snow authored section bodies.
Definition openswmm_snow_impl.cpp:650
SWMM_ENGINE_API int swmm_snow2d_get_options(SWMM_Engine engine, int *mode, double *step_s)
Read mesh snow enable mode and authored cadence.
Definition openswmm_snow_impl.cpp:613
Public C API for snow packs, meteorology, and snow model configuration.
Definition openswmm_snow2d.h:91
double stored_energy_kj
Definition openswmm_snow2d.h:94
double initial_energy_kj
Definition openswmm_snow2d.h:93
double stored_m3
Definition openswmm_snow2d.h:93
double precipitation_m3
Definition openswmm_snow2d.h:92
double energy_residual_kj
Definition openswmm_snow2d.h:94
double raw_precipitation_m3
Definition openswmm_snow2d.h:92
double liquid_m3
Definition openswmm_snow2d.h:92
double completed_s
Definition openswmm_snow2d.h:92
double initial_m3
Definition openswmm_snow2d.h:92
double residual_m3
Definition openswmm_snow2d.h:93
double sublimation_m3
Definition openswmm_snow2d.h:93
double net_energy_kj
Definition openswmm_snow2d.h:93
Definition openswmm_snow2d.h:64
double drift
Definition openswmm_snow2d.h:66
double forest
Definition openswmm_snow2d.h:66
double extinction_depth_m
Definition openswmm_snow2d.h:66
double ground_heat_wm2
Definition openswmm_snow2d.h:66
double aspect_deg
Definition openswmm_snow2d.h:66
double slope_deg
Definition openswmm_snow2d.h:66
Definition openswmm_snow.h:171