OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
TransportPolicy.hpp File Reference

The Domain × Species-class transport contract (OPT plan §5, E2). More...

#include <string>
#include <vector>
Include dependency graph for TransportPolicy.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  openswmm::transport::Cell
 
struct  openswmm::transport::ClassEnables
 Allocation-free class enables for one domain — what the engines size from. n_msx is the reactions component's species count when MSX is on for the domain; msx_has_wall tells ARD / 2D that the component declares WALL species (their own fallback / warning). More...
 
struct  openswmm::transport::RowLayout
 
struct  openswmm::transport::Matrix
 

Namespaces

namespace  openswmm
 
namespace  openswmm::transport
 

Enumerations

enum class  openswmm::transport::Domain : int {
  openswmm::transport::RUNOFF = 0 ,
  openswmm::transport::GROUNDWATER = 1 ,
  openswmm::transport::NETWORK_1D = 2 ,
  openswmm::transport::SURFACE_2D = 3 ,
  openswmm::transport::COUNT = 4
}
 Rows of the matrix. Values are the C API's SWMM_TRANSPORT_DOMAIN_* codes. More...
 
enum class  openswmm::transport::SpeciesClass : int {
  openswmm::transport::POLLUTANTS = 0 ,
  openswmm::transport::MSX = 1 ,
  openswmm::transport::AGE = 2 ,
  openswmm::transport::TEMPERATURE = 3 ,
  openswmm::transport::COUNT = 4
}
 Columns of the matrix. Values are the C API's SWMM_TRANSPORT_CLASS_* codes. More...
 
enum class  openswmm::transport::CellState : int {
  openswmm::transport::ENABLED = 0 ,
  openswmm::transport::DISABLED_BY_USER = 1 ,
  openswmm::transport::UNAVAILABLE = 2
}
 One cell's state. Values are the C API's SWMM_TRANSPORT_* state codes. More...
 

Functions

ClassEnables openswmm::transport::network1DEnables (const SimulationContext &ctx) noexcept
 1D network enables: LEGACY / ARD / LARD all size from this.
 
ClassEnables openswmm::transport::surface2DEnables (const SimulationContext &ctx) noexcept
 
RowLayout openswmm::transport::canonicalRows (const SimulationContext &ctx, const ClassEnables &e)
 
Matrix openswmm::transport::resolve (const SimulationContext &ctx)
 Build the full matrix (states + reasons). Pure: never writes warnings.
 
const char * openswmm::transport::domainName (Domain d) noexcept
 
const char * openswmm::transport::speciesClassName (SpeciesClass c) noexcept
 
const char * openswmm::transport::cellStateName (CellState s) noexcept
 
std::string openswmm::transport::formatReportBlock (const Matrix &m)
 

Detailed Description

The Domain × Species-class transport contract (OPT plan §5, E2).

One function decides which species classes run in which domain and why. Before E2 the answer was re-derived in three places — ArdEngine::init, the LARD rowLayout() and the 2D SurfaceRouter2D::initialize row block — and no surface (API or report) could explain "why is there no 2D quality". Now:

  • network1DEnables() / surface2DEnables() are the allocation- free class enables the engines size from (LARD calls its layout per step, so this path must stay cheap).
  • resolve() builds the full matrix with states and reasons for the C API (swmm_get_transport_matrix), the .rpt header and the GUI hub.

Row ORDER stays where it is: ARD and 2D carry pollutants, MSX, age, temperature (the SpeciesRegistry order); LARD keeps its pollutants, age, temperature, MSX order for the bit-inertness argument recorded on SpeciesRowLayout. E2 unifies the ENABLE decision, not the index arithmetic — flipping LARD's order is a separate, corpus-gated change.

Policy (OPT plan §5.1): inherit-on. A class enabled at project level runs in every domain whose solver carries it; per-domain opt-outs exist only where a key does (2D: TRANSPORT_*; 1D: IGNORE_QUALITY; runoff/GW/LID have none). Groundwater has no transported quality (legacy parity) and reports UNAVAILABLE with the seam-column explanation rather than staying silent.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n Apache-2.0