OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
LinkSubtypes.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2//
3// Copyright 2026 Caleb Buahin
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16
54
55#ifndef OPENSWMM_ENGINE_LINK_SUBTYPES_HPP
56#define OPENSWMM_ENGINE_LINK_SUBTYPES_HPP
57
58#include <algorithm>
59#include <vector>
60#include <cstdint>
61#include <string>
62#include <type_traits>
63
64#include "LinkData.hpp"
65
66namespace openswmm {
67
68// ============================================================================
69// ConduitData — side-table for CONDUIT links
70// ============================================================================
71
80 std::vector<int> link_idx;
81
82 std::vector<double> roughness;
83 std::vector<double> length;
89 std::vector<double> true_length;
90 std::vector<double> slope;
91 std::vector<double> mod_length;
92 std::vector<int> barrels;
93 std::vector<double> beta;
94 std::vector<double> rough_factor;
95 std::vector<double> q_full;
96 std::vector<double> q_max;
97 std::vector<double> loss_inlet;
98 std::vector<double> loss_outlet;
99 std::vector<double> loss_avg;
100 std::vector<double> seep_rate;
101 std::vector<int> culvert_code;
102
103 // Phase 6 Stage B: mutable per-step conduit state moved off wide LinkData.
104 std::vector<double> evap_loss_rate;
105 std::vector<double> seep_loss_rate;
106 std::vector<uint8_t> normal_flow_limited;
107 std::vector<uint8_t> inlet_control;
108 std::vector<int8_t> full_state;
109
110 // G-X4 (2026-09-20): the two-zone aquifer's frozen coupling for this
111 // routing step, published by SurfaceRouter2D before routing and read by
112 // the two loss laws (DynamicWave and routing::computeConduitLosses).
113 // `gw_coupled == 0` on every conduit of every deck without a
114 // `[2D_AQUIFER]` + `LINK_SEEPAGE TWO_WAY`, and the laws then take their
115 // legacy branch unchanged.
116 std::vector<uint8_t> gw_coupled;
117 std::vector<double>
119 std::vector<double> gw_kc;
120 std::vector<double>
122 std::vector<double>
124
129 int count() const noexcept { return static_cast<int>(link_idx.size()); }
130
137 void clear() noexcept {
138 link_idx.clear();
139 roughness.clear();
140 length.clear();
141 true_length.clear();
142 slope.clear();
143 mod_length.clear();
144 barrels.clear();
145 beta.clear();
146 rough_factor.clear();
147 q_full.clear();
148 q_max.clear();
149 loss_inlet.clear();
150 loss_outlet.clear();
151 loss_avg.clear();
152 seep_rate.clear();
153 culvert_code.clear();
154 evap_loss_rate.clear();
155 seep_loss_rate.clear();
156 normal_flow_limited.clear();
157 inlet_control.clear();
158 full_state.clear();
159 gw_coupled.clear();
160 gw_head_rel.clear();
161 gw_kc.clear(); // G-X4
162 gw_dc.clear();
163 gw_gain_max.clear();
164 }
165
174 void reserve(int n) {
175 const auto un = static_cast<std::size_t>(n);
176 link_idx.reserve(un);
177 roughness.reserve(un);
178 length.reserve(un);
179 true_length.reserve(un);
180 slope.reserve(un);
181 mod_length.reserve(un);
182 barrels.reserve(un);
183 beta.reserve(un);
184 rough_factor.reserve(un);
185 q_full.reserve(un);
186 q_max.reserve(un);
187 loss_inlet.reserve(un);
188 loss_outlet.reserve(un);
189 loss_avg.reserve(un);
190 seep_rate.reserve(un);
191 culvert_code.reserve(un);
192 evap_loss_rate.reserve(un);
193 seep_loss_rate.reserve(un);
194 normal_flow_limited.reserve(un);
195 inlet_control.reserve(un);
196 full_state.reserve(un);
197 gw_coupled.reserve(un);
198 gw_head_rel.reserve(un);
199 gw_kc.reserve(un); // G-X4
200 gw_dc.reserve(un);
201 gw_gain_max.reserve(un);
202 }
203
216 int add_default(int i) {
217 const auto p = static_cast<std::ptrdiff_t>(
218 std::lower_bound(link_idx.begin(), link_idx.end(), i) - link_idx.begin());
219 link_idx.insert(link_idx.begin() + p, i);
220 roughness.insert(roughness.begin() + p, 0.01);
221 length.insert(length.begin() + p, 0.0);
222 true_length.insert(true_length.begin() + p, 0.0);
223 slope.insert(slope.begin() + p, 0.0);
224 mod_length.insert(mod_length.begin() + p, 0.0);
225 barrels.insert(barrels.begin() + p, 1);
226 beta.insert(beta.begin() + p, 0.0);
227 rough_factor.insert(rough_factor.begin() + p, 0.0);
228 q_full.insert(q_full.begin() + p, 0.0);
229 q_max.insert(q_max.begin() + p, 0.0);
230 loss_inlet.insert(loss_inlet.begin() + p, 0.0);
231 loss_outlet.insert(loss_outlet.begin() + p, 0.0);
232 loss_avg.insert(loss_avg.begin() + p, 0.0);
233 seep_rate.insert(seep_rate.begin() + p, 0.0);
234 culvert_code.insert(culvert_code.begin() + p, 0);
235 evap_loss_rate.insert(evap_loss_rate.begin() + p, 0.0);
236 seep_loss_rate.insert(seep_loss_rate.begin() + p, 0.0);
237 normal_flow_limited.insert(normal_flow_limited.begin() + p, uint8_t{0});
238 inlet_control.insert(inlet_control.begin() + p, uint8_t{0});
239 full_state.insert(full_state.begin() + p, int8_t{0});
240 gw_coupled.insert(gw_coupled.begin() + p, uint8_t{0}); // G-X4
241 gw_head_rel.insert(gw_head_rel.begin() + p, 0.0);
242 gw_kc.insert(gw_kc.begin() + p, 0.0);
243 gw_dc.insert(gw_dc.begin() + p, 0.0);
244 gw_gain_max.insert(gw_gain_max.begin() + p, 0.0);
245 return static_cast<int>(p);
246 }
247
258 void erase_at(int r) {
259 const auto p = static_cast<std::ptrdiff_t>(r);
260 link_idx.erase(link_idx.begin() + p);
261 roughness.erase(roughness.begin() + p);
262 length.erase(length.begin() + p);
263 true_length.erase(true_length.begin() + p);
264 slope.erase(slope.begin() + p);
265 mod_length.erase(mod_length.begin() + p);
266 barrels.erase(barrels.begin() + p);
267 beta.erase(beta.begin() + p);
268 rough_factor.erase(rough_factor.begin() + p);
269 q_full.erase(q_full.begin() + p);
270 q_max.erase(q_max.begin() + p);
271 loss_inlet.erase(loss_inlet.begin() + p);
272 loss_outlet.erase(loss_outlet.begin() + p);
273 loss_avg.erase(loss_avg.begin() + p);
274 seep_rate.erase(seep_rate.begin() + p);
275 culvert_code.erase(culvert_code.begin() + p);
276 evap_loss_rate.erase(evap_loss_rate.begin() + p);
277 seep_loss_rate.erase(seep_loss_rate.begin() + p);
278 normal_flow_limited.erase(normal_flow_limited.begin() + p);
279 inlet_control.erase(inlet_control.begin() + p);
280 full_state.erase(full_state.begin() + p);
281 }
282};
283
284// ============================================================================
285// PumpData — side-table for PUMP links
286// ============================================================================
287
288struct PumpData {
289 std::vector<int> link_idx;
290 std::vector<int> curve;
291 std::vector<uint8_t> init_state;
292 std::vector<double> startup;
293 std::vector<double> shutoff;
294 std::vector<int> curve_type;
295
300 int count() const noexcept { return static_cast<int>(link_idx.size()); }
301
308 void clear() noexcept {
309 link_idx.clear();
310 curve.clear();
311 init_state.clear();
312 startup.clear();
313 shutoff.clear();
314 curve_type.clear();
315 }
316
325 void reserve(int n) {
326 const auto un = static_cast<std::size_t>(n);
327 link_idx.reserve(un);
328 curve.reserve(un);
329 init_state.reserve(un);
330 startup.reserve(un);
331 shutoff.reserve(un);
332 curve_type.reserve(un);
333 }
334
347 int add_default(int i) {
348 const auto p = static_cast<std::ptrdiff_t>(
349 std::lower_bound(link_idx.begin(), link_idx.end(), i) - link_idx.begin());
350 link_idx.insert(link_idx.begin() + p, i);
351 curve.insert(curve.begin() + p, -1);
352 init_state.insert(init_state.begin() + p, uint8_t{0});
353 startup.insert(startup.begin() + p, 0.0);
354 shutoff.insert(shutoff.begin() + p, 0.0);
355 curve_type.insert(curve_type.begin() + p, -1);
356 return static_cast<int>(p);
357 }
358
368 void erase_at(int r) {
369 const auto p = static_cast<std::ptrdiff_t>(r);
370 link_idx.erase(link_idx.begin() + p);
371 curve.erase(curve.begin() + p);
372 init_state.erase(init_state.begin() + p);
373 startup.erase(startup.begin() + p);
374 shutoff.erase(shutoff.begin() + p);
375 curve_type.erase(curve_type.begin() + p);
376 }
377};
378
379// ============================================================================
380// OrificeData — side-table for ORIFICE links (wide param1 → orifice_type)
381// ============================================================================
382
384 std::vector<int> link_idx;
385 std::vector<double> orifice_type;
386 std::vector<double> cd;
387 std::vector<double> orate;
392 int count() const noexcept { return static_cast<int>(link_idx.size()); }
393
400 void clear() noexcept {
401 link_idx.clear();
402 orifice_type.clear();
403 cd.clear();
404 orate.clear();
405 }
406
414 void reserve(int n) {
415 const auto un = static_cast<std::size_t>(n);
416 link_idx.reserve(un);
417 orifice_type.reserve(un);
418 cd.reserve(un);
419 orate.reserve(un);
420 }
421
432 int add_default(int i) {
433 const auto p = static_cast<std::ptrdiff_t>(
434 std::lower_bound(link_idx.begin(), link_idx.end(), i) - link_idx.begin());
435 link_idx.insert(link_idx.begin() + p, i);
436 orifice_type.insert(orifice_type.begin() + p, 0.0);
437 cd.insert(cd.begin() + p, 0.0);
438 orate.insert(orate.begin() + p, 0.0);
439 return static_cast<int>(p);
440 }
441
450 void erase_at(int r) {
451 const auto p = static_cast<std::ptrdiff_t>(r);
452 link_idx.erase(link_idx.begin() + p);
453 orifice_type.erase(orifice_type.begin() + p);
454 cd.erase(cd.begin() + p);
455 orate.erase(orate.begin() + p);
456 }
457};
458
459// ============================================================================
460// WeirData — side-table for WEIR links (param1 → weir_type, param2 → end_con)
461// ============================================================================
462
463struct WeirData {
464 std::vector<int> link_idx;
465 std::vector<double>
467 std::vector<double> cd;
468 std::vector<double> end_contractions;
469 std::vector<double> crest_height;
470 std::vector<double> cd2;
471 std::vector<uint8_t>
473 std::vector<double>
475 std::vector<int8_t>
477 std::vector<int>
479
484 int count() const noexcept { return static_cast<int>(link_idx.size()); }
485
492 void clear() noexcept {
493 link_idx.clear();
494 weir_type.clear();
495 cd.clear();
496 end_contractions.clear();
497 crest_height.clear();
498 cd2.clear();
499 can_surcharge.clear();
500 road_width.clear();
501 road_surface.clear();
502 cd_curve.clear();
503 }
504
512 void reserve(int n) {
513 const auto un = static_cast<std::size_t>(n);
514 link_idx.reserve(un);
515 weir_type.reserve(un);
516 cd.reserve(un);
517 end_contractions.reserve(un);
518 crest_height.reserve(un);
519 cd2.reserve(un);
520 can_surcharge.reserve(un);
521 road_width.reserve(un);
522 road_surface.reserve(un);
523 cd_curve.reserve(un);
524 }
525
537 int add_default(int i) {
538 const auto p = static_cast<std::ptrdiff_t>(
539 std::lower_bound(link_idx.begin(), link_idx.end(), i) - link_idx.begin());
540 link_idx.insert(link_idx.begin() + p, i);
541 weir_type.insert(weir_type.begin() + p, 0.0);
542 cd.insert(cd.begin() + p, 0.0);
543 end_contractions.insert(end_contractions.begin() + p, 0.0);
544 crest_height.insert(crest_height.begin() + p, 0.0);
545 cd2.insert(cd2.begin() + p, 0.0);
546 can_surcharge.insert(can_surcharge.begin() + p, uint8_t{1});
547 road_width.insert(road_width.begin() + p, 0.0);
548 road_surface.insert(road_surface.begin() + p, int8_t{0});
549 cd_curve.insert(cd_curve.begin() + p, -1);
550 return static_cast<int>(p);
551 }
552
561 void erase_at(int r) {
562 const auto p = static_cast<std::ptrdiff_t>(r);
563 link_idx.erase(link_idx.begin() + p);
564 weir_type.erase(weir_type.begin() + p);
565 cd.erase(cd.begin() + p);
566 end_contractions.erase(end_contractions.begin() + p);
567 crest_height.erase(crest_height.begin() + p);
568 cd2.erase(cd2.begin() + p);
569 can_surcharge.erase(can_surcharge.begin() + p);
570 road_width.erase(road_width.begin() + p);
571 road_surface.erase(road_surface.begin() + p);
572 cd_curve.erase(cd_curve.begin() + p);
573 }
574};
575
576// ============================================================================
577// OutletData — side-table for OUTLET links
578// param1 → outlet_type (rating: 0 FUNC/HEAD,1 FUNC/DEPTH,2 TAB/HEAD,3 TAB/DEPTH)
579// cd → coeff (functional C1), param2 → expon (functional C2)
580// ============================================================================
581
583 std::vector<int> link_idx;
584 std::vector<double> outlet_type;
585 std::vector<double> crest_height;
586 std::vector<double> coeff;
587 std::vector<double> expon;
588 std::vector<int>
590
595 int count() const noexcept { return static_cast<int>(link_idx.size()); }
596
603 void clear() noexcept {
604 link_idx.clear();
605 outlet_type.clear();
606 crest_height.clear();
607 coeff.clear();
608 expon.clear();
609 curve.clear();
610 }
611
619 void reserve(int n) {
620 const auto un = static_cast<std::size_t>(n);
621 link_idx.reserve(un);
622 outlet_type.reserve(un);
623 crest_height.reserve(un);
624 coeff.reserve(un);
625 expon.reserve(un);
626 curve.reserve(un);
627 }
628
640 int add_default(int i) {
641 const auto p = static_cast<std::ptrdiff_t>(
642 std::lower_bound(link_idx.begin(), link_idx.end(), i) - link_idx.begin());
643 link_idx.insert(link_idx.begin() + p, i);
644 outlet_type.insert(outlet_type.begin() + p, 0.0);
645 crest_height.insert(crest_height.begin() + p, 0.0);
646 coeff.insert(coeff.begin() + p, 0.0);
647 expon.insert(expon.begin() + p, 0.0);
648 curve.insert(curve.begin() + p, -1);
649 return static_cast<int>(p);
650 }
651
660 void erase_at(int r) {
661 const auto p = static_cast<std::ptrdiff_t>(r);
662 link_idx.erase(link_idx.begin() + p);
663 outlet_type.erase(outlet_type.begin() + p);
664 crest_height.erase(crest_height.begin() + p);
665 coeff.erase(coeff.begin() + p);
666 expon.erase(expon.begin() + p);
667 curve.erase(curve.begin() + p);
668 }
669};
670
671// ============================================================================
672// LinkSubtypes — container + reverse map + incremental maintenance
673// ============================================================================
674
687
689 std::vector<int> subtype_row;
690
701 clear();
702 const int n = L.count();
703 for (int i = 0; i < n; ++i) {
704 switch (L.type[static_cast<std::size_t>(i)]) {
706 conduits.add_default(i);
707 break;
708 case LinkType::PUMP:
709 pumps.add_default(i);
710 break;
712 orifices.add_default(i);
713 break;
714 case LinkType::WEIR:
715 weirs.add_default(i);
716 break;
717 case LinkType::OUTLET:
718 outlets.add_default(i);
719 break;
720 }
721 }
722 rebuild_index(n);
723 }
724
731 void clear() noexcept {
732 conduits.clear();
733 pumps.clear();
734 orifices.clear();
735 weirs.clear();
736 outlets.clear();
737 subtype_row.clear();
738 }
739
750 void rebuild_index(int n_links) {
751 subtype_row.assign(static_cast<std::size_t>(n_links), -1);
752 auto idx = [&](const std::vector<int>& keys) {
753 for (int r = 0; r < static_cast<int>(keys.size()); ++r)
754 subtype_row[static_cast<std::size_t>(keys[static_cast<std::size_t>(r)])] = r;
755 };
756 idx(conduits.link_idx);
757 idx(pumps.link_idx);
758 idx(orifices.link_idx);
759 idx(weirs.link_idx);
760 idx(outlets.link_idx);
761 }
762
778 int set_link_type(LinkData& links, int i, LinkType t) {
779 const auto ui = static_cast<std::size_t>(i);
780 if (i >= static_cast<int>(subtype_row.size()))
781 subtype_row.resize(static_cast<std::size_t>(i) + 1, -1);
782
783 const LinkType old = links.type[ui];
784 const int existing = subtype_row[ui];
785 if (old == t && existing >= 0)
786 return existing; // already this subtype with a row — idempotent
787
788 bool shifted = false;
789 if (existing >= 0) { // remove the old subtype row (real re-type/convert)
790 switch (old) {
792 conduits.erase_at(existing);
793 break;
794 case LinkType::PUMP:
795 pumps.erase_at(existing);
796 break;
798 orifices.erase_at(existing);
799 break;
800 case LinkType::WEIR:
801 weirs.erase_at(existing);
802 break;
803 case LinkType::OUTLET:
804 outlets.erase_at(existing);
805 break;
806 }
807 shifted = true;
808 }
809
810 links.type[ui] = t;
811
812 int row = -1;
813 switch (t) {
815 row = conduits.add_default(i);
816 if (row != conduits.count() - 1)
817 shifted = true;
818 break;
819 case LinkType::PUMP:
820 row = pumps.add_default(i);
821 if (row != pumps.count() - 1)
822 shifted = true;
823 break;
825 row = orifices.add_default(i);
826 if (row != orifices.count() - 1)
827 shifted = true;
828 break;
829 case LinkType::WEIR:
830 row = weirs.add_default(i);
831 if (row != weirs.count() - 1)
832 shifted = true;
833 break;
834 case LinkType::OUTLET:
835 row = outlets.add_default(i);
836 if (row != outlets.count() - 1)
837 shifted = true;
838 break;
839 }
840
841 if (shifted) {
842 rebuild_index(links.count());
843 return subtype_row[ui];
844 }
845 subtype_row[ui] = row; // O(1) ascending-parse / end-insert path
846 return row;
847 }
848
859 void erase_link(int i, int n_after) {
860 auto drop = [i](auto& tbl) -> bool {
861 for (int r = 0; r < tbl.count(); ++r)
862 if (tbl.link_idx[static_cast<std::size_t>(r)] == i) {
863 tbl.erase_at(r);
864 return true;
865 }
866 return false;
867 };
868 drop(conduits) || drop(pumps) || drop(orifices) || drop(weirs) || drop(outlets);
869
870 auto shift = [i](std::vector<int>& keys) {
871 for (auto& k : keys)
872 if (k > i)
873 --k;
874 };
875 shift(conduits.link_idx);
876 shift(pumps.link_idx);
877 shift(orifices.link_idx);
878 shift(weirs.link_idx);
879 shift(outlets.link_idx);
880
881 rebuild_index(n_after);
882 }
883
884 // O(1) row helpers (validate link_idx[r] == i, like NodeSubtypes::*_row).
895 int conduit_row(int i) const noexcept { return row_in(i, conduits.link_idx); }
906 int pump_row(int i) const noexcept { return row_in(i, pumps.link_idx); }
917 int orifice_row(int i) const noexcept { return row_in(i, orifices.link_idx); }
928 int weir_row(int i) const noexcept { return row_in(i, weirs.link_idx); }
939 int outlet_row(int i) const noexcept { return row_in(i, outlets.link_idx); }
940
941private:
949 int row_in(int i, const std::vector<int>& keys) const noexcept {
950 if (i >= 0 && i < static_cast<int>(subtype_row.size())) {
951 const int r = subtype_row[static_cast<std::size_t>(i)];
952 if (r >= 0 && r < static_cast<int>(keys.size()) &&
953 keys[static_cast<std::size_t>(r)] == i)
954 return r;
955 }
956 return -1;
957 }
958};
959
960} // namespace openswmm
961
962#endif // OPENSWMM_ENGINE_LINK_SUBTYPES_HPP
Definition ExchangeLaw.hpp:60
LinkType
Link type codes.
Definition LinkData.hpp:58
@ CONDUIT
Definition LinkData.hpp:58
@ PUMP
Definition LinkData.hpp:58
@ WEIR
Definition LinkData.hpp:58
@ ORIFICE
Definition LinkData.hpp:58
@ OUTLET
Definition LinkData.hpp:58
Dense SoA for conduit-only properties (one row per CONDUIT link).
Definition LinkSubtypes.hpp:79
std::vector< int > link_idx
Base LinkData index (join key)
Definition LinkSubtypes.hpp:80
int add_default(int i)
Insert a default ConduitData row at the sorted base-object key position.
Definition LinkSubtypes.hpp:216
void erase_at(int r)
Erase dense ConduitData row data and shift later dense rows down.
Definition LinkSubtypes.hpp:258
void clear() noexcept
Erase all ConduitData rows while retaining vector capacities.
Definition LinkSubtypes.hpp:137
std::vector< double > gw_dc
bed thickness / characteristic path (project length); seeded from the full depth
Definition LinkSubtypes.hpp:121
std::vector< double > evap_loss_rate
per-step evaporation loss
Definition LinkSubtypes.hpp:104
std::vector< double > beta
Definition LinkSubtypes.hpp:93
std::vector< double > roughness
Definition LinkSubtypes.hpp:82
std::vector< int > culvert_code
Definition LinkSubtypes.hpp:101
std::vector< double > rough_factor
Definition LinkSubtypes.hpp:94
std::vector< double > q_full
Definition LinkSubtypes.hpp:95
std::vector< double > mod_length
Definition LinkSubtypes.hpp:91
std::vector< uint8_t > gw_coupled
1 = signed conductance law applies
Definition LinkSubtypes.hpp:116
int count() const noexcept
Count ConduitData rows from the base-object join-key column.
Definition LinkSubtypes.hpp:129
std::vector< int8_t > full_state
per-step up/down full bitmask
Definition LinkSubtypes.hpp:108
std::vector< double > loss_outlet
Definition LinkSubtypes.hpp:98
std::vector< double > true_length
Definition LinkSubtypes.hpp:89
std::vector< int > barrels
Definition LinkSubtypes.hpp:92
std::vector< double > loss_avg
Definition LinkSubtypes.hpp:99
std::vector< double > q_max
Definition LinkSubtypes.hpp:96
void reserve(int n)
Request capacity for each ConduitData column without changing row count.
Definition LinkSubtypes.hpp:174
std::vector< double > loss_inlet
Definition LinkSubtypes.hpp:97
std::vector< double > seep_loss_rate
per-step seepage loss
Definition LinkSubtypes.hpp:105
std::vector< uint8_t > normal_flow_limited
per-step flag (reset each step)
Definition LinkSubtypes.hpp:106
std::vector< double > slope
Definition LinkSubtypes.hpp:90
std::vector< double > length
Definition LinkSubtypes.hpp:83
std::vector< double > seep_rate
Definition LinkSubtypes.hpp:100
std::vector< double > gw_kc
bed conductivity (project rate units); seeded from seep_rate
Definition LinkSubtypes.hpp:119
std::vector< double > gw_head_rel
water-table elevation MINUS the conduit's mid invert (project length)
Definition LinkSubtypes.hpp:118
std::vector< double > gw_gain_max
cap on the gaining direction, ONE barrel (project flow units)
Definition LinkSubtypes.hpp:123
std::vector< uint8_t > inlet_control
per-step culvert inlet-control flag
Definition LinkSubtypes.hpp:107
Definition LinkSubtypes.hpp:383
void reserve(int n)
Request capacity for each OrificeData column without changing row count.
Definition LinkSubtypes.hpp:414
std::vector< double > orate
Open/close time in HOURS, as parsed.
Definition LinkSubtypes.hpp:387
void erase_at(int r)
Erase dense OrificeData row data and shift later dense rows down.
Definition LinkSubtypes.hpp:450
int count() const noexcept
Count OrificeData rows from the base-object join-key column.
Definition LinkSubtypes.hpp:392
std::vector< int > link_idx
Definition LinkSubtypes.hpp:384
std::vector< double > orifice_type
0 = BOTTOM, 1 = SIDE (legacy param1)
Definition LinkSubtypes.hpp:385
void clear() noexcept
Erase all OrificeData rows while retaining vector capacities.
Definition LinkSubtypes.hpp:400
int add_default(int i)
Insert a default OrificeData row at the sorted base-object key position.
Definition LinkSubtypes.hpp:432
std::vector< double > cd
Discharge coefficient.
Definition LinkSubtypes.hpp:386
Definition LinkSubtypes.hpp:582
std::vector< double > crest_height
Offset/crest.
Definition LinkSubtypes.hpp:585
int count() const noexcept
Count OutletData rows from the base-object join-key column.
Definition LinkSubtypes.hpp:595
std::vector< int > link_idx
Definition LinkSubtypes.hpp:583
void erase_at(int r)
Erase dense OutletData row data and shift later dense rows down.
Definition LinkSubtypes.hpp:660
void reserve(int n)
Request capacity for each OutletData column without changing row count.
Definition LinkSubtypes.hpp:619
std::vector< double > expon
Functional C2 exponent (legacy param2)
Definition LinkSubtypes.hpp:587
std::vector< double > outlet_type
Rating type (legacy param1)
Definition LinkSubtypes.hpp:584
std::vector< double > coeff
Functional C1 (legacy cd)
Definition LinkSubtypes.hpp:586
void clear() noexcept
Erase all OutletData rows while retaining vector capacities.
Definition LinkSubtypes.hpp:603
int add_default(int i)
Insert a default OutletData row at the sorted base-object key position.
Definition LinkSubtypes.hpp:640
std::vector< int > curve
TABULAR rating-curve index (legacy pump_curve reuse; -1 = functional)
Definition LinkSubtypes.hpp:589
Definition LinkSubtypes.hpp:288
void reserve(int n)
Request capacity for each PumpData column without changing row count.
Definition LinkSubtypes.hpp:325
std::vector< int > curve_type
Pump curve type (1-5, 6=ideal; -1 unset)
Definition LinkSubtypes.hpp:294
std::vector< uint8_t > init_state
Initial on/off (was vector<bool>)
Definition LinkSubtypes.hpp:291
void erase_at(int r)
Erase dense PumpData row data and shift later dense rows down.
Definition LinkSubtypes.hpp:368
std::vector< double > shutoff
Shutoff depth.
Definition LinkSubtypes.hpp:293
std::vector< double > startup
Startup depth.
Definition LinkSubtypes.hpp:292
std::vector< int > link_idx
Definition LinkSubtypes.hpp:289
int add_default(int i)
Insert a default PumpData row at the sorted base-object key position.
Definition LinkSubtypes.hpp:347
int count() const noexcept
Count PumpData rows from the base-object join-key column.
Definition LinkSubtypes.hpp:300
void clear() noexcept
Erase all PumpData rows while retaining vector capacities.
Definition LinkSubtypes.hpp:308
std::vector< int > curve
Pump curve table index (-1 = ideal)
Definition LinkSubtypes.hpp:290
Definition LinkSubtypes.hpp:463
void reserve(int n)
Request capacity for each WeirData column without changing row count.
Definition LinkSubtypes.hpp:512
void clear() noexcept
Erase all WeirData rows while retaining vector capacities.
Definition LinkSubtypes.hpp:492
std::vector< double > crest_height
Definition LinkSubtypes.hpp:469
std::vector< double > road_width
ROADWAY weir: road width across the flow (legacy Weir.roadWidth; authored length units until the reso...
Definition LinkSubtypes.hpp:474
std::vector< int > cd_curve
Discharge-coefficient curve index in ctx.tables, -1 none (legacy Weir.cdCurve)
Definition LinkSubtypes.hpp:478
void erase_at(int r)
Erase dense WeirData row data and shift later dense rows down.
Definition LinkSubtypes.hpp:561
std::vector< double > cd2
End-section discharge coeff (legacy cDisch2)
Definition LinkSubtypes.hpp:470
std::vector< uint8_t > can_surcharge
Surcharge YES/NO (legacy Weir.canSurcharge, default YES)
Definition LinkSubtypes.hpp:472
std::vector< double > weir_type
TRANSVERSE/SIDEFLOW/V-NOTCH/TRAPEZOIDAL/ROADWAY = 0..4 (legacy param1)
Definition LinkSubtypes.hpp:466
std::vector< double > cd
Discharge coefficient.
Definition LinkSubtypes.hpp:467
int add_default(int i)
Insert a default WeirData row at the sorted base-object key position.
Definition LinkSubtypes.hpp:537
std::vector< int > link_idx
Definition LinkSubtypes.hpp:464
std::vector< double > end_contractions
End contractions (legacy param2)
Definition LinkSubtypes.hpp:468
std::vector< int8_t > road_surface
ROADWAY weir: 0 none, 1 PAVED, 2 GRAVEL (legacy Weir.roadSurface)
Definition LinkSubtypes.hpp:476
int count() const noexcept
Count WeirData rows from the base-object join-key column.
Definition LinkSubtypes.hpp:484