![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
Classes | |
| class | InputReader |
| Reads and parses a SWMM .inp file into a SimulationContext. More... | |
| class | SectionRegistry |
| Registry that maps section tags (e.g., "[JUNCTIONS]") to handlers. More... | |
| class | Tokenizer |
| Stateless multi-delimiter tokenizer for SWMM input lines. More... | |
Typedefs | |
| using | SectionHandler = std::function< void(SimulationContext &, const std::vector< std::string > &)> |
| Handler function type for input file sections. | |
Functions | |
| void | handle_subcatchments (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [SUBCATCHMENTS] into SubcatchData + subcatch_names. | |
| void | handle_subareas (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [SUBAREAS] — Manning's n + depression storage for each subcatch. | |
| void | handle_infiltration (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [INFILTRATION] — Horton/Green-Ampt/CN params per subcatch. | |
| void | handle_raingages (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [RAINGAGES] into GageData + gage_names. | |
| void | handle_controls (SimulationContext &ctx, const std::vector< std::string > &lines) |
| void | handle_report (SimulationContext &ctx, const std::vector< std::string > &lines) |
| void | handle_evaporation (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [EVAPORATION] into SimulationOptions evap fields. | |
| void | handle_temperature (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [TEMPERATURE] into SimulationOptions temperature/wind/snow fields. | |
| void | handle_snowpacks (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [SNOWPACKS] into SnowpackStore + snowpack_names. | |
| void | handle_aquifers (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [AQUIFERS] into AquiferStore + aquifer_names. | |
| void | handle_groundwater (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [GROUNDWATER] — link subcatchments to aquifers and nodes. | |
| void | handle_gwf (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [GWF] — custom groundwater flow expressions (stored as raw text). | |
| void | handle_lid_controls (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [LID_CONTROLS] into LidControlStore + lid_names. | |
| void | handle_lid_usage (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [LID_USAGE] into LidUsageStore. | |
| void | handle_patterns (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [PATTERNS] into PatternData with continuation-line support. | |
| void | handle_inflows (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [INFLOWS] into ExtInflowData. | |
| void | handle_dwf (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [DWF] into DwfData. | |
| void | handle_rdii (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [RDII] into RDIIAssignData. | |
| void | handle_conduits (SimulationContext &ctx, const std::vector< std::string > &lines) |
| void | handle_pumps (SimulationContext &ctx, const std::vector< std::string > &lines) |
| void | handle_orifices (SimulationContext &ctx, const std::vector< std::string > &lines) |
| void | handle_weirs (SimulationContext &ctx, const std::vector< std::string > &lines) |
| void | handle_outlets (SimulationContext &ctx, const std::vector< std::string > &lines) |
| void | handle_xsections (SimulationContext &ctx, const std::vector< std::string > &lines) |
| void | handle_losses (SimulationContext &ctx, const std::vector< std::string > &lines) |
| void | handle_transects (SimulationContext &ctx, const std::vector< std::string > &lines) |
| void | handle_junctions (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [JUNCTIONS] into NodeData + node_names. | |
| void | handle_outfalls (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [OUTFALLS] — sets outfall-specific fields for nodes of type OUTFALL. | |
| void | handle_dividers (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [DIVIDERS] — sets divider-specific fields. | |
| void | handle_storage (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [STORAGE] — adds storage nodes and their geometry. | |
| void | handle_coordinates (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [COORDINATES] — fills spatial.node_x / node_y. | |
| void | handle_options (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse the [OPTIONS] section into ctx.options. | |
| void | handle_plugins (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [PLUGINS] into ctx.plugin_specs. | |
| void | handle_pollutants (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [POLLUTANTS] into PollutantData + pollutant_names. | |
| void | handle_landuses (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [LANDUSES] into LanduseData + landuse_names. | |
| void | handle_coverages (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [COVERAGES] — land use coverage fractions per subcatchment. | |
| void | handle_buildup (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [BUILDUP] — buildup functions per (landuse x pollutant). | |
| void | handle_washoff (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [WASHOFF] — washoff functions per (landuse x pollutant). | |
| void | handle_treatment (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [TREATMENT] — treatment expressions per (node x pollutant). | |
| void | handle_loadings (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [LOADINGS] — initial pollutant buildup on subcatchments. | |
| void | handle_timeseries (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [TIMESERIES] into TableData + table_names. | |
| void | handle_curves (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [CURVES] into TableData + table_names. | |
| void | handle_user_flags (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [USER_FLAGS] into ctx.user_flags. | |
| void | handle_user_flag_values (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse [USER_FLAG_VALUES] into ctx.user_flags (per-object values). | |
| void | resolve_cross_references (SimulationContext &ctx) |
| Resolve all cross-references in ctx after all sections are parsed. | |
| using openswmm::input::SectionHandler = typedef std::function<void( SimulationContext&, const std::vector<std::string>& )> |
Handler function type for input file sections.
Called once per section with all non-comment, non-empty lines in that section. The handler is responsible for parsing each line and populating the SimulationContext.
| ctx | Simulation context to populate. |
| lines | All non-blank, non-comment lines in the section (after comment stripping but before tokenization). |
| void openswmm::input::handle_aquifers | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [AQUIFERS] into AquiferStore + aquifer_names.
| void openswmm::input::handle_buildup | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [BUILDUP] — buildup functions per (landuse x pollutant).
| void openswmm::input::handle_conduits | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
| void openswmm::input::handle_controls | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
| void openswmm::input::handle_coordinates | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [COORDINATES] — fills spatial.node_x / node_y.
| void openswmm::input::handle_coverages | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [COVERAGES] — land use coverage fractions per subcatchment.
| void openswmm::input::handle_curves | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
| void openswmm::input::handle_dividers | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [DIVIDERS] — sets divider-specific fields.
| void openswmm::input::handle_dwf | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
| void openswmm::input::handle_evaporation | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [EVAPORATION] into SimulationOptions evap fields.
| void openswmm::input::handle_groundwater | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [GROUNDWATER] — link subcatchments to aquifers and nodes.
| void openswmm::input::handle_gwf | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [GWF] — custom groundwater flow expressions (stored as raw text).
| void openswmm::input::handle_infiltration | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [INFILTRATION] — Horton/Green-Ampt/CN params per subcatch.
| void openswmm::input::handle_inflows | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
| void openswmm::input::handle_junctions | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
| void openswmm::input::handle_landuses | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
| void openswmm::input::handle_lid_controls | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [LID_CONTROLS] into LidControlStore + lid_names.
| void openswmm::input::handle_lid_usage | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [LID_USAGE] into LidUsageStore.
| void openswmm::input::handle_loadings | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [LOADINGS] — initial pollutant buildup on subcatchments.
| void openswmm::input::handle_losses | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
| void openswmm::input::handle_options | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse the [OPTIONS] section into ctx.options.
Built-in handler registered in SWMMEngine::register_builtin_handlers(). Unknown keys are stored in ctx.options.ext_options (R05). The CRS key also populates ctx.spatial.crs (R06).
| ctx | Simulation context to populate. |
| lines | Non-blank, comment-stripped lines from the [OPTIONS] section. |
| void openswmm::input::handle_orifices | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
| void openswmm::input::handle_outfalls | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [OUTFALLS] — sets outfall-specific fields for nodes of type OUTFALL.
| void openswmm::input::handle_outlets | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
| void openswmm::input::handle_patterns | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [PATTERNS] into PatternData with continuation-line support.
| void openswmm::input::handle_plugins | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [PLUGINS] into ctx.plugin_specs.
| void openswmm::input::handle_pollutants | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
| void openswmm::input::handle_pumps | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
| void openswmm::input::handle_raingages | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
| void openswmm::input::handle_rdii | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
| void openswmm::input::handle_report | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
| void openswmm::input::handle_snowpacks | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [SNOWPACKS] into SnowpackStore + snowpack_names.
| void openswmm::input::handle_storage | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [STORAGE] — adds storage nodes and their geometry.
| void openswmm::input::handle_subareas | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [SUBAREAS] — Manning's n + depression storage for each subcatch.
| void openswmm::input::handle_subcatchments | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
| void openswmm::input::handle_temperature | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [TEMPERATURE] into SimulationOptions temperature/wind/snow fields.
| void openswmm::input::handle_timeseries | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
| void openswmm::input::handle_transects | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
| void openswmm::input::handle_treatment | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [TREATMENT] — treatment expressions per (node x pollutant).
| void openswmm::input::handle_user_flag_values | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [USER_FLAG_VALUES] into ctx.user_flags (per-object values).
| void openswmm::input::handle_user_flags | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
| void openswmm::input::handle_washoff | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
Parse [WASHOFF] — washoff functions per (landuse x pollutant).
| void openswmm::input::handle_weirs | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
| void openswmm::input::handle_xsections | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines | ||
| ) |
| void openswmm::input::resolve_cross_references | ( | SimulationContext & | ctx | ) |
Resolve all cross-references in ctx after all sections are parsed.
This is a best-effort pass: references that still can't be resolved after the full file is read are left as -1 and a warning is stored in ctx.warning_code.
| ctx | Simulation context (mutated in place). |