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

[2D_NODE_COUPLING]: per-node coupling type — tokens, class defaults, validation, input section and row formatting. More...

#include "../data/NodeCoupling2DData.hpp"
#include <string>
#include <string_view>
#include <vector>
Include dependency graph for NodeCoupling2D.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  openswmm
 
namespace  openswmm::nodecoupling2d
 

Functions

const char * openswmm::nodecoupling2d::typeToken (NodeCoupling2DType t) noexcept
 Borrow the canonical coupling-type token.
 
bool openswmm::nodecoupling2d::parseType (std::string_view token, NodeCoupling2DType &out)
 Parse a complete case-insensitive coupling-type token.
 
const char * openswmm::nodecoupling2d::keyToken (NodeCoupling2DKey k) noexcept
 Borrow the canonical optional-parameter key.
 
bool openswmm::nodecoupling2d::parseKey (std::string_view token, NodeCoupling2DKey &out)
 Parse a complete coupling-parameter key token.
 
std::string openswmm::nodecoupling2d::parseValue (NodeCoupling2DKey k, const std::string &token, double &out)
 Parse and range-check one coupling parameter in authored units.
 
std::string openswmm::nodecoupling2d::formatValue (NodeCoupling2DKey k, double v)
 Format a stored parameter using categorical names or a round-trip numeric token.
 
bool openswmm::nodecoupling2d::keyAllowed (NodeCoupling2DType t, NodeCoupling2DKey k) noexcept
 Check parameter-family applicability for a coupling type.
 
NodeCoupling2DType openswmm::nodecoupling2d::defaultType (const SimulationContext &ctx, int node)
 Select an unauthored node coupling type from its class/flags.
 
NodeCoupling2DType openswmm::nodecoupling2d::effectiveType (const SimulationContext &ctx, int node)
 Read an authored coupling type or fall back to class defaults.
 
std::string openswmm::nodecoupling2d::checkType (const SimulationContext &ctx, int node, NodeCoupling2DType t)
 Check basic coupling-type compatibility with one node class.
 
void openswmm::nodecoupling2d::readSection (SimulationContext &ctx, const std::vector< std::string > &lines)
 Parse and append validated sparse NODE TYPE KEY=VALUE authoring rows.
 
std::string openswmm::nodecoupling2d::formatParams (const SimulationContext &ctx, int r)
 Format authored non-NaN parameters in enum write order.
 
std::string openswmm::nodecoupling2d::formatRow (const SimulationContext &ctx, int r)
 Format one sparse node-coupling section row without a newline.
 

Detailed Description

[2D_NODE_COUPLING]: per-node coupling type — tokens, class defaults, validation, input section and row formatting.

The coupling type is a node attribute held in the model (SimulationContext::node_coupling_2d) so every editor reads and writes one value; the mesh map rows stay derived. A node without a row takes its class default: junction → MANHOLE, divider → MANHOLE, storage → OPEN, outfall → OUTFALL, inlet or virtual junction → NONE. Legal combinations: OUTFALL only on outfalls, and an outfall is OUTFALL or NONE; OPEN only on storage nodes.

See also
plans/1D2D_FINE_SCALE_COUPLING_PLAN_2026-10-19.md §5, D5/D6
Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License
Apache-2.0