OpenSWMM Engine  6.0.0-alpha.3
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.3)
Loading...
Searching...
No Matches
NodeData.hpp
Go to the documentation of this file.
1
24
25#ifndef OPENSWMM_ENGINE_NODE_DATA_HPP
26#define OPENSWMM_ENGINE_NODE_DATA_HPP
27
28#include <vector>
29#include <cstdint>
30#include <string>
31#include <algorithm>
32
33namespace openswmm {
34
35// ============================================================================
36// Node type enumeration
37// ============================================================================
38
43enum class NodeType : int8_t {
48};
49
54enum class OutfallType : int8_t {
55 FREE = 0,
56 NORMAL = 1,
57 FIXED = 2,
58 TIDAL = 3,
60};
61
66enum class DividerType : int8_t {
67 CUTOFF = 0,
70 WEIR = 3
71};
72
88enum class StorageShape : int8_t {
89 TABULAR = 0,
92 CONICAL = 3,
95};
96
97// ============================================================================
98// NodeData — SoA layout
99// ============================================================================
100
114struct NodeData {
115
116 // -----------------------------------------------------------------------
117 // Static properties — set at parse time
118 // -----------------------------------------------------------------------
119
121 std::vector<NodeType> type;
122
127 std::vector<double> invert_elev;
128
133 std::vector<double> full_depth;
134
139 std::vector<double> init_depth;
140
145 std::vector<double> sur_depth;
146
151 std::vector<double> ponded_area;
152
153 // -----------------------------------------------------------------------
154 // Node subtype properties (storage / outfall / divider)
155 // -----------------------------------------------------------------------
156 // Relational node refactor (Phase 4): the wide per-node storage_* / outfall_*
157 // / divider_* / exfil_* arrays that used to live here have been REMOVED. They
158 // now live in the dense relational side-tables (StorageData / OutfallData /
159 // DividerData in NodeSubtypes.hpp), sized to the count of each subtype and
160 // joined to base nodes by node_idx — the memory win of the refactor. Only the
161 // base `type[i]` discriminator remains on NodeData. See
162 // docs/relational/RELATIONAL_NODE_REFACTOR_PLAN.md.
163
164 // -----------------------------------------------------------------------
165 // State variables — updated each timestep
166 // -----------------------------------------------------------------------
167
172 std::vector<double> depth;
173
178 std::vector<double> head;
179
184 std::vector<double> volume;
185
190 std::vector<double> lat_flow;
191
199 std::vector<double> user_lat_flow;
200
201 // -----------------------------------------------------------------------
202 // Decomposed lateral inflow sources
203 // Each source process writes to its own buffer.
204 // assembleLateralInflows() sums them all into lat_flow.
205 // -----------------------------------------------------------------------
206
208 std::vector<double> runoff_inflow;
209
211 std::vector<double> gw_inflow;
212
214 std::vector<double> ext_inflow;
215
217 std::vector<double> dwf_inflow;
218
220 std::vector<double> rdii_inflow;
221
223 std::vector<double> iface_inflow;
224
246 std::vector<double> coupling_inflow;
247
261 std::vector<double> coupling_volume;
262
263 // -----------------------------------------------------------------------
264 // Quality mass inflow assembly arrays
265 // assembleQualityInflows() writes these; mixAtNodes() reads them.
266 // -----------------------------------------------------------------------
267
270 std::vector<double> qual_mass_in;
271
273 std::vector<double> qual_vol_in;
274
283 std::vector<double> iface_qual_mass;
284
294 std::vector<double> lid_drain_qual_load;
295
302 std::vector<double> lid_drain_qual_vol;
303
304 // -----------------------------------------------------------------------
305 // Per-node quality state — flat 2D: [node * n_pollutants + pollutant]
306 // -----------------------------------------------------------------------
307
313 std::vector<double> conc;
314
316 std::vector<double> conc_old;
317
319 std::vector<double> hrt;
320
330 std::vector<double> user_conc_mass_flux;
331
334
339 std::vector<double> inflow;
340
345 std::vector<double> outflow;
346
351 std::vector<double> overflow;
352
357 std::vector<double> losses;
358
363 std::vector<double> crown_elev;
364
369 std::vector<int> degree;
370
375 std::vector<double> old_net_inflow;
376
381 std::vector<double> full_volume;
382
383 // -----------------------------------------------------------------------
384 // Previous-step state (for output interpolation / CFL checks)
385 // -----------------------------------------------------------------------
386
388 std::vector<double> old_depth;
389
391 std::vector<double> old_volume;
392
394 std::vector<double> old_lat_flow;
395
400 std::vector<double> old_inflow;
401
402 // -----------------------------------------------------------------------
403 // Per-object INP comment
404 // -----------------------------------------------------------------------
405
415 std::vector<std::string> comments;
416
428 std::vector<std::string> tags;
429
430 // -----------------------------------------------------------------------
431 // Report flag — per-object output filter
432 // -----------------------------------------------------------------------
433
436 std::vector<char> rpt_flag;
437
438 // -----------------------------------------------------------------------
439 // Cumulative statistics
440 // -----------------------------------------------------------------------
441
446 std::vector<double> stat_vol_flooded;
447
452 std::vector<double> stat_time_flooded;
453
458 std::vector<double> stat_max_depth;
459
464 std::vector<double> stat_max_overflow;
465
467 std::vector<double> stat_max_overflow_date;
468
471 std::vector<double> stat_sum_depth;
472
478 std::vector<double> stat_sum_volume;
479
482 std::vector<double> stat_max_depth_date;
483
486 std::vector<double> stat_max_rpt_depth;
487
490 std::vector<double> stat_max_inflow_date;
491
494 std::vector<double> stat_time_surcharged;
495
498 std::vector<double> stat_max_surcharge_height;
499
504 std::vector<double> stat_outfall_avg_flow;
505
508 std::vector<double> stat_max_lat_inflow;
509
512 std::vector<double> stat_max_total_inflow;
513
516 std::vector<double> stat_lat_inflow_vol;
517
519 std::vector<double> stat_total_inflow_vol;
520
523 std::vector<double> stat_total_outflow_vol;
524
529 std::vector<double> stat_outfall_max_flow;
530
535 std::vector<long> stat_outfall_periods;
536
543 std::vector<int> stat_non_converged_count;
544
552 std::vector<double> stat_time_courant_critical;
553
560 std::vector<double> stat_total_load;
562
563 // -----------------------------------------------------------------------
564 // Capacity management
565 // -----------------------------------------------------------------------
566
568 int count() const noexcept { return static_cast<int>(type.size()); }
569
577 void resize(int n) {
578 const auto un = static_cast<std::size_t>(n);
579 type.assign(un, NodeType::JUNCTION);
580 invert_elev.assign(un, 0.0);
581 full_depth.assign(un, 0.0);
582 init_depth.assign(un, 0.0);
583 sur_depth.assign(un, 0.0);
584 ponded_area.assign(un, 0.0);
585
586 // Subtype config (storage/outfall/divider) lives in NodeSubtypes side-tables.
587 depth.assign(un, 0.0);
588 head.assign(un, 0.0);
589 volume.assign(un, 0.0);
590 lat_flow.assign(un, 0.0);
591 user_lat_flow.assign(un, 0.0);
592 runoff_inflow.assign(un, 0.0);
593 gw_inflow.assign(un, 0.0);
594 ext_inflow.assign(un, 0.0);
595 dwf_inflow.assign(un, 0.0);
596 rdii_inflow.assign(un, 0.0);
597 iface_inflow.assign(un, 0.0);
598 coupling_inflow.assign(un, 0.0);
599 coupling_volume.assign(un, 0.0);
600 qual_mass_in.clear();
601 iface_qual_mass.clear();
602 qual_vol_in.assign(un, 0.0);
603 lid_drain_qual_load.clear();
604 lid_drain_qual_vol.assign(un, 0.0);
605 inflow.assign(un, 0.0);
606 outflow.assign(un, 0.0);
607 overflow.assign(un, 0.0);
608 losses.assign(un, 0.0);
609 crown_elev.assign(un, 0.0);
610 degree.assign(un, 0);
611 old_net_inflow.assign(un, 0.0);
612 full_volume.assign(un, 0.0);
613 old_depth.assign(un, 0.0);
614 old_volume.assign(un, 0.0);
615 old_lat_flow.assign(un, 0.0);
616 old_inflow.assign(un, 0.0);
617
618 comments.assign(un, std::string{});
619 tags.assign(un, std::string{});
620
621 rpt_flag.assign(un, 0);
622
623 stat_vol_flooded.assign(un, 0.0);
624 stat_time_flooded.assign(un, 0.0);
625 stat_max_depth.assign(un, 0.0);
626 stat_max_overflow.assign(un, 0.0);
627 stat_max_overflow_date.assign(un, 0.0);
628 stat_sum_depth.assign(un, 0.0);
629 stat_sum_volume.assign(un, 0.0);
630 stat_max_depth_date.assign(un, 0.0);
631 stat_max_rpt_depth.assign(un, 0.0);
632 stat_max_inflow_date.assign(un, 0.0);
633 stat_time_surcharged.assign(un, 0.0);
634 stat_max_surcharge_height.assign(un, 0.0);
635 stat_max_lat_inflow.assign(un, 0.0);
636 stat_max_total_inflow.assign(un, 0.0);
637 stat_lat_inflow_vol.assign(un, 0.0);
638 stat_total_inflow_vol.assign(un, 0.0);
639 stat_total_outflow_vol.assign(un, 0.0);
640 stat_outfall_avg_flow.assign(un, 0.0);
641 stat_outfall_max_flow.assign(un, 0.0);
642 stat_outfall_periods.assign(un, 0);
643 stat_non_converged_count.assign(un, 0);
644 stat_time_courant_critical.assign(un, 0.0);
645 }
646
654 void grow_to(int n) {
655 if (n <= count()) return;
656 const auto un = static_cast<std::size_t>(n);
657 auto g = [&](auto& vec, auto def) { vec.resize(un, def); };
659 g(invert_elev, 0.0); g(full_depth, 0.0); g(init_depth, 0.0);
660 g(sur_depth, 0.0); g(ponded_area, 0.0);
661 // Subtype config (storage/outfall/divider) lives in NodeSubtypes side-tables.
662 g(depth, 0.0); g(head, 0.0); g(volume, 0.0);
663 g(lat_flow, 0.0); g(user_lat_flow, 0.0);
664 g(runoff_inflow, 0.0); g(gw_inflow, 0.0); g(ext_inflow, 0.0);
665 g(dwf_inflow, 0.0); g(rdii_inflow, 0.0); g(iface_inflow, 0.0);
666 g(coupling_inflow, 0.0); g(coupling_volume, 0.0);
667 qual_vol_in.resize(un, 0.0);
668 lid_drain_qual_vol.resize(un, 0.0);
669 g(inflow, 0.0); g(outflow, 0.0); g(overflow, 0.0);
670 g(losses, 0.0); g(crown_elev, 0.0); g(degree, 0);
671 g(old_net_inflow, 0.0); g(full_volume, 0.0);
672 g(old_depth, 0.0); g(old_volume, 0.0); g(old_lat_flow, 0.0);
673 g(old_inflow, 0.0);
674 comments.resize(un, std::string{});
675 tags.resize(un, std::string{});
676
677 g(rpt_flag, static_cast<char>(0));
678 g(stat_vol_flooded, 0.0); g(stat_time_flooded, 0.0);
679 g(stat_max_depth, 0.0); g(stat_max_overflow, 0.0);
680 g(stat_max_overflow_date, 0.0); g(stat_sum_depth, 0.0);
681 g(stat_sum_volume, 0.0);
691 // Note: qual_mass_in, conc, conc_old, hrt handled by resize_quality()
692 }
693
703 void erase_at(int idx) {
704 const auto ui = static_cast<std::size_t>(idx);
705 auto e = [&](auto& v) { if (ui < v.size()) v.erase(v.begin() + static_cast<std::ptrdiff_t>(idx)); };
706
708
709 // Subtype config (storage/outfall/divider) lives in NodeSubtypes side-tables;
710 // its rows are erased/renumbered by NodeSubtypes::erase_node (called by the
711 // node-delete path), not here.
712 e(depth); e(head); e(volume);
713 e(lat_flow); e(user_lat_flow);
718 e(inflow); e(outflow); e(overflow); e(losses);
721 e(comments); e(tags); e(rpt_flag);
722
730
731 // Flat 2D quality arrays: [node * np + p] → erase the stride for idx
732 if (conc_n_pollutants > 0) {
733 const auto np = static_cast<std::size_t>(conc_n_pollutants);
734 const auto base = ui * np;
735 auto erase2d = [&](auto& v) {
736 if (base + np <= v.size())
737 v.erase(v.begin() + static_cast<std::ptrdiff_t>(base),
738 v.begin() + static_cast<std::ptrdiff_t>(base + np));
739 };
740 erase2d(conc); erase2d(conc_old);
741 erase2d(qual_mass_in); erase2d(iface_qual_mass);
742 erase2d(lid_drain_qual_load); erase2d(user_conc_mass_flux);
743 if (ui < hrt.size()) hrt.erase(hrt.begin() + static_cast<std::ptrdiff_t>(idx));
744 }
745
746 // Flat 2D stat load: [node * np + p]
747 if (stat_n_pollutants > 0) {
748 const auto np = static_cast<std::size_t>(stat_n_pollutants);
749 const auto base = ui * np;
750 if (base + np <= stat_total_load.size())
751 stat_total_load.erase(
752 stat_total_load.begin() + static_cast<std::ptrdiff_t>(base),
753 stat_total_load.begin() + static_cast<std::ptrdiff_t>(base + np));
754 }
755 }
756
760 void resize_loads(int n_pollutants) {
761 stat_n_pollutants = n_pollutants;
762 if (n_pollutants > 0) {
763 auto total = static_cast<std::size_t>(count()) *
764 static_cast<std::size_t>(n_pollutants);
765 stat_total_load.assign(total, 0.0);
766 }
767 }
768
772 void resize_quality(int n_pollutants) {
773 conc_n_pollutants = n_pollutants;
774 if (n_pollutants > 0) {
775 auto total = static_cast<std::size_t>(count()) *
776 static_cast<std::size_t>(n_pollutants);
777 conc.assign(total, 0.0);
778 conc_old.assign(total, 0.0);
779 hrt.assign(static_cast<std::size_t>(count()), 0.0);
780 user_conc_mass_flux.assign(total, 0.0);
781 qual_mass_in.assign(total, 0.0);
782 iface_qual_mass.assign(total, 0.0);
783 lid_drain_qual_load.assign(total, 0.0);
784 }
785 }
786
795 type.shrink_to_fit();
796 invert_elev.shrink_to_fit();
797 full_depth.shrink_to_fit();
798 init_depth.shrink_to_fit();
799 sur_depth.shrink_to_fit();
800 ponded_area.shrink_to_fit();
801
802 // Subtype config (storage/outfall/divider) lives in NodeSubtypes side-tables.
803 depth.shrink_to_fit();
804 head.shrink_to_fit();
805 volume.shrink_to_fit();
806 lat_flow.shrink_to_fit();
807 user_lat_flow.shrink_to_fit();
808 runoff_inflow.shrink_to_fit();
809 gw_inflow.shrink_to_fit();
810 ext_inflow.shrink_to_fit();
811 dwf_inflow.shrink_to_fit();
812 rdii_inflow.shrink_to_fit();
813 iface_inflow.shrink_to_fit();
814 coupling_inflow.shrink_to_fit();
815 coupling_volume.shrink_to_fit();
816 qual_mass_in.shrink_to_fit();
817 iface_qual_mass.shrink_to_fit();
818 qual_vol_in.shrink_to_fit();
819 conc.shrink_to_fit();
820 conc_old.shrink_to_fit();
821 user_conc_mass_flux.shrink_to_fit();
822 inflow.shrink_to_fit();
823 outflow.shrink_to_fit();
824 overflow.shrink_to_fit();
825 losses.shrink_to_fit();
826 crown_elev.shrink_to_fit();
827 degree.shrink_to_fit();
828 old_net_inflow.shrink_to_fit();
829 full_volume.shrink_to_fit();
830 old_depth.shrink_to_fit();
831 old_volume.shrink_to_fit();
832 old_lat_flow.shrink_to_fit();
833 old_inflow.shrink_to_fit();
834
835 comments.shrink_to_fit();
836 tags.shrink_to_fit();
837
838 rpt_flag.shrink_to_fit();
839
840 stat_vol_flooded.shrink_to_fit();
841 stat_time_flooded.shrink_to_fit();
842 stat_max_depth.shrink_to_fit();
843 stat_max_overflow.shrink_to_fit();
844 stat_max_overflow_date.shrink_to_fit();
845 stat_sum_depth.shrink_to_fit();
846 stat_max_depth_date.shrink_to_fit();
847 stat_max_rpt_depth.shrink_to_fit();
848 stat_max_inflow_date.shrink_to_fit();
849 stat_time_surcharged.shrink_to_fit();
850 stat_max_surcharge_height.shrink_to_fit();
851 stat_max_lat_inflow.shrink_to_fit();
852 stat_max_total_inflow.shrink_to_fit();
853 stat_lat_inflow_vol.shrink_to_fit();
854 stat_total_inflow_vol.shrink_to_fit();
855 stat_total_outflow_vol.shrink_to_fit();
856 stat_outfall_avg_flow.shrink_to_fit();
857 stat_outfall_max_flow.shrink_to_fit();
858 stat_outfall_periods.shrink_to_fit();
859 stat_total_load.shrink_to_fit();
860 }
861
865 void save_state() noexcept {
866 std::copy(depth.begin(), depth.end(), old_depth.begin());
867 std::copy(volume.begin(), volume.end(), old_volume.begin());
868 std::copy(lat_flow.begin(), lat_flow.end(), old_lat_flow.begin());
869 // Legacy node_setOldHydState (node.c:294): oldFlowInflow = inflow
870 std::copy(inflow.begin(), inflow.end(), old_inflow.begin());
871 // Save net inflow for trapezoidal averaging in next step
872 for (std::size_t i = 0; i < inflow.size(); ++i) {
873 old_net_inflow[i] = inflow[i] - outflow[i];
874 }
875 std::copy(conc.begin(), conc.end(), conc_old.begin());
876 }
877
884 void reset_state() noexcept {
885 const auto n = depth.size();
886 // Apply initial depths from input (matching legacy node_initState)
887 for (std::size_t i = 0; i < n; ++i) {
888 depth[i] = init_depth[i];
889 old_depth[i] = init_depth[i];
890 head[i] = invert_elev[i] + init_depth[i];
891 }
892 // Volumes must be computed from init_depth by caller (needs table data)
893 std::fill(volume.begin(), volume.end(), 0.0);
894 std::fill(old_volume.begin(), old_volume.end(), 0.0);
895 // Zero flows
896 std::fill(lat_flow.begin(), lat_flow.end(), 0.0);
897 std::fill(inflow.begin(), inflow.end(), 0.0);
898 std::fill(outflow.begin(), outflow.end(), 0.0);
899 std::fill(overflow.begin(), overflow.end(), 0.0);
900 std::fill(losses.begin(), losses.end(), 0.0);
901 std::fill(old_net_inflow.begin(), old_net_inflow.end(), 0.0);
902 std::fill(old_lat_flow.begin(), old_lat_flow.end(), 0.0);
903 std::fill(old_inflow.begin(), old_inflow.end(), 0.0);
904 // coupling_inflow / coupling_volume are NOT cleared by clearInflowSources
905 // (coupling_volume is the carry-across-steps field — its end-of-step value
906 // must persist into the next step's assembly), so zero them explicitly on
907 // cold start.
908 std::fill(coupling_inflow.begin(), coupling_inflow.end(), 0.0);
909 std::fill(coupling_volume.begin(), coupling_volume.end(), 0.0);
911 std::fill(conc.begin(), conc.end(), 0.0);
912 std::fill(conc_old.begin(), conc_old.end(), 0.0);
913 (void)n;
914 }
915
925 void clearInflowSources() noexcept {
926 // runoff_inflow and gw_inflow: zeroed in stepRunoff() Phase 2
927 std::fill(ext_inflow.begin(), ext_inflow.end(), 0.0);
928 std::fill(dwf_inflow.begin(), dwf_inflow.end(), 0.0);
929 std::fill(rdii_inflow.begin(), rdii_inflow.end(), 0.0);
930 std::fill(iface_inflow.begin(), iface_inflow.end(), 0.0);
931 std::fill(iface_qual_mass.begin(), iface_qual_mass.end(), 0.0);
932 std::fill(qual_mass_in.begin(), qual_mass_in.end(), 0.0);
933 std::fill(qual_vol_in.begin(), qual_vol_in.end(), 0.0);
934 }
935};
936
937} /* namespace openswmm */
938
939#endif /* OPENSWMM_ENGINE_NODE_DATA_HPP */
Definition NodeCoupling.cpp:15
StorageShape
Storage-unit surface-area relation.
Definition NodeData.hpp:88
@ CONICAL
Elliptical cone (p1, p2 = base axes, p3 = side slope)
Definition NodeData.hpp:92
@ PYRAMIDAL
Rectangular pyramid (p1 = length, p2 = width, p3 = side slope)
Definition NodeData.hpp:94
@ PARABOLOID
Elliptical paraboloid(p1, p2 = top axes, p3 = height ≠ 0)
Definition NodeData.hpp:93
@ CYLINDRICAL
Elliptical cylinder (p1 = major axis, p2 = minor axis)
Definition NodeData.hpp:91
@ FUNCTIONAL
Area = c + a*d^b.
Definition NodeData.hpp:90
@ WEIR
Definition LinkData.hpp:46
OutfallType
Outfall boundary condition type.
Definition NodeData.hpp:54
@ NORMAL
Definition NodeData.hpp:56
@ FREE
Definition NodeData.hpp:55
@ FIXED
Definition NodeData.hpp:57
@ TIDAL
Definition NodeData.hpp:58
NodeType
Node type codes.
Definition NodeData.hpp:43
@ JUNCTION
Definition NodeData.hpp:44
@ DIVIDER
Definition NodeData.hpp:46
@ STORAGE
Definition NodeData.hpp:47
@ OUTFALL
Definition NodeData.hpp:45
DividerType
Flow divider type.
Definition NodeData.hpp:66
@ CUTOFF
Definition NodeData.hpp:67
@ TABULAR
Definition NodeData.hpp:69
@ OVERFLOW_DIV
Renamed from OVERFLOW to avoid macOS math.h macro collision.
Definition NodeData.hpp:68
@ TIMESERIES
Data from an in-file [TIMESERIES].
Definition GageData.hpp:42
Structure-of-Arrays storage for all nodes.
Definition NodeData.hpp:114
std::vector< double > coupling_inflow
2D ↔ 1D coupling exchange flow at the node (project flow units).
Definition NodeData.hpp:246
std::vector< double > stat_lat_inflow_vol
Definition NodeData.hpp:516
int count() const noexcept
Number of nodes.
Definition NodeData.hpp:568
std::vector< double > depth
Current water depth above invert (project length units).
Definition NodeData.hpp:172
std::vector< double > invert_elev
Invert elevation (project length units).
Definition NodeData.hpp:127
std::vector< double > ext_inflow
External (timeseries/baseline) inflows (project flow units).
Definition NodeData.hpp:214
std::vector< double > conc_old
Previous-step quality at each node.
Definition NodeData.hpp:316
std::vector< double > iface_inflow
Interface file (upstream model coupling) inflows (project flow units).
Definition NodeData.hpp:223
std::vector< double > qual_mass_in
Accumulated quality mass inflow rate per (node, pollutant).
Definition NodeData.hpp:270
std::vector< double > stat_vol_flooded
Total volume of water lost as overflow (project volume units).
Definition NodeData.hpp:446
std::vector< double > stat_time_courant_critical
CFL time-step critical count per node.
Definition NodeData.hpp:552
std::vector< double > old_inflow
Total inflow at the previous timestep (for output interpolation).
Definition NodeData.hpp:400
void erase_at(int idx)
Erase the node at index idx from every parallel array.
Definition NodeData.hpp:703
std::vector< double > hrt
Hydraulic residence time for storage nodes (seconds).
Definition NodeData.hpp:319
std::vector< double > old_depth
Depth at the previous timestep.
Definition NodeData.hpp:388
void reset_state() noexcept
Reset state variables, applying init_depth from input.
Definition NodeData.hpp:884
std::vector< double > qual_vol_in
Accumulated volume inflow rate per node (ft3/sec).
Definition NodeData.hpp:273
std::vector< double > coupling_volume
Pending 1D↔2D exchange VOLUME for the next routing step (1D units, ft³).
Definition NodeData.hpp:261
std::vector< double > old_volume
Volume at the previous timestep.
Definition NodeData.hpp:391
std::vector< double > stat_total_outflow_vol
Definition NodeData.hpp:523
std::vector< double > user_conc_mass_flux
User-forced quality mass flux at each node (mass/sec).
Definition NodeData.hpp:330
void shrink_to_fit()
Release excess vector capacity accumulated during parsing.
Definition NodeData.hpp:794
std::vector< double > stat_max_surcharge_height
Definition NodeData.hpp:498
std::vector< double > stat_max_overflow
Maximum reported overflow rate (project flow units).
Definition NodeData.hpp:464
std::vector< char > rpt_flag
Whether this node is included in report/output (0=no, 1=yes).
Definition NodeData.hpp:436
std::vector< double > outflow
Current total outflow from the node (project flow units).
Definition NodeData.hpp:345
void clearInflowSources() noexcept
Zero routing-phase inflow source arrays.
Definition NodeData.hpp:925
std::vector< double > overflow
Current overflow / ponded flow (project flow units).
Definition NodeData.hpp:351
std::vector< double > old_net_inflow
Net inflow from previous timestep (inflow - outflow) for averaging.
Definition NodeData.hpp:375
std::vector< double > stat_max_depth_date
Definition NodeData.hpp:482
std::vector< double > stat_max_lat_inflow
Definition NodeData.hpp:508
std::vector< double > stat_outfall_max_flow
Outfall maximum flow (project flow units).
Definition NodeData.hpp:529
std::vector< double > volume
Current water volume (project volume units).
Definition NodeData.hpp:184
int conc_n_pollutants
Number of pollutants in the quality arrays.
Definition NodeData.hpp:333
std::vector< double > iface_qual_mass
Routing interface file quality mass rate per (node, pollutant) (mass/sec).
Definition NodeData.hpp:283
std::vector< double > lat_flow
Current lateral inflow (project flow units).
Definition NodeData.hpp:190
std::vector< double > ponded_area
Ponding area at the surface (sq project length units).
Definition NodeData.hpp:151
std::vector< double > stat_total_inflow_vol
Cumulative total inflow volume at each node (ft3).
Definition NodeData.hpp:519
std::vector< double > sur_depth
Maximum depth allowed at the node (ponding or surcharge limit).
Definition NodeData.hpp:145
std::vector< double > crown_elev
Crown elevation — top of highest connecting conduit (project length units).
Definition NodeData.hpp:363
std::vector< double > stat_max_inflow_date
Definition NodeData.hpp:490
std::vector< double > old_lat_flow
Lateral flow at the previous timestep.
Definition NodeData.hpp:394
std::vector< double > stat_outfall_avg_flow
Outfall cumulative average flow (flow units × reporting periods).
Definition NodeData.hpp:504
std::vector< double > inflow
Current total inflow to the node (project flow units).
Definition NodeData.hpp:339
void save_state() noexcept
Snapshot current state into old-step arrays before solving.
Definition NodeData.hpp:865
std::vector< double > stat_time_surcharged
Definition NodeData.hpp:494
std::vector< double > stat_max_depth
Maximum reported depth (project length units).
Definition NodeData.hpp:458
std::vector< long > stat_outfall_periods
Outfall number of non-zero flow periods.
Definition NodeData.hpp:535
void resize_loads(int n_pollutants)
Resize pollutant load arrays after pollutant count is known.
Definition NodeData.hpp:760
std::vector< double > conc
Current quality concentration at each node.
Definition NodeData.hpp:313
std::vector< int > degree
Node degree — number of connecting links (+ve downstream, -ve upstream terminal).
Definition NodeData.hpp:369
std::vector< double > lid_drain_qual_vol
LID drain volume inflow rate per node (ft3/sec).
Definition NodeData.hpp:302
std::vector< double > runoff_inflow
Interpolated surface runoff from subcatchments (project flow units).
Definition NodeData.hpp:208
std::vector< double > dwf_inflow
Dry weather flow inflows (project flow units).
Definition NodeData.hpp:217
std::vector< double > stat_time_flooded
Total duration the node was flooded (seconds).
Definition NodeData.hpp:452
std::vector< std::string > tags
Per-object tag from the INP [TAGS] section.
Definition NodeData.hpp:428
std::vector< double > lid_drain_qual_load
LID drain quality mass rate per (node, pollutant) (mass/sec).
Definition NodeData.hpp:294
std::vector< double > stat_sum_volume
Definition NodeData.hpp:478
std::vector< double > stat_sum_depth
Definition NodeData.hpp:471
std::vector< double > stat_max_rpt_depth
Definition NodeData.hpp:486
std::vector< double > init_depth
Initial water depth (project length units).
Definition NodeData.hpp:139
std::vector< double > stat_total_load
Cumulative pollutant loads at each node.
Definition NodeData.hpp:560
void resize(int n)
Resize all arrays to hold exactly n nodes.
Definition NodeData.hpp:577
std::vector< int > stat_non_converged_count
Count of non-converging steps per node.
Definition NodeData.hpp:543
std::vector< double > full_volume
Full volume at node (project volume units).
Definition NodeData.hpp:381
std::vector< double > stat_max_overflow_date
Date/time when maximum overflow occurred (OADate (days since 12/30/1899)).
Definition NodeData.hpp:467
std::vector< std::string > comments
Object comment from the INP file (lines with a single ';' prefix immediately above this object's data...
Definition NodeData.hpp:415
std::vector< double > losses
Node losses (evaporation + seepage) (project flow units).
Definition NodeData.hpp:357
void grow_to(int n)
Grow all arrays to hold at least n nodes, preserving existing data.
Definition NodeData.hpp:654
std::vector< NodeType > type
Node type for each node.
Definition NodeData.hpp:121
std::vector< double > full_depth
Full depth of the node (project length units).
Definition NodeData.hpp:133
std::vector< double > stat_max_total_inflow
Definition NodeData.hpp:512
std::vector< double > rdii_inflow
RDII unit hydrograph inflows (project flow units).
Definition NodeData.hpp:220
void resize_quality(int n_pollutants)
Resize per-node quality arrays after pollutant count is known.
Definition NodeData.hpp:772
std::vector< double > head
Current water surface head (project length units = invert + depth).
Definition NodeData.hpp:178
std::vector< double > gw_inflow
Interpolated groundwater flow from subcatchments (project flow units).
Definition NodeData.hpp:211
std::vector< double > user_lat_flow
User-forced lateral inflow set via the API (project flow units).
Definition NodeData.hpp:199
int stat_n_pollutants
Definition NodeData.hpp:561