![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
Namespaces | |
| namespace | climate |
| namespace | constants |
| namespace | controls |
| namespace | culvert |
| namespace | datetime |
| namespace | divider |
| namespace | dynwave |
| namespace | edit |
| namespace | exfil |
| namespace | fastmath |
| namespace | findroot |
| namespace | forcemain |
| namespace | gage |
| namespace | gpkg |
| namespace | groundwater |
| namespace | hydraulics |
| namespace | hydstruct |
| namespace | iface |
| namespace | infil |
| namespace | inflow |
| namespace | inlet |
| namespace | inp_writer |
| namespace | input |
| namespace | kinwave |
| namespace | landuse |
| namespace | lid |
| namespace | link |
| namespace | mathexpr |
| namespace | node |
| namespace | ode |
| namespace | outfall |
| namespace | quality |
| namespace | rdii |
| namespace | roadway |
| namespace | runoff |
| namespace | runoff_iface |
| namespace | simd |
| namespace | snow |
| namespace | street |
| namespace | toposort |
| namespace | transect |
| namespace | treatment |
| namespace | twoD |
| namespace | ucf |
| namespace | xsect |
| namespace | xsect_batch |
| namespace | xsect_tables |
Classes | |
| struct | AquiferStore |
| SoA storage for aquifer parameter sets. More... | |
| struct | BuildupData |
| class | BuiltinDefaultInputPluginInfo |
| class | BuiltinDefaultOutputPluginInfo |
| class | BuiltinDefaultReportPluginInfo |
| class | BuiltinDefaultStateIOPluginInfo |
| struct | ControlRuleStore |
| struct | CurveNumState |
| class | DefaultInputPlugin |
| Default input plugin that reads/writes SWMM .inp files. More... | |
| class | DefaultOutputPlugin |
| Default output plugin: writes SWMM 5.x compatible binary .out file. More... | |
| class | DefaultReportPlugin |
| Default report plugin: writes SWMM 5.x compatible .rpt report file. More... | |
| class | DefaultStateIOPlugin |
| Default state-IO plugin: OpenSWMM binary + legacy SWMM5 hot-start. More... | |
| struct | DiscoveredFilter |
| A FileFilter paired with the plugin id and version that emitted it. More... | |
| struct | DiscoveredPlugin |
| A plugin grouped by id with all the roles and filters it advertises. More... | |
| struct | DwfData |
| struct | ExtInflowData |
| struct | FileFilter |
| A file-format filter advertised by a plugin. More... | |
| struct | FilesSpec |
| struct | ForcingData |
| struct | GageData |
| Structure-of-Arrays storage for all rain gages. More... | |
| struct | GageSnapshot |
| Snapshot of rain gage state at an output time step. More... | |
| struct | GreenAmptState |
| struct | HortonState |
| struct | HotStartFile |
| In-memory hot start file data. More... | |
| struct | HotStartHeader |
| In-memory representation of the OPENSWMM_HS_V1 header. More... | |
| struct | HotStartLinkRecord |
| Link hydraulic state at hot-start save time. More... | |
| class | HotStartManager |
| Static utility class for hot start file operations. More... | |
| struct | HotStartNodeRecord |
| Node hydraulic state at hot-start save time. More... | |
| struct | HotstartSaveEntry |
Configuration parsed from the [FILES] section. More... | |
| struct | HotStartSubcatchRecord |
| Subcatchment state at hot-start save time. More... | |
| class | ICouplingPoint |
| Abstract coupling point between a 1D SWMM object and a 2D mesh cell. More... | |
| class | IInputPlugin |
| Interface for input file reader/writer plugins. More... | |
| struct | InletStore |
| struct | InletUsageStore |
| class | IOThread |
| Producer-consumer IO thread for writing simulation snapshots. More... | |
| class | IOutputPlugin |
| Interface for output-writing plugins. More... | |
| class | IPluginComponentInfo |
| Describes a plugin component: metadata, capabilities, and factory methods. More... | |
| class | IReportPlugin |
| Interface for report-writing plugins. More... | |
| class | IStateIOPlugin |
| Interface for state / hot-start IO plugins. More... | |
| struct | LanduseData |
| struct | LidControlStore |
| SoA storage for LID control type definitions. More... | |
| struct | LidUsageStore |
| SoA storage for LID usage assignments to subcatchments. More... | |
| struct | LinkData |
| Structure-of-Arrays storage for all links. More... | |
| struct | LinkSnapshot |
| Snapshot of link state at an output time step. More... | |
| class | NameIndex |
| Bidirectional name↔index registry for SWMM objects. More... | |
| struct | NodeData |
| Structure-of-Arrays storage for all nodes. More... | |
| struct | NodeSnapshot |
| Snapshot of node state at an output time step. More... | |
| class | OutputReader |
| Reads SWMM 5.x binary .out files produced by DefaultOutputPlugin. More... | |
| struct | PatternData |
| class | PluginFactory |
| Manages plugin discovery, loading, and lifecycle for one engine instance. More... | |
| struct | PluginSpec |
| One plugin entry from the [PLUGINS] section. More... | |
| struct | PollutantData |
| Static properties for each pollutant species. More... | |
| struct | RDIIAssignData |
| struct | RDIIDecayData |
| struct | RDIIDecayEntry |
| struct | RegistrationInfo |
| Registration information for plugin activation. More... | |
| class | Router |
| Top-level routing orchestrator. More... | |
| struct | ShapeGroup |
| SoA parameter block for all links of one cross-section shape. More... | |
| struct | SimulationContext |
| Central, reentrant simulation context. More... | |
| struct | SimulationOptions |
| All SWMM simulation options parsed from [OPTIONS] section. More... | |
| struct | SimulationSnapshot |
| Complete simulation state snapshot at one output time step. More... | |
| struct | SnowpackStore |
| SoA storage for snowpack parameter sets. More... | |
| struct | SpatialFrame |
| Spatial frame containing CRS and georeferenced coordinates. More... | |
| struct | StateAccessors |
| Solver-neutral hooks for reading and writing solver-internal state (infiltration, groundwater) at hot-start save/load time. More... | |
| struct | StreetStore |
| struct | SubcatchData |
| Structure-of-Arrays storage for all subcatchments. More... | |
| struct | SubcatchSnapshot |
| Snapshot of subcatchment state at an output time step. More... | |
| struct | Table |
| struct | TableBlock |
| A single time series or rating curve. More... | |
| struct | TableCursor |
| Bidirectional cursor tracking the last accessed index in a Table. More... | |
| struct | TableData |
| SoA collection of all time series and curves in the model. More... | |
| struct | TableValidation |
| struct | TransectStore |
| struct | TreatmentData |
| struct | UnitHydData |
| struct | UnitHydEntry |
| struct | UserFlagAssignment |
| A (object_type, object_name, flag_name) → value assignment. More... | |
| struct | UserFlagDef |
| Schema entry for a single user-defined flag. More... | |
| class | UserFlags |
| Stores the full user-flags data: schema definitions + per-object values. More... | |
| struct | WashoffData |
| struct | WriteTask |
| One item in the IOThread write queue. More... | |
| class | XSectGroups |
| Shape-grouped cross-section manager for batch computation. More... | |
| struct | XSectParams |
Typedefs | |
| using | UserFlagValue = std::variant< bool, int, double, std::string > |
| A concrete flag value assigned to a specific object. | |
| using | PluginInfoFactory = IPluginComponentInfo *(*)() |
| Typedef for the C factory function that plugin libraries must export. | |
Functions | |
| std::from_chars_result | from_chars_double (const char *first, const char *last, double &value) noexcept |
| Locale-independent parse of a double from a character range. | |
| std::string_view | error_get_template (int code) noexcept |
| Get the description template for an error code. | |
| std::string_view | warning_get_template (int code) noexcept |
| Get the description template for a warning code. | |
| std::string | format_error (int code, std::string_view name="") |
| Format an error message with object name substitution. | |
| std::string | format_error (int code, std::string_view name, std::string_view detail) |
| Format an error message with object name and additional detail. | |
| std::string | format_warning (int code, std::string_view name="") |
| Format a warning message with object name substitution. | |
| std::string | format_warning (int code, std::string_view name, std::string_view detail) |
| Format a warning with additional detail. | |
| std::string_view | cffi_error_get_template (int code) noexcept |
| Get the description for a CFFI error code (SWMM_ErrorCode). | |
| std::string_view | cffi_warning_get_template (int code) noexcept |
| Get the description for a CFFI warning code (SWMM_WarnCode). | |
| std::string | format_cffi_error (int code, std::string_view name="") |
| Format a CFFI error message. | |
| std::string | format_cffi_warning (int code, std::string_view name="") |
| Format a CFFI warning message. | |
| bool | c_to_internal_node_type (int c_type, NodeType &out_type) noexcept |
| int | internal_to_c_node_type (NodeType type) noexcept |
| bool | c_to_internal_link_type (int c_type, LinkType &out_type) noexcept |
| int | internal_to_c_link_type (LinkType type) noexcept |
| TableValidation | validate_table (Table &tbl) |
| bool | table_open_file (Table &tbl, std::size_t boundary_rows) |
| std::size_t | table_load_cache (Table &tbl, std::size_t start_row) |
| double | table_lookup_column (Table &tbl, int col_idx, double x_query) |
| double | table_step_column (Table &tbl, int col_idx, double x_query) |
| double | table_lookup_cursor (Table &tbl, double x_query) noexcept |
| Look up a value in a Table using the bidirectional cursor. | |
| double | table_tseries_lookup_cursor (Table &tbl, double x_query) noexcept |
| Time-series linear interpolation with out-of-range → 0 behaviour. | |
| double | table_step_cursor (Table &tbl, double x_query) noexcept |
| Piecewise-constant (step function) table lookup with cursor. | |
| double | table_getStorageVolume (Table &tbl, double depth) noexcept |
| Compute storage volume by trapezoidal integration of an area-vs-depth curve, matching legacy table_getStorageVolume() in table.c. | |
| double | table_getStorageDepth (Table &tbl, double volume) noexcept |
| Invert a storage area-vs-depth curve to find depth from volume. | |
| double | table_inverseLookup (const Table &tbl, double y_query) noexcept |
| Inverse lookup: given y, find corresponding x by linear interpolation. | |
| double | table_lookupEx (const Table &tbl, double x_query) noexcept |
| Linear-interpolating lookup with linear extrapolation outside bounds. | |
| double | table_intervalLookup (const Table &tbl, double x_query) noexcept |
| Step-function lookup: return y for the first x entry > x_query. | |
| double | table_getSlope (const Table &tbl, double x_query) noexcept |
| Compute the slope (dy/dx) at a given x value. | |
| double | table_getMaxY (const Table &tbl) noexcept |
| Return the maximum y value in the non-decreasing leading portion. | |
| std::vector< DiscoveredFilter > | discover_all_filters () |
| Enumerate every FileFilter advertised by every discovered plugin. | |
| std::vector< DiscoveredPlugin > | discover_plugins_by_id () |
Enumerate every discovered plugin, grouped by plugin_id. | |
| const char * | plugin_role_to_string (PluginRole role) noexcept |
| Convert a PluginRole to a stable, human-readable string. | |
| const char * | plugin_state_to_string (PluginState state) noexcept |
| Convert a PluginState to a human-readable string. | |
| bool | plugin_state_transition_valid (PluginState from, PluginState to) noexcept |
| Check whether a state transition is valid. | |
| using openswmm::PluginInfoFactory = typedef IPluginComponentInfo*(*)() |
Typedef for the C factory function that plugin libraries must export.
Every plugin shared library must export a function with this signature and the name openswmm_plugin_info. The PluginFactory looks this up via dlsym/GetProcAddress after loading the library.
Example implementation in your plugin:
| enum openswmm::CffiErrorCode : int |
| enum openswmm::CffiWarnCode : int |
|
strong |
Flow divider type.
| Enumerator | |
|---|---|
| CUTOFF | |
| OVERFLOW_DIV | Renamed from OVERFLOW to avoid macOS math.h macro collision. |
| TABULAR | |
| WEIR | |
| enum openswmm::ErrorCode : int |
|
strong |
Link flow state.
| Enumerator | |
|---|---|
| DRY | |
| UP_DRY | |
| DN_DRY | |
| SUBCRITICAL | |
| SUPERCRITICAL | |
| UP_CRITICAL | |
| DN_CRITICAL | |
|
strong |
Flow unit systems.
| Enumerator | |
|---|---|
| CFS | Cubic feet per second. |
| GPM | Gallons per minute. |
| MGD | Million gallons per day. |
| CMS | Cubic meters per second. |
| LPS | Liters per second. |
| MLD | Million liters per day. |
|
strong |
|
strong |
|
strong |
|
strong |
Infiltration methods.
| Enumerator | |
|---|---|
| HORTON | |
| MOD_HORTON | |
| GREEN_AMPT | |
| MOD_GREEN_AMPT | |
| CURVE_NUMBER | |
|
strong |
Link type codes.
| Enumerator | |
|---|---|
| CONDUIT | |
| PUMP | |
| ORIFICE | |
| WEIR | |
| OUTLET | |
|
strong |
|
strong |
Node continuity formulation for depth update.
Controls how node depths are updated in the dynamic wave solver:
Specified in [OPTIONS] as:
| Enumerator | |
|---|---|
| EXPLICIT | Classic explicit two-branch (default) |
| SEMI_IMPLICIT | Unified semi-implicit formulation. |
|
strong |
Node type codes.
| Enumerator | |
|---|---|
| JUNCTION | |
| OUTFALL | |
| DIVIDER | |
| STORAGE | |
|
strong |
Outfall boundary condition type.
| Enumerator | |
|---|---|
| FREE | |
| NORMAL | |
| FIXED | |
| TIDAL | |
| TIMESERIES | |
|
strong |
Rain data format in an external file.
|
strong |
Precipitation source type for a rain gage.
| Enumerator | |
|---|---|
| TIMESERIES | Data from an in-file [TIMESERIES]. |
| FILE_RAIN | Data from an external rain file. |
|
strong |
|
strong |
Flow routing methods.
| Enumerator | |
|---|---|
| STEADY | Steady-state (no routing) |
| KINWAVE | Kinematic wave approximation. |
| DYNWAVE | Dynamic wave (full Saint-Venant) |
|
strong |
Runoff routing methods.
| Enumerator | |
|---|---|
| NONE | |
| NL_POND | Non-linear reservoir (default) |
|
strong |
Type of data stored in a Table.
| enum openswmm::WarnCode : int |
|
strong |
Conduit cross-section shape code.
|
strong |
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
Get the description for a CFFI error code (SWMM_ErrorCode).
| code | CFFI error code (from CffiErrorCode / SWMM_ErrorCode enum). |
|
noexcept |
Get the description for a CFFI warning code (SWMM_WarnCode).
| code | CFFI warning code (from CffiWarnCode / SWMM_WarnCode enum). |
| std::vector< DiscoveredFilter > openswmm::discover_all_filters | ( | ) |
Enumerate every FileFilter advertised by every discovered plugin.
Constructs a transient PluginFactory, runs auto-discovery, then flattens IPluginComponentInfo::file_filters() across all components. The returned list preserves the order of (plugin, filter-within-plugin).
| std::vector< DiscoveredPlugin > openswmm::discover_plugins_by_id | ( | ) |
Enumerate every discovered plugin, grouped by plugin_id.
Walks discover_all_filters() and folds entries that share a plugin_id into a single DiscoveredPlugin. roles is de-duplicated. Order of plugins follows the order in which their first filter is encountered (stable across calls).
Use this when you need "what does plugin X support overall" rather than "give me every (plugin, filter) pair".
plugin_id.
|
noexcept |
Get the description template for an error code.
Returns the legacy-compatible description string with s placeholder for the object name. Returns empty string for unknown codes.
| code | Error code (from ErrorCode enum). |
| std::string openswmm::format_cffi_error | ( | int | code, |
| std::string_view | name = "" |
||
| ) |
Format a CFFI error message.
| code | CFFI error code. |
| name | Optional object name for context. |
| std::string openswmm::format_cffi_warning | ( | int | code, |
| std::string_view | name = "" |
||
| ) |
Format a CFFI warning message.
| code | CFFI warning code. |
| name | Optional object name for context. |
| std::string openswmm::format_error | ( | int | code, |
| std::string_view | name, | ||
| std::string_view | detail | ||
| ) |
Format an error message with object name and additional detail.
Produces output like: " ERROR 173: Time Series RAIN1 has its data out of sequence at 01/01/2024 02:00:00."
| code | Error code. |
| name | Object name to substitute for s. |
| detail | Additional detail appended after the template. |
| std::string openswmm::format_error | ( | int | code, |
| std::string_view | name = "" |
||
| ) |
Format an error message with object name substitution.
Produces output like: " ERROR 173: Time Series RAIN1 has its data out of sequence."
| code | Error code. |
| name | Object name to substitute for s. |
| std::string openswmm::format_warning | ( | int | code, |
| std::string_view | name, | ||
| std::string_view | detail | ||
| ) |
Format a warning with additional detail.
| std::string openswmm::format_warning | ( | int | code, |
| std::string_view | name = "" |
||
| ) |
Format a warning message with object name substitution.
| code | Warning code. |
| name | Object name to substitute for s. |
|
inlinenoexcept |
Locale-independent parse of a double from a character range.
On toolchains that support std::from_chars for doubles this forwards directly; otherwise it falls back to std::strtod via a null-terminated temporary copy.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Convert a PluginState to a human-readable string.
| state | Plugin state. |
|
inlinenoexcept |
Check whether a state transition is valid.
| from | Current state. |
| to | Target state. |
|
inlinenoexcept |
Return the maximum y value in the non-decreasing leading portion.
Matches legacy table_getMaxY() in table.c. Scans until y starts decreasing and returns the peak.
| tbl | Table to query (const). |
|
inlinenoexcept |
Compute the slope (dy/dx) at a given x value.
Matches legacy table_getSlope() in table.c. Returns the slope of the interval containing x_query. Clamped to the nearest interval at boundaries.
| tbl | Table to query (const — no cursor update). |
| x_query | The independent variable value. |
|
inlinenoexcept |
Invert a storage area-vs-depth curve to find depth from volume.
Matches legacy table_getStorageDepth() in table.c. Uses the trapezoidal volume formula to bracket the target volume, then applies a quadratic formula to solve for depth within that interval.
| tbl | Table with x = depth, y = surface area. |
| volume | Target volume. |
|
inlinenoexcept |
Compute storage volume by trapezoidal integration of an area-vs-depth curve, matching legacy table_getStorageVolume() in table.c.
| tbl | Table with x = depth, y = surface area. |
| depth | Depth to integrate to. |
|
inlinenoexcept |
Step-function lookup: return y for the first x entry > x_query.
Matches legacy table_intervalLookup() in table.c. Used for pattern time series where the value applies until the next time point. Returns y[0] if x_query < x[0], y[last] if x_query >= x[last].
| tbl | Table to look up (const — no cursor update). |
| x_query | The independent variable value. |
|
inlinenoexcept |
Inverse lookup: given y, find corresponding x by linear interpolation.
Matches legacy table_inverseLookup() in table.c. Assumes y is monotonically increasing. Clamped at boundaries.
| tbl | Table to search (y must be monotone-increasing). |
| y_query | The dependent variable value to invert. |
| std::size_t openswmm::table_load_cache | ( | Table & | tbl, |
| std::size_t | start_row | ||
| ) |
| double openswmm::table_lookup_column | ( | Table & | tbl, |
| int | col_idx, | ||
| double | x_query | ||
| ) |
|
inlinenoexcept |
Look up a value in a Table using the bidirectional cursor.
Performs linear interpolation between adjacent entries. Clamping behavior at boundaries:
The cursor is updated on each call to reflect the current position. For monotonically advancing queries (typical), this is O(1) amortized.
| tbl | Table to look up (cursor is modified in-place). |
| x_query | The independent variable value to look up. |
|
inlinenoexcept |
Linear-interpolating lookup with linear extrapolation outside bounds.
Matches legacy table_lookupEx() in table.c. Unlike table_lookup_cursor(), this extends the table using the slope of the first (below) or last (above) interval rather than clamping. Used for storage exfiltration bottom-area extrapolation.
| tbl | Table to look up (const — no cursor update). |
| x_query | The independent variable value. |
| bool openswmm::table_open_file | ( | Table & | tbl, |
| std::size_t | boundary_rows | ||
| ) |
| double openswmm::table_step_column | ( | Table & | tbl, |
| int | col_idx, | ||
| double | x_query | ||
| ) |
|
inlinenoexcept |
Piecewise-constant (step function) table lookup with cursor.
Returns y[idx] where x[idx] <= x_query < x[idx+1]. No interpolation — the value is held constant until the next table entry. This is the correct behavior for rain time series where each entry represents the value for the following interval.
| tbl | Table to look up (cursor is modified in-place). |
| x_query | The independent variable value to look up. |
|
inlinenoexcept |
Time-series linear interpolation with out-of-range → 0 behaviour.
Matches legacy table_tseriesLookup(..., extend=FALSE):
Use this for external-inflow, evaporation, and similar time series where the inflow should drop to zero once the series is exhausted.
| tbl | Table to look up (cursor is modified in-place). |
| x_query | The independent variable value (e.g. simulation date). |
| TableValidation openswmm::validate_table | ( | Table & | tbl | ) |
|
noexcept |
Get the description template for a warning code.
| code | Warning code (from WarnCode enum). |