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

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.
 

Function Documentation

◆ checkType()

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.

Parameters
[in]ctxBorrowed aligned model context; caller prevents concurrent structural edits.
[in]nodeCaller-validated existing node index; no bounds guard in this helper.
[in]tValid coupling-type enum; no independent enum-bound check.
Returns
Empty if compatible; otherwise owned reason: outfall must use OUTFALL/NONE, OUTFALL requires outfall and OPEN requires storage.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ defaultType()

NodeCoupling2DType openswmm::nodecoupling2d::defaultType ( const SimulationContext & ctx,
int node )

Select an unauthored node coupling type from its class/flags.

Parameters
[in]ctxBorrowed aligned model context; caller prevents concurrent structural edits.
[in]nodeCaller-validated existing node index; no bounds guard in this helper.
Returns
OUTFALL for outfall, OPEN for storage, MANHOLE for divider; junction uses NONE if inlet/virtual, MANHOLE otherwise.
Here is the caller graph for this function:

◆ effectiveType()

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.

Parameters
[in]ctxBorrowed aligned model context; caller prevents concurrent structural edits.
[in]nodeCaller-validated existing node index; no bounds guard in this helper.
Returns
Stored type from first matching sparse row, otherwise defaultType(ctx,node).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ formatParams()

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.

Parameters
[in]ctxBorrowed aligned model context; caller prevents concurrent structural edits.
[in]rExisting sparse coupling-row index; caller validates all column alignment.
Returns
Owned space-separated KEY=VALUE tokens, empty when all slots are NaN.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ formatRow()

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.

Parameters
[in]ctxBorrowed aligned model context; caller prevents concurrent structural edits.
[in]rExisting sparse row with a valid referenced node and format-compatible parameter values.
Returns
Owned NODE TYPE and optional parameter string, with trailing spaces removed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ formatValue()

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.

Parameters
[in]kValid NodeCoupling2DKey excluding COUNT unless a fallback is explicitly described.
[in]vStored value; must be finite and int-representable because the implementation casts before selecting even the numeric branch. Categorical values should be integral ordinals.
Returns
Owned categorical token or numeric g text; invalid categorical index yields empty string.
Here is the caller graph for this function:

◆ keyAllowed()

bool openswmm::nodecoupling2d::keyAllowed ( NodeCoupling2DType t,
NodeCoupling2DKey k )
noexcept

Check parameter-family applicability for a coupling type.

Does not validate enum bounds or node class; caller uses parseType/parseKey/checkType first.

Parameters
[in]tValid coupling type.
[in]kValid NodeCoupling2DKey excluding COUNT unless a fallback is explicitly described.
Returns
False for NONE; OUTFALL accepts only SPREAD/TAILWATER_RELAX; structure types accept all other valid keys.
Here is the caller graph for this function:

◆ keyToken()

const char * openswmm::nodecoupling2d::keyToken ( NodeCoupling2DKey k)
noexcept

Borrow the canonical optional-parameter key.

Parameters
[in]kValid NodeCoupling2DKey excluding COUNT unless a fallback is explicitly described.
Returns
Static token, or empty literal for out-of-range key; never free.
Here is the caller graph for this function:

◆ parseKey()

bool openswmm::nodecoupling2d::parseKey ( std::string_view token,
NodeCoupling2DKey & out )

Parse a complete coupling-parameter key token.

Parameters
[in]tokenBorrowed untrimmed token; comparison uses tokenizer locale uppercase.
[out]outAssigned only for a recognized key, preserved otherwise.
Returns
True for a configured key excluding COUNT, false otherwise.
Here is the caller graph for this function:

◆ parseType()

bool openswmm::nodecoupling2d::parseType ( std::string_view token,
NodeCoupling2DType & out )

Parse a complete case-insensitive coupling-type token.

Parameters
[in]tokenBorrowed token, uppercased with Tokenizer C-locale rules; not trimmed.
[out]outAssigned only on successful token lookup; preserved on refusal.
Returns
True for NONE/MANHOLE/GRATE/CURB/OPEN/OUTFALL, false otherwise.
Here is the caller graph for this function:

◆ parseValue()

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().

Parameters
[in]kValid NodeCoupling2DKey excluding COUNT unless a fallback is explicitly described.
[in]tokenBorrowed value text. CREST/COEFFS/LAW use categorical tokens; numeric keys require complete finite strtod syntax.
[out]outReceives numeric value or categorical ordinal as double. Numeric failures may modify it before refusal; categorical lookup refusal preserves it.
Returns
Empty diagnostic on success; owned key-specific explanation on refusal.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readSection()

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.

Parameters
[in,out]ctxOwned context: appends accepted rows, errors and unresolved-node deferred rows; does not clear earlier rows.
[in]linesBorrowed section strings tokenized synchronously; comment/blank-only rows are skipped.
Here is the call graph for this function:

◆ typeToken()

const char * openswmm::nodecoupling2d::typeToken ( NodeCoupling2DType t)
noexcept

Borrow the canonical coupling-type token.

Parameters
[in]tCoupling type enum; out-of-range values use NONE fallback.
Returns
Static NUL-terminated token; never free.
Here is the caller graph for this function: