![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Namespaces | |
| namespace | shape |
| The analytic shape formulas — the single definition of each. | |
Classes | |
| struct | LocateLut |
| struct | XsectEval |
| The geometry layer itself, parameterized on where its tables live. More... | |
| struct | XsectTables |
Enumerations | |
| enum class | LutId : int { Y_Gothic = 0 , Y_Catenary , Y_SemiEllip , Y_SemiCirc , A_HorizEllipse , A_VertEllipse , A_Arch , S_Circ , S_Egg , S_Horseshoe , S_Gothic , S_Catenary , S_SemiEllip , S_BasketHandle , S_SemiCirc , COUNT } |
| Pointers to the shared geometry tables, in whichever memory space the consumer runs in. More... | |
Functions | |
| double | getAofY (const XSectParams &xs, double y) |
| double | getRofY (const XSectParams &xs, double y) |
| double | getWofY (const XSectParams &xs, double y) |
| double | getYofA (const XSectParams &xs, double a) |
| double | getSofA (const XSectParams &xs, double a) |
| double | getRofA (const XSectParams &xs, double a) |
| double | getdSdA (const XSectParams &xs, double a) |
| double | getAofS (const XSectParams &xs, double s_factor) |
| double | getAmax (const XSectParams &xs) |
| double | getYcrit (const XSectParams &xs, double q) |
| bool | isOpen (int type) |
| int | setParams (XSectParams &xs, int type, const double p[], double ucf) |
| double | lookup (double x, const double *table, int n_items) |
| double | invLookup (double y, const double *table, int n_items, const LocateLut *lut=nullptr) |
| int | locate (double y, const double *table, int n) |
| double | getYcircular (double alpha) |
| double | getScircular (double alpha) |
| const XsectTables & | hostTables () |
| const XsectEval & | hostEval () |
| double | lookup_exact (double x, const double *t, int n) noexcept |
| Bit-exact transliteration of legacy xsect.c:lookup(). | |
| double | lookup_fast (double x, const double *t, int n) noexcept |
| Reciprocal-multiply lookup (fast, NOT bit-exact — see §6). | |
| double | norm_x (double depth, double param) noexcept |
| double | norm_lookup (double depth, double param, const double *t, int n) noexcept |
| Mode-aware normalize + table lookup (bit-exact by default; §6 fast if opted in). | |
| int | lut_bucket (const LocateLut &L, double y) noexcept |
| Bucket index for a value — the ONE expression used by both build and query. | |
| int | locate_bisect (double y, const double *table, int jLast) noexcept |
| void | build_locate_lut (LocateLut &L, const double *table, int jLast) noexcept |
| int | locate_lut (double y, const double *table, int jLast, const LocateLut &L) noexcept |
LUT-accelerated locate() — returns the identical index for every input. | |
| int | locate_maybe_lut (double y, const double *table, int jLast, const LocateLut *L) noexcept |
| Dispatch: use the map when one was built for this exact table extent. | |
| void | build_invlookup_lut (LocateLut &L, const double *table, int n_items) noexcept |
Variables | |
| constexpr double | TINY = 1.0e-6 |
| constexpr double | PI = 3.141592654 |
| constexpr double | GRAVITY = 32.2 |
| constexpr double | RECT_ALFMAX = 0.97 |
| constexpr double | RECT_TRIANG_ALFMAX = 0.98 |
| constexpr double | RECT_ROUND_ALFMAX = 0.98 |
|
strong |
Pointers to the shared geometry tables, in whichever memory space the consumer runs in.
Plain POD: trivially copyable into a device kernel by value. The member names are deliberately identical to the xsect_tables:: symbols they bind to, so the moved bodies differ from the originals by exactly one token.
The tables invLookup() inverts, and so the ones that carry a LocateLut (plan XSECT_LOOKUP_ACCEL §4 item A1).
Every other shared table is only ever read forward, where the index is a divide-and-truncate and there is no search to accelerate. Keeping the maps in one array indexed by this enum costs XsectTables a single pointer instead of fifteen, and keeps the host binding (XSection.cpp hostTables) and any device binding to one block to copy.
| Enumerator | |
|---|---|
| Y_Gothic | |
| Y_Catenary | |
| Y_SemiEllip | |
| Y_SemiCirc | |
| A_HorizEllipse | |
| A_VertEllipse | |
| A_Arch | |
| S_Circ | |
| S_Egg | |
| S_Horseshoe | |
| S_Gothic | |
| S_Catenary | |
| S_SemiEllip | |
| S_BasketHandle | |
| S_SemiCirc | |
| COUNT | |
|
inlinenoexcept |
Build the map for the extent invLookup(y, table, n_items) actually searches — including the section-factor tables' two-row top truncation, so the S_* maps bracket the same window locate() is called on. (The truncated top rows are resolved by invLookup's own branch, outside locate, and are unaffected.)
|
inlinenoexcept |
Build the bucket map for table over indices [0, jLast].
Leaves the map disabled (scale == 0) for a degenerate or non-monotone table, or one too long to index with a byte — the caller then bisects as before.
| double openswmm::xsect::getAmax | ( | const XSectParams & | xs | ) |
| double openswmm::xsect::getAofS | ( | const XSectParams & | xs, |
| double | s_factor ) |
| double openswmm::xsect::getAofY | ( | const XSectParams & | xs, |
| double | y ) |
| double openswmm::xsect::getdSdA | ( | const XSectParams & | xs, |
| double | a ) |
| double openswmm::xsect::getRofA | ( | const XSectParams & | xs, |
| double | a ) |
| double openswmm::xsect::getRofY | ( | const XSectParams & | xs, |
| double | y ) |
| double openswmm::xsect::getScircular | ( | double | alpha | ) |
| double openswmm::xsect::getSofA | ( | const XSectParams & | xs, |
| double | a ) |
| double openswmm::xsect::getWofY | ( | const XSectParams & | xs, |
| double | y ) |
| double openswmm::xsect::getYcircular | ( | double | alpha | ) |
| double openswmm::xsect::getYcrit | ( | const XSectParams & | xs, |
| double | q ) |
| double openswmm::xsect::getYofA | ( | const XSectParams & | xs, |
| double | a ) |
| const XsectEval & openswmm::xsect::hostEval | ( | ) |
One host-bound evaluator, constructed once. Holding it in a function-local static keeps the forwarders free of any per-call setup, and lets the finite-volume geometry hold a pointer to it instead of a copy.
| const XsectTables & openswmm::xsect::hostTables | ( | ) |
The host-bound table set and evaluator: hostTables() binds every pointer straight back to the xsect_tables:: arrays, so hostEval() reproduces the pre-extraction code exactly. A device consumer builds its own pair over device copies of the same arrays.
| double openswmm::xsect::invLookup | ( | double | y, |
| const double * | table, | ||
| int | n_items, | ||
| const LocateLut * | lut = nullptr ) |
| bool openswmm::xsect::isOpen | ( | int | type | ) |
| int openswmm::xsect::locate | ( | double | y, |
| const double * | table, | ||
| int | n ) |
|
inlinenoexcept |
Plain bisection — the shipped locate() body, kept here so the LUT builder and the fallback path share one definition with XsectEval::locate.
|
inlinenoexcept |
LUT-accelerated locate() — returns the identical index for every input.
|
inlinenoexcept |
Dispatch: use the map when one was built for this exact table extent.
| double openswmm::xsect::lookup | ( | double | x, |
| const double * | table, | ||
| int | n_items ) |
|
inlinenoexcept |
Bit-exact transliteration of legacy xsect.c:lookup().
| x | Normalized independent variable (depth/y_full or area/a_full), finite and in [0, 1] (see file-level preconditions). |
| t | Geometry table (n equally spaced entries on [0, 1]). |
| n | Logical entry count (== legacy nItems). |
lookup().
|
inlinenoexcept |
Reciprocal-multiply lookup (fast, NOT bit-exact — see §6).
|
inlinenoexcept |
Bucket index for a value — the ONE expression used by both build and query.
|
inlinenoexcept |
Mode-aware normalize + table lookup (bit-exact by default; §6 fast if opted in).
|
inlinenoexcept |
| int openswmm::xsect::setParams | ( | XSectParams & | xs, |
| int | type, | ||
| const double | p[], | ||
| double | ucf ) |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |