OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
Transect.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
33
34#ifndef OPENSWMM_TRANSECT_HPP
35#define OPENSWMM_TRANSECT_HPP
36
37#include <vector>
38#include <string>
39
40#include "XSectLookup.hpp"
41
42namespace openswmm {
43
44struct TransectStore; // engine/data/InfraData.hpp
45
46namespace transect {
47
48constexpr int N_TRANSECT_TBL = 51;
49
51 std::string name;
52 double n_left = 0.0;
53 double n_right = 0.0;
54 double n_channel = 0.0;
55 double length_factor = 1.0;
56
57 // Station-elevation pairs
58 std::vector<double> stations;
59 std::vector<double> elevations;
60
61 double x_left_bank = 0.0;
62 double x_right_bank = 0.0;
63
64 // Computed geometry tables (normalized)
65 double y_full = 0.0;
66 double w_max = 0.0;
67 double a_full = 0.0;
68 double r_full = 0.0;
69 // CUSTOM shapes only (legacy TShape.sMax/aMax, shape.c getSmax): max
70 // section factor and its area for a shape of UNIT height, computed on the
71 // unnormalized tables. Scaled by yFull in the caller (xsect.c:685-686).
72 double s_max = 0.0;
73 double a_max = 0.0;
74
78
83};
84
96
110void buildCustomTables(TransectData& td, double y_full,
111 const double* curve_x, const double* curve_y, int n_pts);
112
132bool buildFromStore(const TransectStore& ts, int index, double ucf_length,
133 TransectData& td);
134
135} // namespace transect
136} // namespace openswmm
137
138#endif // OPENSWMM_TRANSECT_HPP
Bit-exact geometry-table interpolation — the single source of truth.
Definition Transect.cpp:36
bool buildFromStore(const TransectStore &ts, int index, double ucf_length, TransectData &td)
Build one transect's geometry tables from the raw [TRANSECTS] store.
Definition Transect.cpp:415
void buildTables(TransectData &td)
Build tabulated geometry from station-elevation data.
Definition Transect.cpp:49
void buildCustomTables(TransectData &td, double y_full, const double *curve_x, const double *curve_y, int n_pts)
Build tabulated geometry from a CUSTOM shape curve.
Definition Transect.cpp:299
constexpr int N_TRANSECT_TBL
Definition Transect.hpp:48
Definition NodeCoupling.cpp:16
Definition InfraData.hpp:42
Definition Transect.hpp:50
std::vector< double > stations
x positions (ft)
Definition Transect.hpp:58
double area_tbl[N_TRANSECT_TBL]
Definition Transect.hpp:75
std::vector< double > elevations
y elevations (ft)
Definition Transect.hpp:59
std::string name
Definition Transect.hpp:51
double r_full
Definition Transect.hpp:68
double width_tbl[N_TRANSECT_TBL]
Definition Transect.hpp:77
double x_right_bank
Right bank station.
Definition Transect.hpp:62
double s_max
Definition Transect.hpp:72
double x_left_bank
Left bank station.
Definition Transect.hpp:61
double n_channel
Main channel Manning's n.
Definition Transect.hpp:54
double a_max
Definition Transect.hpp:73
double a_full
Definition Transect.hpp:67
double w_max
Definition Transect.hpp:66
double length_factor
Main-channel / flood-plain length ratio (Lfactor)
Definition Transect.hpp:55
double n_right
Right overbank Manning's n.
Definition Transect.hpp:53
xsect::LocateLut area_lut
Definition Transect.hpp:82
double n_left
Left overbank Manning's n.
Definition Transect.hpp:52
double hrad_tbl[N_TRANSECT_TBL]
Definition Transect.hpp:76
double y_full
Definition Transect.hpp:65
Definition XSectLookup.hpp:182