![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
The central, reentrant simulation context for the new engine. More...
#include "../data/GageData.hpp"#include "../data/LinkData.hpp"#include "../data/NameIndex.hpp"#include "../data/NodeData.hpp"#include "../data/PollutantData.hpp"#include "../data/SubcatchData.hpp"#include "../data/TableData.hpp"#include "SimulationOptions.hpp"#include "SpatialFrame.hpp"#include "UserFlags.hpp"#include "../data/QualityData.hpp"#include "../data/InflowData.hpp"#include "../data/InfraData.hpp"#include "../data/HydrologyData.hpp"#include "../data/ForcingData.hpp"#include <algorithm>#include <cstdint>#include <string>#include <vector>Go to the source code of this file.
Classes | |
| struct | openswmm::PluginSpec |
| One plugin entry from the [PLUGINS] section. More... | |
| struct | openswmm::SimulationContext |
| Central, reentrant simulation context. More... | |
| struct | openswmm::SimulationContext::MassBalance |
| Cumulative mass balance totals for runoff and routing. More... | |
| struct | openswmm::SimulationContext::RoutingStepStats |
Namespaces | |
| namespace | openswmm |
Enumerations | |
| enum class | openswmm::EngineState : int32_t { openswmm::EngineState::CREATED = 0 , openswmm::EngineState::OPENED = 1 , openswmm::EngineState::INITIALIZED = 2 , openswmm::EngineState::RUNNING = 3 , openswmm::EngineState::PAUSED = 4 , openswmm::EngineState::ENDED = 5 , openswmm::EngineState::REPORTED = 6 , openswmm::EngineState::CLOSED = 7 , openswmm::EngineState::ERROR_STATE = 8 , openswmm::EngineState::BUILDING = 9 } |
| High-level engine lifecycle state. More... | |
The central, reentrant simulation context for the new engine.
SimulationContext is the single owner of all simulation state. It replaces the ~70 global variables in src/solver/globals.h with a value type that is thread-safe (one context per thread) and trivially clonable for parallel runs.
| Legacy (globals.h) | New location |
|---|---|
FlowUnits, RouteModel, … | ctx.options (SimulationOptions) |
StartDate, EndDate, ElapsedTime, … | ctx.current_time, ctx.options.* |
Node[], Nnodes[] | ctx.nodes (NodeData) + ctx.node_names (NameIndex) |
Link[], Nlinks[] | ctx.links (LinkData) + ctx.link_names (NameIndex) |
Subcatch[], Nsubcatch | ctx.subcatches (SubcatchData) + ctx.subcatch_names |
Gage[], Ngages | ctx.gages (GageData) + ctx.gage_names |
Pollut[], Npolluts + quality state | ctx.pollutants (PollutantData) |
Tseries[] / Curve[] | ctx.tables (TableData) + ctx.table_names |
Coord[] | ctx.spatial (SpatialFrame) |
| — (new) | ctx.user_flags (UserFlags) |
A SimulationContext must not be shared between threads without external synchronization. The IO thread receives a deep copy (SimulationSnapshot) posted through the ring queue — not a pointer to the live context.