![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Portable cross-section geometry kernels — one implementation, three consumers (host dynamic wave, host finite volume, device finite volume). More...
Go to the source code of this file.
Classes | |
| struct | openswmm::xsect::XsectTables |
| struct | openswmm::xsect::XsectEval |
| The geometry layer itself, parameterized on where its tables live. More... | |
Namespaces | |
| namespace | openswmm |
| namespace | openswmm::xsect |
| namespace | openswmm::xsect::shape |
| The analytic shape formulas — the single definition of each. | |
Macros | |
| #define | OPENSWMM_KERNEL_FN inline |
Enumerations | |
| enum class | openswmm::xsect::LutId : int { openswmm::xsect::Y_Gothic = 0 , openswmm::xsect::Y_Catenary , openswmm::xsect::Y_SemiEllip , openswmm::xsect::Y_SemiCirc , openswmm::xsect::A_HorizEllipse , openswmm::xsect::A_VertEllipse , openswmm::xsect::A_Arch , openswmm::xsect::S_Circ , openswmm::xsect::S_Egg , openswmm::xsect::S_Horseshoe , openswmm::xsect::S_Gothic , openswmm::xsect::S_Catenary , openswmm::xsect::S_SemiEllip , openswmm::xsect::S_BasketHandle , openswmm::xsect::S_SemiCirc , openswmm::xsect::COUNT } |
| Pointers to the shared geometry tables, in whichever memory space the consumer runs in. More... | |
Variables | |
| constexpr double | openswmm::xsect::TINY = 1.0e-6 |
| constexpr double | openswmm::xsect::PI = 3.141592654 |
| constexpr double | openswmm::xsect::GRAVITY = 32.2 |
| constexpr double | openswmm::xsect::RECT_ALFMAX = 0.97 |
| constexpr double | openswmm::xsect::RECT_TRIANG_ALFMAX = 0.98 |
| constexpr double | openswmm::xsect::RECT_ROUND_ALFMAX = 0.98 |
Portable cross-section geometry kernels — one implementation, three consumers (host dynamic wave, host finite volume, device finite volume).
The cross-section machinery was host-only: the geometry tables are namespace-scope arrays in xsect_tables.hpp, and a device kernel cannot reach a host global. This header removes that barrier without duplicating a single formula — the bodies here were MOVED out of XSection.cpp verbatim, not transcribed, and XSection.cpp's public functions are now one-line forwarders onto them.
The only change to the bodies is where the tables come from. Instead of naming xsect_tables::A_Circ directly they read tbl.A_Circ — a pointer carried in an XsectTables struct. On the host that struct binds straight to the same namespace arrays, so the arithmetic, the operand order and the literals are unchanged and the result is bit-identical by construction rather than by testing. On a device it binds to the device copies of those arrays.
Bit-exactness contract carried over from XSectLookup.hpp: IEEE division rather than a precomputed reciprocal, legacy's exact operation grouping, and no FMA contraction. Device compilers default to aggressive contraction, so a device build MUST pin -ffp-contract=off (or the backend's equivalent) or the tables will diverge in the last ulp.
Transect-backed shapes (IRREGULAR, CUSTOM, STREET_XSECT) read their tables through pointers held in XSectParams itself. A device consumer must rebind those to device memory before use; the shared tables here are the ones that are the same for every model.
| #define OPENSWMM_KERNEL_FN inline |