24#ifndef OPENSWMM_ENGINE_NODE_COUPLING_2D_DATA_HPP
25#define OPENSWMM_ENGINE_NODE_COUPLING_2D_DATA_HPP
86 p.fill(std::numeric_limits<double>::quiet_NaN());
93 std::vector<NodeCoupling2DType>
type;
94 std::vector<NodeCoupling2DParams>
params;
100 int count() const noexcept {
return static_cast<int>(
node.size()); }
108 int row_of(
int node_idx)
const noexcept {
109 for (std::size_t r = 0; r <
node.size(); ++r)
110 if (
node[r] == node_idx)
111 return static_cast<int>(r);
126 const int r =
row_of(node_idx);
129 node.push_back(node_idx);
143 const auto d =
static_cast<std::ptrdiff_t
>(r);
158 const int r =
row_of(idx);
@ NONE
Definition SimulationContext.hpp:183
Definition ExchangeLaw.hpp:60
@ ORIFICE
Definition LinkData.hpp:58
@ DEFAULT
Definition HeatData.hpp:107
NodeCoupling2DLaw
LAW values (stored in the LAW parameter slot).
Definition NodeCoupling2DData.hpp:76
@ WEIR_ORIFICE
Definition NodeCoupling2DData.hpp:76
NodeCoupling2DCrest
CREST policy values (stored in the CREST parameter slot).
Definition NodeCoupling2DData.hpp:67
@ MAX
Definition NodeCoupling2DData.hpp:67
@ NODE_RIM
Definition NodeCoupling2DData.hpp:67
@ MESH_BED
Definition NodeCoupling2DData.hpp:67
@ MIN
Definition NodeCoupling2DData.hpp:67
constexpr int kNodeCoupling2DKeys
Definition NodeCoupling2DData.hpp:64
NodeCoupling2DCoeffs
COEFFS preset values (stored in the COEFFS parameter slot).
Definition NodeCoupling2DData.hpp:69
@ RUBINATO2017_LOWER
Definition NodeCoupling2DData.hpp:72
@ RUBINATO2017_UPPER
Definition NodeCoupling2DData.hpp:73
@ RUBINATO2017
Definition NodeCoupling2DData.hpp:71
std::array< double, kNodeCoupling2DKeys > NodeCoupling2DParams
Definition NodeCoupling2DData.hpp:78
NodeCoupling2DParams unsetNodeCoupling2DParams() noexcept
Create a parameter array with every slot marked unauthored.
Definition NodeCoupling2DData.hpp:84
NodeCoupling2DType
Coupling structure type of a node. NONE = not coupleable.
Definition NodeCoupling2DData.hpp:36
@ GRATE
Definition NodeCoupling2DData.hpp:39
@ OPEN
open-top storage / pond under the mesh
Definition NodeCoupling2DData.hpp:41
@ MANHOLE
Definition NodeCoupling2DData.hpp:38
@ CURB
Definition NodeCoupling2DData.hpp:40
@ OUTFALL
tailwater + discharge mechanism, not an exchange law
Definition NodeCoupling2DData.hpp:42
NodeCoupling2DKey
Optional KEY=VALUE parameters of a [2D_NODE_COUPLING] row, in write order.
Definition NodeCoupling2DData.hpp:46
@ SPREAD
outfall discharge spread radius (length)
Definition NodeCoupling2DData.hpp:59
@ CREST
crest policy (NodeCoupling2DCrest)
Definition NodeCoupling2DData.hpp:52
@ COEFFS
coefficient preset (NodeCoupling2DCoeffs)
Definition NodeCoupling2DData.hpp:53
@ COUNT
Definition NodeCoupling2DData.hpp:61
@ COI
orifice coefficient, surface → sewer
Definition NodeCoupling2DData.hpp:56
@ LAW
per-node exchange law (NodeCoupling2DLaw)
Definition NodeCoupling2DData.hpp:58
@ AREA
orifice / open area (length²)
Definition NodeCoupling2DData.hpp:49
@ PERIMETER
weir crest length (length)
Definition NodeCoupling2DData.hpp:48
@ CW
free-weir coefficient
Definition NodeCoupling2DData.hpp:54
@ COO
orifice coefficient, sewer → surface
Definition NodeCoupling2DData.hpp:57
@ CSW
submerged-weir coefficient
Definition NodeCoupling2DData.hpp:55
@ LID_OPEN_FRACTION
open share of a covered lid, (0, 1]
Definition NodeCoupling2DData.hpp:51
@ D
manhole diameter (length)
Definition NodeCoupling2DData.hpp:47
@ TAILWATER_RELAX
outfall tailwater relaxation time (s)
Definition NodeCoupling2DData.hpp:60
@ CHAMBER_AREA
1D chamber plan area above the rim (length²)
Definition NodeCoupling2DData.hpp:50
Sparse [2D_NODE_COUPLING] rows (one per authored node).
Definition NodeCoupling2DData.hpp:91
void clear()
Erase all owned sparse node-coupling rows.
Definition NodeCoupling2DData.hpp:172
std::vector< NodeCoupling2DParams > params
NaN = not authored.
Definition NodeCoupling2DData.hpp:94
int row_of(int node_idx) const noexcept
Find the first sparse row for a stored node index.
Definition NodeCoupling2DData.hpp:108
int ensure_row(int node_idx, NodeCoupling2DType t)
Reuse a sparse node row or append an unauthored one.
Definition NodeCoupling2DData.hpp:125
void erase_row(int r)
Erase a sparse row from all three columns.
Definition NodeCoupling2DData.hpp:142
std::vector< int > node
node index
Definition NodeCoupling2DData.hpp:92
void erase_node(int idx)
Remove a deleted node's first sparse row and shift higher stored node keys.
Definition NodeCoupling2DData.hpp:157
std::vector< NodeCoupling2DType > type
Definition NodeCoupling2DData.hpp:93
int count() const noexcept
Count sparse coupling rows from the node-key column.
Definition NodeCoupling2DData.hpp:100