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
 
struct  openswmm::transport::Draft
 Build the full matrix (states + reasons). Pure: never writes warnings. More...
 

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
 Resolve allocation-free native network class counts from current project policy.
 
ClassEnables openswmm::transport::surface2DEnables (const SimulationContext &ctx) noexcept
 Resolve allocation-free surface native class eligibility from project and 2D opt-outs.
 
ClassEnables openswmm::transport::groundwaterEnables (const SimulationContext &ctx) noexcept
 Resolve allocation-free canonical aquifer class eligibility for an active integrated kernel.
 
RowLayout openswmm::transport::canonicalRows (const SimulationContext &ctx, const ClassEnables &e)
 Build an owned canonical pollutant/MSX/age/temperature row layout for supplied enables.
 
Matrix openswmm::transport::resolve (const SimulationContext &ctx, const Draft *draft)
 Build a domain-by-species transport capability matrix with explicit reasons and counts.
 
const char * openswmm::transport::domainName (Domain d) noexcept
 Format a transport matrix domain as a human-readable label.
 
const char * openswmm::transport::speciesClassName (SpeciesClass c) noexcept
 Format a transport species class as a human-readable label.
 
const char * openswmm::transport::cellStateName (CellState s) noexcept
 Format a transport capability state as its canonical uppercase label.
 
std::string openswmm::transport::formatReportBlock (const Matrix &m)
 Format a capability matrix as a readable fixed-column report and unavailable explanations.
 

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 where domain keys support them. The legacy subcatchment aquifer supplies quality at the native node seam without its own transported inventories; the active integrated 2D aquifer carries enabled native rows with GW domain opt-outs.

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