OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
openswmm Namespace Reference

Namespaces

namespace  climate
 
namespace  constants
 
namespace  controls
 
namespace  culvert
 
namespace  datetime
 
namespace  divider
 
namespace  dynwave
 
namespace  exfil
 
namespace  findroot
 
namespace  forcemain
 
namespace  gage
 
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  mathexpr
 
namespace  node
 
namespace  ode
 
namespace  outfall
 
namespace  quality
 
namespace  rdii
 
namespace  roadway
 
namespace  runoff
 
namespace  simd
 
namespace  snow
 
namespace  street
 
namespace  toposort
 
namespace  transect
 
namespace  treatment
 
namespace  ucf
 
namespace  xsect
 
namespace  xsect_batch
 
namespace  xsect_tables
 

Classes

struct  AquiferStore
 SoA storage for aquifer parameter sets. More...
 
struct  BuildupData
 
struct  ControlRuleStore
 
struct  CurveNumState
 
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...
 
struct  DwfData
 
struct  ExtInflowData
 
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  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...
 
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...
 
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 all dynamically loaded plugins 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
 
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  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
 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  TransectStore
 
struct  TreatmentData
 
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.
 

Enumerations

enum class  EngineState : int32_t {
  EngineState::CREATED = 0 ,
  EngineState::OPENED = 1 ,
  EngineState::INITIALIZED = 2 ,
  EngineState::RUNNING = 3 ,
  EngineState::PAUSED = 4 ,
  EngineState::ENDED = 5 ,
  EngineState::REPORTED = 6 ,
  EngineState::CLOSED = 7 ,
  EngineState::ERROR_STATE = 8 ,
  EngineState::BUILDING = 9
}
 High-level engine lifecycle state. More...
 
enum class  FlowUnits : int {
  CFS = 0 ,
  GPM = 1 ,
  MGD = 2 ,
  CMS = 3 ,
  LPS = 4 ,
  MLD = 5
}
 Flow unit systems. More...
 
enum class  RoutingModel : int {
  STEADY = 0 ,
  KINWAVE = 1 ,
  DYNWAVE = 2
}
 Flow routing methods. More...
 
enum class  InfiltrationModel : int {
  HORTON = 0 ,
  MOD_HORTON = 1 ,
  GREEN_AMPT = 2 ,
  MOD_GREEN_AMPT = 3 ,
  CURVE_NUMBER = 4
}
 Infiltration methods. More...
 
enum class  RunoffModel : int {
  NONE = 0 ,
  NL_POND = 1
}
 Runoff routing methods. More...
 
enum class  UserFlagType : int {
  UserFlagType::BOOLEAN = 0 ,
  UserFlagType::INTEGER = 1 ,
  UserFlagType::REAL = 2 ,
  UserFlagType::STRING = 3
}
 Value type for a user flag. More...
 
enum class  ForcingMode : int8_t {
  NONE = 0 ,
  OVERRIDE = 1 ,
  ADD = 2
}
 
enum class  ForcingPersist : int8_t {
  RESET = 0 ,
  PERSIST = 1
}
 
enum class  RainSource : int8_t {
  TIMESERIES = 0 ,
  FILE_RAIN = 1
}
 Precipitation source type for a rain gage. More...
 
enum class  RainFileFormat : int8_t {
  UNKNOWN = -1 ,
  NWS_15 = 0 ,
  NWS_HOURLY = 1 ,
  DSI_3240 = 2 ,
  DSI_3260 = 3 ,
  HLY_PRCP = 4 ,
  STAN_PRCP = 5 ,
  USER_CSV = 6
}
 Rain data format in an external file. More...
 
enum class  LinkType : int8_t {
  CONDUIT = 0 ,
  PUMP = 1 ,
  ORIFICE = 2 ,
  WEIR = 3 ,
  OUTLET = 4
}
 Link type codes. More...
 
enum class  XsectShape : int16_t {
  CIRCULAR = 0 ,
  FILLED_CIRCULAR = 1 ,
  RECT_CLOSED = 2 ,
  RECT_OPEN = 3 ,
  TRAPEZOIDAL = 4 ,
  TRIANGULAR = 5 ,
  PARABOLIC = 6 ,
  POWER = 7 ,
  MODBASKETHANDLE = 8 ,
  EGGSHAPED = 9 ,
  HORSESHOE = 10 ,
  GOTHIC = 11 ,
  CATENARY = 12 ,
  SEMIELLIPTICAL = 13 ,
  BASKETHANDLE = 14 ,
  SEMICIRCULAR = 15 ,
  RECT_TRIANG = 16 ,
  RECT_ROUND = 17 ,
  IRREGULAR = 18 ,
  CUSTOM = 19 ,
  FORCE_MAIN = 20 ,
  STREET_XSECT = 21 ,
  DUMMY = 22
}
 Conduit cross-section shape code. More...
 
enum class  FlowClass : int8_t {
  DRY = 0 ,
  UP_DRY = 1 ,
  DN_DRY = 2 ,
  SUBCRITICAL = 3 ,
  SUPERCRITICAL = 4 ,
  UP_CRITICAL = 5 ,
  DN_CRITICAL = 6
}
 Link flow state. More...
 
enum class  NodeType : int8_t {
  JUNCTION = 0 ,
  OUTFALL = 1 ,
  DIVIDER = 2 ,
  STORAGE = 3
}
 Node type codes. More...
 
enum class  OutfallType : int8_t {
  FREE = 0 ,
  NORMAL = 1 ,
  FIXED = 2 ,
  TIDAL = 3 ,
  TIMESERIES = 4
}
 Outfall boundary condition type. More...
 
enum class  DividerType : int8_t {
  CUTOFF = 0 ,
  OVERFLOW_DIV = 1 ,
  TABULAR = 2 ,
  WEIR = 3
}
 Flow divider type. More...
 
enum class  MassUnits : int8_t {
  MG_PER_L = 0 ,
  UG_PER_L = 1 ,
  COUNTS_PER_L = 2
}
 Pollutant concentration units. More...
 
enum class  TableType : int {
  TIMESERIES = 0 ,
  CURVE_STORAGE = 1 ,
  CURVE_DIVERSION = 2 ,
  CURVE_RATING = 3 ,
  CURVE_SHAPE = 4 ,
  CURVE_CONTROL = 5 ,
  CURVE_TIDAL = 6 ,
  CURVE_PUMP1 = 7 ,
  CURVE_PUMP2 = 8 ,
  CURVE_PUMP3 = 9 ,
  CURVE_PUMP4 = 10
}
 Type of data stored in a Table. More...
 
enum class  RouteModel : int {
  STEADY = 0 ,
  KINWAVE = 1 ,
  DYNWAVE = 2
}
 
enum class  XSectShape : int {
  DUMMY = 0 ,
  CIRCULAR = 1 ,
  FILLED_CIRCULAR = 2 ,
  RECT_CLOSED = 3 ,
  RECT_OPEN = 4 ,
  TRAPEZOIDAL = 5 ,
  TRIANGULAR = 6 ,
  PARABOLIC = 7 ,
  POWERFUNC = 8 ,
  RECT_TRIANG = 9 ,
  RECT_ROUND = 10 ,
  MOD_BASKET = 11 ,
  HORIZ_ELLIPSE = 12 ,
  VERT_ELLIPSE = 13 ,
  ARCH = 14 ,
  EGGSHAPED = 15 ,
  HORSESHOE = 16 ,
  GOTHIC = 17 ,
  CATENARY = 18 ,
  SEMIELLIPTICAL = 19 ,
  BASKETHANDLE = 20 ,
  SEMICIRCULAR = 21 ,
  IRREGULAR = 22 ,
  CUSTOM = 23 ,
  FORCE_MAIN = 24 ,
  STREET_XSECT = 25
}
 
enum class  InfilModel : int {
  HORTON = 0 ,
  MOD_HORTON = 1 ,
  GREEN_AMPT = 2 ,
  CURVE_NUM = 3
}
 
enum class  PluginState : std::int32_t {
  PluginState::UNLOADED = 0 ,
  PluginState::LOADED = 1 ,
  PluginState::INITIALIZED = 2 ,
  PluginState::VALIDATED = 3 ,
  PluginState::PREPARED = 4 ,
  PluginState::UPDATING = 5 ,
  PluginState::FINALIZED = 6 ,
  PluginState::CLOSED = 7 ,
  PluginState::ERROR = -1
}
 Plugin lifecycle states. More...
 

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.
 
double table_lookup_cursor (Table &tbl, double x_query) noexcept
 Look up a value in a Table using the bidirectional cursor.
 
double table_step_cursor (Table &tbl, double x_query) noexcept
 Piecewise-constant (step function) table lookup with cursor.
 
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.
 

Typedef Documentation

◆ PluginInfoFactory

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:

static MyPluginComponentInfo g_info;
extern "C" openswmm::IPluginComponentInfo* openswmm_plugin_info(void) {
return &g_info;
}
Describes a plugin component: metadata, capabilities, and factory methods.
Definition IPluginComponentInfo.hpp:57

Enumeration Type Documentation

◆ DividerType

enum class openswmm::DividerType : int8_t
strong

Flow divider type.

See also
Legacy: DividerType in src/solver/enums.h
Enumerator
CUTOFF 
OVERFLOW_DIV 

Renamed from OVERFLOW to avoid macOS math.h macro collision.

TABULAR 
WEIR 

◆ FlowClass

enum class openswmm::FlowClass : int8_t
strong

Link flow state.

See also
Legacy: FlowClass in src/solver/enums.h
Enumerator
DRY 
UP_DRY 
DN_DRY 
SUBCRITICAL 
SUPERCRITICAL 
UP_CRITICAL 
DN_CRITICAL 

◆ FlowUnits

enum class openswmm::FlowUnits : int
strong

Flow unit systems.

See also
Legacy: FlowUnitsType in enums.h
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.

◆ ForcingMode

enum class openswmm::ForcingMode : int8_t
strong
Enumerator
NONE 

Use model-computed value (no forcing)

OVERRIDE 

Replace computed value with user value.

ADD 

Add user value to computed value.

◆ ForcingPersist

enum class openswmm::ForcingPersist : int8_t
strong
Enumerator
RESET 

Auto-clear after each timestep.

PERSIST 

Keep until explicitly cleared.

◆ InfilModel

enum class openswmm::InfilModel : int
strong
Enumerator
HORTON 
MOD_HORTON 

Modified Horton: linear decay fp = f0 - kd * Fe.

GREEN_AMPT 
CURVE_NUM 

◆ InfiltrationModel

enum class openswmm::InfiltrationModel : int
strong

Infiltration methods.

See also
Legacy: InfilModelType in enums.h
Enumerator
HORTON 
MOD_HORTON 
GREEN_AMPT 
MOD_GREEN_AMPT 
CURVE_NUMBER 

◆ LinkType

enum class openswmm::LinkType : int8_t
strong

Link type codes.

See also
Legacy: LinkType in src/solver/enums.h
Enumerator
CONDUIT 
PUMP 
ORIFICE 
WEIR 
OUTLET 

◆ MassUnits

enum class openswmm::MassUnits : int8_t
strong

Pollutant concentration units.

See also
Legacy: MassUnitsType in src/solver/enums.h
Enumerator
MG_PER_L 

Milligrams per liter.

UG_PER_L 

Micrograms per liter.

COUNTS_PER_L 

Counts per liter (bacteria)

◆ NodeType

enum class openswmm::NodeType : int8_t
strong

Node type codes.

See also
Legacy: NodeType in src/solver/enums.h
Enumerator
JUNCTION 
OUTFALL 
DIVIDER 
STORAGE 

◆ OutfallType

enum class openswmm::OutfallType : int8_t
strong

Outfall boundary condition type.

See also
Legacy: OutfallType in src/solver/enums.h
Enumerator
FREE 
NORMAL 
FIXED 
TIDAL 
TIMESERIES 

◆ RainFileFormat

enum class openswmm::RainFileFormat : int8_t
strong

Rain data format in an external file.

See also
Legacy: RainFileType in src/solver/enums.h
Enumerator
UNKNOWN 
NWS_15 

NWS 15-minute data.

NWS_HOURLY 

NWS hourly data.

DSI_3240 

NCDC DSI 3240 hourly.

DSI_3260 

NCDC DSI 3260 15-minute.

HLY_PRCP 

HLY_PRCP format.

STAN_PRCP 

Standard SWMM rain file.

USER_CSV 

User-supplied multi-column CSV (new in 6.0.0, R08)

◆ RainSource

enum class openswmm::RainSource : int8_t
strong

Precipitation source type for a rain gage.

See also
Legacy: RainType in src/solver/enums.h
Enumerator
TIMESERIES 

Data from an in-file [TIMESERIES].

FILE_RAIN 

Data from an external rain file.

◆ RouteModel

enum class openswmm::RouteModel : int
strong
Enumerator
STEADY 

Steady-state (pass-through)

KINWAVE 

Kinematic wave.

DYNWAVE 

Dynamic wave (St. Venant)

◆ RoutingModel

enum class openswmm::RoutingModel : int
strong

Flow routing methods.

See also
Legacy: RouteModelType in enums.h
Enumerator
STEADY 

Steady-state (no routing)

KINWAVE 

Kinematic wave approximation.

DYNWAVE 

Dynamic wave (full Saint-Venant)

◆ RunoffModel

enum class openswmm::RunoffModel : int
strong

Runoff routing methods.

See also
Legacy: RunoffModelType in enums.h
Enumerator
NONE 
NL_POND 

Non-linear reservoir (default)

◆ TableType

enum class openswmm::TableType : int
strong

Type of data stored in a Table.

See also
Legacy reference: TableType in src/solver/enums.h
Enumerator
TIMESERIES 

Rainfall, inflow, or other time-varying values.

CURVE_STORAGE 

Storage node volume-depth curve.

CURVE_DIVERSION 

Diversion rating curve.

CURVE_RATING 

Outfall/weir rating curve.

CURVE_SHAPE 

Cross-section shape curve.

CURVE_CONTROL 

Control rule action curve.

CURVE_TIDAL 

Tidal stage curve.

CURVE_PUMP1 

Pump curve type 1 (ON/OFF depth)

CURVE_PUMP2 

Pump curve type 2 (head vs flow)

CURVE_PUMP3 

Pump curve type 3 (volume vs time)

CURVE_PUMP4 

Pump curve type 4 (depth vs speed)

◆ XsectShape

enum class openswmm::XsectShape : int16_t
strong

Conduit cross-section shape code.

See also
Legacy: XsectType in src/solver/enums.h
Enumerator
CIRCULAR 
FILLED_CIRCULAR 
RECT_CLOSED 
RECT_OPEN 
TRAPEZOIDAL 
TRIANGULAR 
PARABOLIC 
POWER 
MODBASKETHANDLE 
EGGSHAPED 
HORSESHOE 
GOTHIC 
CATENARY 
SEMIELLIPTICAL 
BASKETHANDLE 
SEMICIRCULAR 
RECT_TRIANG 

Rectangular-triangular bottom.

RECT_ROUND 

Rectangular-round bottom.

IRREGULAR 

User-supplied shape curve.

CUSTOM 

Shape from CURVE_SHAPE table.

FORCE_MAIN 

Circular force main (Hazen-Williams or D-W)

STREET_XSECT 

Street cross-section.

DUMMY 

Dummy (no geometry)

◆ XSectShape

enum class openswmm::XSectShape : int
strong
Enumerator
DUMMY 
CIRCULAR 
FILLED_CIRCULAR 
RECT_CLOSED 
RECT_OPEN 
TRAPEZOIDAL 
TRIANGULAR 
PARABOLIC 
POWERFUNC 
RECT_TRIANG 
RECT_ROUND 
MOD_BASKET 
HORIZ_ELLIPSE 
VERT_ELLIPSE 
ARCH 
EGGSHAPED 
HORSESHOE 
GOTHIC 
CATENARY 
SEMIELLIPTICAL 
BASKETHANDLE 
SEMICIRCULAR 
IRREGULAR 
CUSTOM 
FORCE_MAIN 
STREET_XSECT 

Function Documentation

◆ from_chars_double()

std::from_chars_result openswmm::from_chars_double ( const char *  first,
const char *  last,
double &  value 
)
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.

Here is the caller graph for this function:

◆ plugin_state_to_string()

const char * openswmm::plugin_state_to_string ( PluginState  state)
inlinenoexcept

Convert a PluginState to a human-readable string.

Parameters
statePlugin state.
Returns
Static null-terminated string (never NULL).

◆ plugin_state_transition_valid()

bool openswmm::plugin_state_transition_valid ( PluginState  from,
PluginState  to 
)
inlinenoexcept

Check whether a state transition is valid.

Parameters
fromCurrent state.
toTarget state.
Returns
true if the transition is allowed.

◆ table_lookup_cursor()

double openswmm::table_lookup_cursor ( Table tbl,
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:

  • x_query < x[0]: returns y[0]
  • x_query > x[last]: returns y[last]
  • Otherwise: linear interpolation between bracketing entries

The cursor is updated on each call to reflect the current position. For monotonically advancing queries (typical), this is O(1) amortized.

Parameters
tblTable to look up (cursor is modified in-place).
x_queryThe independent variable value to look up.
Returns
Interpolated y value.
Note
NOT thread-safe — do not call from multiple threads on the same Table without external synchronization (each thread should own its cursor copy).
See also
Legacy reference: src/solver/table.c — table_lookup()
Here is the caller graph for this function:

◆ table_step_cursor()

double openswmm::table_step_cursor ( Table tbl,
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.

Parameters
tblTable to look up (cursor is modified in-place).
x_queryThe independent variable value to look up.
Returns
Step-function y value (no interpolation).
See also
Legacy reference: gage.cgage_setState() uses step-function logic
Here is the caller graph for this function: