![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Functions | |
| const char * | typeToken (NodeCoupling2DType t) noexcept |
| Borrow the canonical coupling-type token. | |
| bool | parseType (std::string_view token, NodeCoupling2DType &out) |
| Parse a complete case-insensitive coupling-type token. | |
| const char * | keyToken (NodeCoupling2DKey k) noexcept |
| Borrow the canonical optional-parameter key. | |
| bool | parseKey (std::string_view token, NodeCoupling2DKey &out) |
| Parse a complete coupling-parameter key token. | |
| std::string | parseValue (NodeCoupling2DKey k, const std::string &token, double &out) |
| Parse and range-check one coupling parameter in authored units. | |
| std::string | formatValue (NodeCoupling2DKey k, double v) |
| Format a stored parameter using categorical names or a round-trip numeric token. | |
| bool | keyAllowed (NodeCoupling2DType t, NodeCoupling2DKey k) noexcept |
| Check parameter-family applicability for a coupling type. | |
| NodeCoupling2DType | defaultType (const SimulationContext &ctx, int node) |
| Select an unauthored node coupling type from its class/flags. | |
| NodeCoupling2DType | effectiveType (const SimulationContext &ctx, int node) |
| Read an authored coupling type or fall back to class defaults. | |
| std::string | checkType (const SimulationContext &ctx, int node, NodeCoupling2DType t) |
| Check basic coupling-type compatibility with one node class. | |
| void | readSection (SimulationContext &ctx, const std::vector< std::string > &lines) |
| Parse and append validated sparse NODE TYPE KEY=VALUE authoring rows. | |
| std::string | formatParams (const SimulationContext &ctx, int r) |
| Format authored non-NaN parameters in enum write order. | |
| std::string | formatRow (const SimulationContext &ctx, int r) |
| Format one sparse node-coupling section row without a newline. | |
| std::string openswmm::nodecoupling2d::checkType | ( | const SimulationContext & | ctx, |
| int | node, | ||
| NodeCoupling2DType | t ) |
Check basic coupling-type compatibility with one node class.
Does not apply virtual/inlet default policy as a prohibition or validate mesh-map/topology/exchange parameters.
| [in] | ctx | Borrowed aligned model context; caller prevents concurrent structural edits. |
| [in] | node | Caller-validated existing node index; no bounds guard in this helper. |
| [in] | t | Valid coupling-type enum; no independent enum-bound check. |
| NodeCoupling2DType openswmm::nodecoupling2d::defaultType | ( | const SimulationContext & | ctx, |
| int | node ) |
Select an unauthored node coupling type from its class/flags.
| [in] | ctx | Borrowed aligned model context; caller prevents concurrent structural edits. |
| [in] | node | Caller-validated existing node index; no bounds guard in this helper. |
| NodeCoupling2DType openswmm::nodecoupling2d::effectiveType | ( | const SimulationContext & | ctx, |
| int | node ) |
Read an authored coupling type or fall back to class defaults.
Does not revalidate a stored type against current node class or parameter rows.
| [in] | ctx | Borrowed aligned model context; caller prevents concurrent structural edits. |
| [in] | node | Caller-validated existing node index; no bounds guard in this helper. |
| std::string openswmm::nodecoupling2d::formatParams | ( | const SimulationContext & | ctx, |
| int | r ) |
Format authored non-NaN parameters in enum write order.
Uses formatValue() representability preconditions and performs no type applicability revalidation.
| [in] | ctx | Borrowed aligned model context; caller prevents concurrent structural edits. |
| [in] | r | Existing sparse coupling-row index; caller validates all column alignment. |
| std::string openswmm::nodecoupling2d::formatRow | ( | const SimulationContext & | ctx, |
| int | r ) |
Format one sparse node-coupling section row without a newline.
NODE/TYPE head is formatted through a 96-byte fixed buffer, so a sufficiently long node name is truncated. Parameter text is appended afterward without that limit.
| [in] | ctx | Borrowed aligned model context; caller prevents concurrent structural edits. |
| [in] | r | Existing sparse row with a valid referenced node and format-compatible parameter values. |
| std::string openswmm::nodecoupling2d::formatValue | ( | NodeCoupling2DKey | k, |
| double | v ) |
Format a stored parameter using categorical names or a round-trip numeric token.
Numeric form tries precisions 6..17 until strtod reproduces v; no unit conversion or locale-independent decimal forcing.
| [in] | k | Valid NodeCoupling2DKey excluding COUNT unless a fallback is explicitly described. |
| [in] | v | Stored value; must be finite and int-representable because the implementation casts before selecting even the numeric branch. Categorical values should be integral ordinals. |
|
noexcept |
Check parameter-family applicability for a coupling type.
Does not validate enum bounds or node class; caller uses parseType/parseKey/checkType first.
| [in] | t | Valid coupling type. |
| [in] | k | Valid NodeCoupling2DKey excluding COUNT unless a fallback is explicitly described. |
|
noexcept |
Borrow the canonical optional-parameter key.
| [in] | k | Valid NodeCoupling2DKey excluding COUNT unless a fallback is explicitly described. |
| bool openswmm::nodecoupling2d::parseKey | ( | std::string_view | token, |
| NodeCoupling2DKey & | out ) |
Parse a complete coupling-parameter key token.
| [in] | token | Borrowed untrimmed token; comparison uses tokenizer locale uppercase. |
| [out] | out | Assigned only for a recognized key, preserved otherwise. |
| bool openswmm::nodecoupling2d::parseType | ( | std::string_view | token, |
| NodeCoupling2DType & | out ) |
Parse a complete case-insensitive coupling-type token.
| [in] | token | Borrowed token, uppercased with Tokenizer C-locale rules; not trimmed. |
| [out] | out | Assigned only on successful token lookup; preserved on refusal. |
| std::string openswmm::nodecoupling2d::parseValue | ( | NodeCoupling2DKey | k, |
| const std::string & | token, | ||
| double & | out ) |
Parse and range-check one coupling parameter in authored units.
Length/area values remain project length/square-length units, TAILWATER_RELAX seconds, opening fraction dimensionless. Opening fraction requires (0,1], SPREAD/TAILWATER_RELAX >=0, other numeric values >0. Key/type applicability is checked separately by keyAllowed().
| [in] | k | Valid NodeCoupling2DKey excluding COUNT unless a fallback is explicitly described. |
| [in] | token | Borrowed value text. CREST/COEFFS/LAW use categorical tokens; numeric keys require complete finite strtod syntax. |
| [out] | out | Receives numeric value or categorical ordinal as double. Numeric failures may modify it before refusal; categorical lookup refusal preserves it. |
| void openswmm::nodecoupling2d::readSection | ( | SimulationContext & | ctx, |
| const std::vector< std::string > & | lines ) |
Parse and append validated sparse NODE TYPE KEY=VALUE authoring rows.
Checks node existence/type, duplicate node rows, key syntax/applicability/uniqueness and values before appending that row. Unknown nodes defer for one later replay. No engine lifecycle guard, mesh allocation or automatic exchange-map update. Allocation failures can interrupt parallel-column appends.
| [in,out] | ctx | Owned context: appends accepted rows, errors and unresolved-node deferred rows; does not clear earlier rows. |
| [in] | lines | Borrowed section strings tokenized synchronously; comment/blank-only rows are skipped. |
|
noexcept |
Borrow the canonical coupling-type token.
| [in] | t | Coupling type enum; out-of-range values use NONE fallback. |