58#ifndef OPENSWMM_XSECT_KERNELS_HPP
59#define OPENSWMM_XSECT_KERNELS_HPP
70#ifndef OPENSWMM_KERNEL_FN
71#define OPENSWMM_KERNEL_FN inline
79inline constexpr double TINY = 1.0e-6;
80inline constexpr double PI = 3.141592654;
120 return (y_bot + s_bot *
y) *
y;
124 return y *
y * s_bot;
128 return (4.0 / 3.0) * r_bot *
y * std::sqrt(
y);
132 return r_bot * std::pow(
y, s_bot + 1.0);
140 if (a <= 0.0)
return 0.0;
141 double p = w_max + 2.0 * a / w_max;
150 if (a <= 0.0)
return 0.0;
151 return a / (w_max + (2.0 - s_bot) * a / w_max);
156 if (
y == 0.0)
return 0.0;
157 return trapezAofY(
y, y_bot, s_bot) / (y_bot +
y * r_bot);
161 return (
y * s_bot) / (2.0 * r_bot);
169 if (y_norm == 1.0)
return 0.0;
174 return y_bot + 2.0 *
y * s_bot;
178 return 2.0 * s_bot *
y;
182 return 2.0 * r_bot * std::sqrt(
y);
186 return (s_bot + 1.0) * r_bot * std::pow(
y, s_bot);
317 return luts ? (
luts +
static_cast<int>(id)) :
nullptr;
336 template <
class Func>
338 constexpr int MAXIT = 60;
340 double df, dx, dxold, f, x, temp, xhi, xlo;
345 dxold = std::fabs(x2 - x1);
349 for (
int j = 1; j <=
MAXIT; ++j) {
350 if (((x - xhi) * df - f) * ((x - xlo) * df - f) >= 0.0 ||
351 (std::fabs(2.0 * f) > std::fabs(dxold * df))) {
353 dx = 0.5 * (xhi - xlo);
361 if (temp == x)
break;
363 if (std::fabs(dx) < xacc)
break;
366 if (f < 0.0) xlo = x;
370 return (n <=
MAXIT) ? n : 0;
374 template <
class Func>
376 constexpr int MAXIT = 60;
377 auto SIGN = [](
double a,
double b) {
return (b >= 0.0) ? std::fabs(a) : -std::fabs(a); };
379 double ans, fhi, flo, fm, fnew, s, xhi, xlo, xm, xnew;
382 if (flo == 0.0)
return x1;
383 if (fhi == 0.0)
return x2;
384 ans = 0.5 * (x1 + x2);
385 if ((flo > 0.0 && fhi < 0.0) || (flo < 0.0 && fhi > 0.0)) {
388 for (
int j = 1; j <=
MAXIT; ++j) {
389 xm = 0.5 * (xlo + xhi);
391 s = std::sqrt(fm * fm - flo * fhi);
392 if (s == 0.0)
return ans;
393 xnew = xm + (xm - xlo) * ((flo >= fhi ? 1.0 : -1.0) * fm / s);
394 if (std::fabs(xnew - ans) <= xacc)
break;
397 if (
SIGN(fm, fnew) != fm) { xlo = xm; flo = fm; xhi = ans; fhi = fnew; }
398 else if (
SIGN(flo, fnew) != flo) { xhi = ans; fhi = fnew; }
399 else if (
SIGN(fhi, fnew) != fhi) { xlo = ans; flo = fnew; }
401 if (std::fabs(xhi - xlo) <= xacc)
return ans;
436 if (!(x > 0.0))
return table[0];
437 if (x > 1.0)
return table[n_items - 1];
446 double dx = 1.0 /
static_cast<double>(n_items - 1);
450 if (table[n - 3] > table[n - 1]) n = n - 2;
453 if (n < n_items && y > table[n_items - 1]) {
454 if (
y >= table[n_items - 3])
return static_cast<double>(n - 1) * dx;
455 if (
y <= table[n_items - 2]) i = n_items - 2;
456 else i = n_items - 3;
460 if (i >= n - 1)
return static_cast<double>(n - 1) * dx;
463 double dy = table[i + 1] - table[i];
465 if (dy == 0.0) x = x0;
466 else x = x0 + (
y - table[i]) * dx / dy;
467 if (x < 0.0) x = 0.0;
468 if (x > 1.0) x = 1.0;
477 double theta, theta1, ap, d;
478 if (alpha > 0.04) theta = 1.2 + 5.08 * (alpha - 0.04) / 0.96;
479 else theta = 0.031715 - 12.79384 * alpha + 8.28479 * std::sqrt(alpha);
481 ap = (2.0 *
PI) * alpha;
482 for (
int k = 1; k <= 40; ++k) {
483 d = -(ap - theta + std::sin(theta)) / (1.0 - std::cos(theta));
484 if (d > 1.0) d = std::copysign(1.0, d);
486 if (std::fabs(d) <= 0.0001)
return theta;
492 double theta, theta1, ap, tt, tt23, t3, d;
493 if (psi > 0.90) theta = 4.17 + 1.12 * (psi - 0.90) / 0.176;
494 else if (psi > 0.5) theta = 3.14 + 1.03 * (psi - 0.5) / 0.4;
495 else if (psi > 0.015) theta = 1.2 + 1.94 * (psi - 0.015) / 0.485;
496 else theta = 0.12103 - 55.5075 * psi + 15.62254 * std::sqrt(psi);
498 ap = (2.0 *
PI) * psi;
499 for (
int k = 1; k <= 40; ++k) {
500 theta = std::fabs(theta);
501 tt = theta - std::sin(theta);
502 tt23 = std::pow(tt, 2.0 / 3.0);
503 t3 = std::pow(theta, 1.0 / 3.0);
504 d = ap * theta / t3 - tt * tt23;
505 d = d / (ap * (2.0 / 3.0) / t3 - (5.0 / 3.0) * tt23 * (1.0 - std::cos(theta)));
507 if (std::fabs(d) <= 0.0001)
return theta;
514 if (alpha >= 1.0)
return 1.0;
515 if (alpha <= 0.0)
return 0.0;
516 if (alpha <= 1.0e-5) {
517 theta = std::pow(37.6911 * alpha, 1.0 / 3.0);
518 return theta * theta / 16.0;
521 return (1.0 - std::cos(theta / 2.0)) / 2.0;
526 if (alpha >= 1.0)
return 1.0;
527 if (alpha <= 0.0)
return 0.0;
528 if (alpha <= 1.0e-5) {
529 theta = std::pow(37.6911 * alpha, 1.0 / 3.0);
530 return std::pow(theta, 13.0 / 3.0) / 124.4797;
533 return std::pow((theta - std::sin(theta)), 5.0 / 3.0) / (2.0 *
PI) /
534 std::pow(theta, 2.0 / 3.0);
539 if (psi >= 1.0)
return 1.0;
540 if (psi <= 0.0)
return 0.0;
542 theta = std::pow(124.4797 * psi, 3.0 / 13.0);
543 return theta * theta * theta / 37.6911;
546 return (theta - std::sin(theta)) / (2.0 *
PI);
554 double alpha = a / xs.
a_full;
555 double alpha1 = alpha - 0.001;
556 double alpha2 = alpha + 0.001;
557 if (alpha1 < 0.0) alpha1 = 0.0;
558 double a1 = alpha1 * xs.
a_full;
559 double a2 = alpha2 * xs.
a_full;
564 const double* table,
int n_items)
const {
565 double alpha = a / xs.
a_full;
566 double delta = 1.0 /
static_cast<double>(n_items - 1);
567 int i =
static_cast<int>(alpha / delta);
568 if (i >= n_items - 1) i = n_items - 2;
569 double dSdA = (table[i + 1] - table[i]) / delta;
583 double alpha = a / xs.
a_full;
589 double alpha = a / xs.
a_full;
595 double psi = s / xs.
s_full;
596 if (psi == 0.0)
return 0.0;
597 if (psi >= 1.0)
return xs.
a_full;
603 double alpha = a / xs.
a_full;
604 if (alpha <= 1.0e-30)
return 1.0e-30;
607 double p = theta * xs.
y_full / 2.0;
609 double dPdA = 4.0 / xs.
y_full / (1.0 - std::cos(theta));
610 return (5.0 / 3.0 - (2.0 / 3.0) * dPdA * r) * std::pow(r, 2.0 / 3.0);
642 double r = 0.25 * t.
y_full *
666 double alpha = a / xs.
a_full;
671 return (5.0 / 3.0 - (2.0 / 3.0) * (2.0 / xs.
w_max) * r) * std::pow(r, 2.0 / 3.0);
677 return a * std::pow(r, 2.0 / 3.0);
684 return (5.0 / 3.0 - (2.0 / 3.0) * dPdA * r) * std::pow(r, 2.0 / 3.0);
702 if (a <= xs.
a_bot)
return std::sqrt(a / xs.
s_bot);
707 if (a <= 0.0)
return 0.0;
727 if (a / xs.
a_full > alfMax)
729 (a / xs.
a_full - alfMax) / (1.0 - alfMax);
735 double alpha = a / xs.
a_full;
741 else dPdA = xs.
r_bot / std::sqrt(a * xs.
s_bot);
743 return (5.0 / 3.0 - (2.0 / 3.0) * dPdA * r) * std::pow(r, 2.0 / 3.0);
759 double theta1 = 2.0 * std::acos(1.0 -
y / xs.
r_bot);
760 return 0.5 * xs.
r_bot * xs.
r_bot * (theta1 - std::sin(theta1));
765 return 2.0 * std::sqrt(
y * (2.0 * xs.
r_bot -
y));
769 if (a <= 0.0)
return 0.0;
772 double theta1 = 2.0 * std::asin(xs.
w_max / 2.0 / xs.
r_bot);
773 double p = xs.
r_bot * theta1 + 2.0 * y1;
779 double theta1 = 2.0 * std::acos(1.0 - y1 / xs.
r_bot);
780 double p = xs.
r_bot * theta1;
785 if (
y <= 0.0)
return 0.0;
787 double theta1 = 2.0 * std::acos(1.0 -
y / xs.
r_bot);
788 return 0.5 * xs.
r_bot * (1.0 - std::sin(theta1)) / theta1;
793 if (a / xs.
a_full > alfMax)
795 (a / xs.
a_full - alfMax) / (1.0 - alfMax);
799 double alpha = a / aFull;
800 double sFull = xs.
s_bot;
807 if (a / xs.
a_full > alfMax)
811 double dPdA = 2.0 / xs.
w_max;
812 return (5.0 / 3.0 - (2.0 / 3.0) * dPdA * r) * std::pow(r, 2.0 / 3.0);
828 y1 = 2.0 * xs.
r_bot * y1;
835 double theta1 = 2.0 * std::acos(1.0 - y1 / xs.
r_bot);
836 double a1 = 0.5 * xs.
r_bot * xs.
r_bot * (theta1 - std::sin(theta1));
841 if (
y <= 0.0)
return 0.0;
844 return 2.0 * std::sqrt(y1 * (2.0 * xs.
r_bot - y1));
851 double theta1 = 2.0 * std::acos(1.0 - y1 / xs.
r_bot);
854 p = p + 2.0 * y1 + xs.
w_max;
859 if (a <= xs.a_full - xs.a_bot && a / xs.a_full > 1.0e-30) {
860 double r = a / (xs.
w_max + 2.0 * a / xs.
w_max);
861 double dPdA = 2.0 / xs.
w_max;
862 return (5.0 / 3.0 - (2.0 / 3.0) * dPdA * r) * std::pow(r, 2.0 / 3.0);
897 return (5.0 / 3.0 - (2.0 / 3.0) * dPdA * r) * std::pow(r, 2.0 / 3.0);
913 return std::sqrt(a / xs.
s_bot);
927 double dPdA = xs.
r_bot / std::sqrt(a * xs.
s_bot);
928 return (5.0 / 3.0 - (2.0 / 3.0) * dPdA * r) * std::pow(r, 2.0 / 3.0);
944 return std::pow((3.0 / 4.0) * a / xs.
r_bot, 2.0 / 3.0);
949 double x = 2.0 * std::sqrt(
y) / xs.
r_bot;
950 double t = std::sqrt(1.0 + x * x);
951 return 0.5 * xs.
r_bot * xs.
r_bot * (x * t + std::log(x + t));
955 if (
y <= 0.0)
return 0.0;
960 if (a <= 0.0)
return 0.0;
977 return std::pow(a / xs.
r_bot, 1.0 / (xs.
s_bot + 1.0));
982 double dy1 = 0.02 * xs.
y_full;
985 double p = 0.0, y1 = 0.0, x1 = 0.0;
986 double x2, y2, dx, dy;
990 x2 = h * std::pow(y2, m);
993 p += std::sqrt(dx * dx + dy * dy);
1001 if (
y <= 0.0)
return 0.0;
1006 if (a <= 0.0)
return 0.0;
1015 if (
y <= 0.0)
return 0.0;
1019 if (xs.
y_full <= 0.0)
return 0.0;
1020 double y_norm =
y / xs.
y_full;
1063 default:
return 0.0;
1072 double y_norm =
y / xs.
y_full;
1119 default:
return 0.0;
1128 double y_norm =
y / xs.
y_full;
1135 if (xs.
y_bot == 0.0)
1175 if (a <= 0.0)
return 0.0;
1176 double alpha = a / xs.
a_full;
1218 default:
return 0.0;
1227 double alpha = a / xs.
a_full;
1251 if (a == 0.0)
return 0.0;
1253 if (r <
TINY)
return 0.0;
1254 return a * std::pow(r, 2.0 / 3.0);
1264 if (a <= 0.0)
return 0.0;
1286 if (s <
TINY || a <
TINY)
return 0.0;
1287 return std::pow(s / a, 3.0 / 2.0);
1330 double psi = s / xs.
s_full;
1331 if (s <= 0.0)
return 0.0;
1371 double a = 0.5 * (a1 + a2);
1372 double tol = 0.0001 * xs.
a_full;
1373 findroot_Newton(a1, a2, &a, tol, [&](
double aa,
double* f,
double* df) {
1397 if (q <= 0.0)
return 0.0;
1399 if (q2g == 0.0)
return 0.0;
1406 y = std::pow(q2g / (xs.
w_max * xs.
w_max), 1.0 / 3.0);
1409 y = std::pow(2.0 * q2g / (xs.
s_bot * xs.
s_bot), 1.0 / 5.0);
1412 y = std::pow(27.0 / 32.0 * q2g / (xs.
r_bot * xs.
r_bot), 1.0 / 4.0);
1415 y = 1.0 / (2.0 * xs.
s_bot + 3.0);
1420 auto qCritical = [&](
double yc,
double qTarget) ->
double {
1423 if (w > 0.0)
return a * std::sqrt(
GRAVITY * a / w) - qTarget;
1428 double y0 = 1.01 * std::pow(q2g / xs.
y_full, 0.25);
1434 if (r >= 0.5 && r <= 2.0) {
1436 constexpr int N_INC = 25;
1437 double dy = xs.
y_full / N_INC;
1438 int i1 =
static_cast<int>(y0 / dy);
1439 double q0 = qCritical(i1 * dy, 0.0);
1442 for (
int i = i1 + 1; i <= N_INC; ++i) {
1443 double qc = qCritical(i * dy, 0.0);
1445 y = ((q - q0) / (qc - q0) +
static_cast<double>(i - 1)) * dy;
1452 for (
int i = i1 - 1; i >= 0; --i) {
1453 double qc = qCritical(i * dy, 0.0);
1455 y = ((q - qc) / (q0 - qc) +
static_cast<double>(i)) * dy;
1464 double y2 = 0.99 * xs.
y_full;
1465 double q2 = qCritical(y2, 0.0);
1466 if (q2 < q) {
y = xs.
y_full;
break; }
1467 double q0 = qCritical(y0, 0.0);
1468 double q1 = qCritical(0.5 * xs.
y_full, 0.0);
1471 if (q1 < q) y1 = 0.5 * xs.
y_full;
1474 if (q1 > q) y2 = 0.5 * xs.
y_full;
1477 [&](
double yc) {
return qCritical(yc, q); });
1482 return std::min(
y, xs.
y_full);
#define OPENSWMM_KERNEL_FN
Definition ExplicitKokkosSurfaceSolver.cpp:18
Structure-of-Arrays (SoA) storage for all link types.
Bit-exact geometry-table interpolation — the single source of truth.
#define SIGN(a, b)
Definition findroot.c:16
#define MAXIT
Definition findroot.c:17
The analytic shape formulas — the single definition of each.
Definition XSectKernels.hpp:111
OPENSWMM_KERNEL_FN double rectClosedWofY(double y_norm, double w_max)
Definition XSectKernels.hpp:168
OPENSWMM_KERNEL_FN double trapezRofY(double y, double y_bot, double s_bot, double r_bot)
Definition XSectKernels.hpp:154
OPENSWMM_KERNEL_FN double trapezAofY(double y, double y_bot, double s_bot)
Definition XSectKernels.hpp:119
OPENSWMM_KERNEL_FN double rectAofY(double y, double w_max)
Definition XSectKernels.hpp:115
OPENSWMM_KERNEL_FN double trapezWofY(double y, double y_bot, double s_bot)
Definition XSectKernels.hpp:173
OPENSWMM_KERNEL_FN double triangWofY(double y, double s_bot)
Definition XSectKernels.hpp:177
OPENSWMM_KERNEL_FN double parabAofY(double y, double r_bot)
Definition XSectKernels.hpp:127
OPENSWMM_KERNEL_FN double powerfuncWofY(double y, double s_bot, double r_bot)
Definition XSectKernels.hpp:185
OPENSWMM_KERNEL_FN double powerfuncAofY(double y, double s_bot, double r_bot)
Definition XSectKernels.hpp:131
OPENSWMM_KERNEL_FN double rectClosedRofA(double a, double w_max, double a_full)
Definition XSectKernels.hpp:139
OPENSWMM_KERNEL_FN double parabWofY(double y, double r_bot)
Definition XSectKernels.hpp:181
OPENSWMM_KERNEL_FN double rectOpenRofA(double a, double w_max, double s_bot)
Definition XSectKernels.hpp:149
OPENSWMM_KERNEL_FN double triangAofY(double y, double s_bot)
Definition XSectKernels.hpp:123
OPENSWMM_KERNEL_FN double triangRofY(double y, double s_bot, double r_bot)
Definition XSectKernels.hpp:160
Definition XSectBatch.hpp:149
const XsectEval & hostEval()
Definition XSection.cpp:209
const XsectTables & hostTables()
Definition XSection.cpp:114
constexpr double TINY
Definition XSectKernels.hpp:79
constexpr double RECT_ROUND_ALFMAX
Definition XSectKernels.hpp:85
constexpr double RECT_ALFMAX
Definition XSectKernels.hpp:83
constexpr double GRAVITY
Definition XSectKernels.hpp:81
double lookup_exact(double x, const double *t, int n) noexcept
Bit-exact transliteration of legacy xsect.c:lookup().
Definition XSectLookup.hpp:70
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.
Definition XSectLookup.hpp:261
constexpr double RECT_TRIANG_ALFMAX
Definition XSectKernels.hpp:84
LutId
Pointers to the shared geometry tables, in whichever memory space the consumer runs in.
Definition XSectKernels.hpp:209
@ S_Egg
Definition XSectKernels.hpp:218
@ A_Arch
Definition XSectKernels.hpp:216
@ Y_Gothic
Definition XSectKernels.hpp:210
@ A_VertEllipse
Definition XSectKernels.hpp:215
@ COUNT
Definition XSectKernels.hpp:225
@ Y_SemiCirc
Definition XSectKernels.hpp:213
@ A_HorizEllipse
Definition XSectKernels.hpp:214
@ S_SemiEllip
Definition XSectKernels.hpp:222
@ S_Catenary
Definition XSectKernels.hpp:221
@ Y_SemiEllip
Definition XSectKernels.hpp:212
@ S_Gothic
Definition XSectKernels.hpp:220
@ S_Circ
Definition XSectKernels.hpp:217
@ S_BasketHandle
Definition XSectKernels.hpp:223
@ S_Horseshoe
Definition XSectKernels.hpp:219
@ S_SemiCirc
Definition XSectKernels.hpp:224
@ Y_Catenary
Definition XSectKernels.hpp:211
int locate_bisect(double y, const double *table, int jLast) noexcept
Definition XSectLookup.hpp:201
constexpr double PI
Definition XSectKernels.hpp:80
XSectShape
Definition XSectBatch.hpp:77
@ TRIANGULAR
Definition XSectBatch.hpp:84
@ RECT_CLOSED
Definition XSectBatch.hpp:81
@ POWERFUNC
Definition XSectBatch.hpp:86
@ ARCH
Definition XSectBatch.hpp:92
@ FORCE_MAIN
Definition XSectBatch.hpp:102
@ RECT_OPEN
Definition XSectBatch.hpp:82
@ BASKETHANDLE
Definition XSectBatch.hpp:98
@ STREET_XSECT
Definition XSectBatch.hpp:103
@ SEMICIRCULAR
Definition XSectBatch.hpp:99
@ IRREGULAR
Definition XSectBatch.hpp:100
@ MOD_BASKET
Definition XSectBatch.hpp:89
@ HORIZ_ELLIPSE
Definition XSectBatch.hpp:90
@ VERT_ELLIPSE
Definition XSectBatch.hpp:91
@ CUSTOM
Definition XSectBatch.hpp:101
@ RECT_ROUND
Definition XSectBatch.hpp:88
@ EGGSHAPED
Definition XSectBatch.hpp:93
@ SEMIELLIPTICAL
Definition XSectBatch.hpp:97
@ CATENARY
Definition XSectBatch.hpp:96
@ CIRCULAR
Definition XSectBatch.hpp:79
@ TRAPEZOIDAL
Definition XSectBatch.hpp:83
@ HORSESHOE
Definition XSectBatch.hpp:94
@ DUMMY
Definition XSectBatch.hpp:78
@ PARABOLIC
Definition XSectBatch.hpp:85
@ RECT_TRIANG
Definition XSectBatch.hpp:87
@ FILLED_CIRCULAR
Definition XSectBatch.hpp:80
@ GOTHIC
Definition XSectBatch.hpp:95
double * y
Definition odesolve.c:28
Definition XSectBatch.hpp:110
double s_full
Section factor when full (ft^4/3)
Definition XSectBatch.hpp:120
double s_bot
Slope of bottom section / exponent.
Definition XSectBatch.hpp:125
const double * hrad_tbl
Normalized hyd-radius vs y/y_full.
Definition XSectBatch.hpp:135
int transect_tbl_size
Entry count of the tables above.
Definition XSectBatch.hpp:137
const double * width_tbl
Normalized width vs y/y_full.
Definition XSectBatch.hpp:136
double a_full
Area when full (ft2)
Definition XSectBatch.hpp:118
double r_bot
Radius of bottom section / coefficient.
Definition XSectBatch.hpp:126
double s_max
Section factor at max flow (ft^4/3)
Definition XSectBatch.hpp:121
int type
Definition XSectBatch.hpp:111
double a_bot
Area of bottom section.
Definition XSectBatch.hpp:124
const xsect::LocateLut * area_lut
Definition XSectBatch.hpp:142
double w_max
Width at widest point (ft)
Definition XSectBatch.hpp:116
double y_bot
Depth of bottom section / fill depth.
Definition XSectBatch.hpp:123
double y_full
Full depth (ft)
Definition XSectBatch.hpp:115
double r_full
Hydraulic radius when full (ft)
Definition XSectBatch.hpp:119
const double * area_tbl
Normalized area vs y/y_full.
Definition XSectBatch.hpp:134
Definition XSectLookup.hpp:182
The geometry layer itself, parameterized on where its tables live.
Definition XSectKernels.hpp:328
OPENSWMM_KERNEL_FN double getRofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:1127
OPENSWMM_KERNEL_FN double filled_circ_getAofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:619
OPENSWMM_KERNEL_FN double rect_triang_getYofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:701
OPENSWMM_KERNEL_FN double rect_open_getdSdA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:680
OPENSWMM_KERNEL_FN double rect_triang_getRofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:706
OPENSWMM_KERNEL_FN double tabular_getdSdA(const XSectParams &xs, double a, const double *table, int n_items) const
Definition XSectKernels.hpp:563
OPENSWMM_KERNEL_FN double parab_getRofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:959
OPENSWMM_KERNEL_FN double rect_open_getSofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:674
OPENSWMM_KERNEL_FN double filled_circ_getRofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:636
OPENSWMM_KERNEL_FN double rect_round_getYofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:750
OPENSWMM_KERNEL_FN double mod_basket_getdSdA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:858
OPENSWMM_KERNEL_FN bool isOpen(int type) const
Definition XSectKernels.hpp:1489
OPENSWMM_KERNEL_FN double rect_round_getWofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:763
OPENSWMM_KERNEL_FN double mod_basket_getWofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:840
OPENSWMM_KERNEL_FN double rect_round_getRofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:784
OPENSWMM_KERNEL_FN double generic_getdSdA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:553
OPENSWMM_KERNEL_FN double rect_triang_getRofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:716
OPENSWMM_KERNEL_FN double powerfunc_getWofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:972
OPENSWMM_KERNEL_FN double lookup(double x, const double *table, int n_items) const
Definition XSectKernels.hpp:417
OPENSWMM_KERNEL_FN double findroot_Ridder(double x1, double x2, double xacc, Func func) const
Definition XSectKernels.hpp:375
OPENSWMM_KERNEL_FN double filled_circ_getYofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:628
OPENSWMM_KERNEL_FN double parab_getPofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:948
OPENSWMM_KERNEL_FN double trapez_getWofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:875
OPENSWMM_KERNEL_FN double getYcircular(double alpha) const
Definition XSectKernels.hpp:512
OPENSWMM_KERNEL_FN double circ_getAofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:577
OPENSWMM_KERNEL_FN double powerfunc_getAofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:968
OPENSWMM_KERNEL_FN double circ_getAofS(const XSectParams &xs, double s) const
Definition XSectKernels.hpp:594
OPENSWMM_KERNEL_FN int locate(double y, const double *table, int jLast) const
Definition XSectKernels.hpp:412
OPENSWMM_KERNEL_FN double getAcircular(double psi) const
Definition XSectKernels.hpp:537
OPENSWMM_KERNEL_FN double trapez_getRofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:889
OPENSWMM_KERNEL_FN double rect_triang_getSofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:725
OPENSWMM_KERNEL_FN double rect_round_getAofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:757
OPENSWMM_KERNEL_FN double trapez_getYofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:879
OPENSWMM_KERNEL_FN double mod_basket_getYofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:822
OPENSWMM_KERNEL_FN double trapez_getAofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:871
OPENSWMM_KERNEL_FN double getWofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:1071
OPENSWMM_KERNEL_FN double rect_triang_getdSdA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:733
OPENSWMM_KERNEL_FN double powerfunc_getYofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:976
OPENSWMM_KERNEL_FN double getSofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:1226
OPENSWMM_KERNEL_FN double powerfunc_getRofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:1005
OPENSWMM_KERNEL_FN double getThetaOfAlpha(double alpha) const
Definition XSectKernels.hpp:476
OPENSWMM_KERNEL_FN double getAofS(const XSectParams &xs, double s) const
Definition XSectKernels.hpp:1329
OPENSWMM_KERNEL_FN double getAmax(const XSectParams &xs) const
Definition XSectKernels.hpp:1386
OPENSWMM_KERNEL_FN double rect_triang_getAofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:691
OPENSWMM_KERNEL_FN double triang_getWofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:908
OPENSWMM_KERNEL_FN double getRofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:1263
OPENSWMM_KERNEL_FN double rect_round_getRofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:768
OPENSWMM_KERNEL_FN double triang_getYofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:912
OPENSWMM_KERNEL_FN double triang_getdSdA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:924
OPENSWMM_KERNEL_FN double triang_getRofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:920
OPENSWMM_KERNEL_FN double mod_basket_getAofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:832
OPENSWMM_KERNEL_FN double getThetaOfPsi(double psi) const
Definition XSectKernels.hpp:491
OPENSWMM_KERNEL_FN double rect_closed_getRofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:654
OPENSWMM_KERNEL_FN double parab_getYofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:943
OPENSWMM_KERNEL_FN double getYcrit(const XSectParams &xs, double q) const
Definition XSectKernels.hpp:1396
OPENSWMM_KERNEL_FN double rect_round_getSofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:791
OPENSWMM_KERNEL_FN double getAofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:1014
OPENSWMM_KERNEL_FN double rect_closed_getSofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:658
OPENSWMM_KERNEL_FN double invLookup(double y, const double *table, int n_items, const LocateLut *lut=nullptr) const
Definition XSectKernels.hpp:444
OPENSWMM_KERNEL_FN double parab_getWofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:939
OPENSWMM_KERNEL_FN double getYofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:1174
OPENSWMM_KERNEL_FN double rect_round_getdSdA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:805
OPENSWMM_KERNEL_FN double rect_closed_getdSdA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:665
OPENSWMM_KERNEL_FN double circ_getSofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:588
OPENSWMM_KERNEL_FN double triang_getRofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:916
OPENSWMM_KERNEL_FN double trapez_getRofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:885
XsectTables tbl
Definition XSectKernels.hpp:329
OPENSWMM_KERNEL_FN double triang_getAofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:904
OPENSWMM_KERNEL_FN double parab_getRofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:954
OPENSWMM_KERNEL_FN double circ_getdSdA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:602
OPENSWMM_KERNEL_FN int findroot_Newton(double x1, double x2, double *rts, double xacc, Func func) const
Definition XSectKernels.hpp:337
OPENSWMM_KERNEL_FN double mod_basket_getRofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:847
OPENSWMM_KERNEL_FN double trapez_getdSdA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:893
OPENSWMM_KERNEL_FN double circ_getYofA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:582
OPENSWMM_KERNEL_FN double getdSdA(const XSectParams &xs, double a) const
Definition XSectKernels.hpp:1296
OPENSWMM_KERNEL_FN double parab_getAofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:935
OPENSWMM_KERNEL_FN double getScircular(double alpha) const
Definition XSectKernels.hpp:524
OPENSWMM_KERNEL_FN double powerfunc_getPofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:981
OPENSWMM_KERNEL_FN double rect_triang_getWofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:696
OPENSWMM_KERNEL_FN double powerfunc_getRofY(const XSectParams &xs, double y) const
Definition XSectKernels.hpp:1000
Definition XSectKernels.hpp:228
int N_W_VertEllipse
Definition XSectKernels.hpp:305
int N_Y_Catenary
Definition XSectKernels.hpp:307
const double * S_Catenary
Definition XSectKernels.hpp:244
const double * A_HorizEllipse
Definition XSectKernels.hpp:233
int N_W_Horseshoe
Definition XSectKernels.hpp:302
const double * W_Gothic
Definition XSectKernels.hpp:256
const double * Y_Gothic
Definition XSectKernels.hpp:266
const double * R_Egg
Definition XSectKernels.hpp:239
const double * Y_SemiEllip
Definition XSectKernels.hpp:269
int N_W_Circ
Definition XSectKernels.hpp:298
const double * R_Arch
Definition XSectKernels.hpp:236
const double * A_Baskethandle
Definition XSectKernels.hpp:230
int N_W_SemiEllip
Definition XSectKernels.hpp:304
const double * R_Circ
Definition XSectKernels.hpp:238
int N_S_Circ
Definition XSectKernels.hpp:289
int N_W_Gothic
Definition XSectKernels.hpp:300
const double * Amax
Definition XSectKernels.hpp:270
const double * Y_Egg
Definition XSectKernels.hpp:265
int N_W_BasketHandle
Definition XSectKernels.hpp:296
int N_R_Horseshoe
Definition XSectKernels.hpp:285
int N_W_HorizEllipse
Definition XSectKernels.hpp:301
const double * A_Arch
Definition XSectKernels.hpp:229
const double * R_HorizEllipse
Definition XSectKernels.hpp:240
const LocateLut * luts
Bucket maps for the inverted tables, indexed by LutId; null == bisect.
Definition XSectKernels.hpp:272
int N_W_Catenary
Definition XSectKernels.hpp:297
const double * S_SemiEllip
Definition XSectKernels.hpp:250
int N_Y_Circ
Definition XSectKernels.hpp:308
const double * W_HorizEllipse
Definition XSectKernels.hpp:257
int N_R_Circ
Definition XSectKernels.hpp:282
const double * W_Circ
Definition XSectKernels.hpp:254
const double * R_Baskethandle
Definition XSectKernels.hpp:237
int N_S_Catenary
Definition XSectKernels.hpp:288
const double * S_Egg
Definition XSectKernels.hpp:246
int N_A_Egg
Definition XSectKernels.hpp:276
const double * S_Horseshoe
Definition XSectKernels.hpp:248
int N_Y_BasketHandle
Definition XSectKernels.hpp:306
const double * Y_SemiCirc
Definition XSectKernels.hpp:268
int N_Y_Egg
Definition XSectKernels.hpp:309
const double * R_Horseshoe
Definition XSectKernels.hpp:241
int N_W_Arch
Definition XSectKernels.hpp:295
const double * W_VertEllipse
Definition XSectKernels.hpp:261
int N_A_Arch
Definition XSectKernels.hpp:273
const double * A_Circ
Definition XSectKernels.hpp:231
const double * S_Gothic
Definition XSectKernels.hpp:247
const double * Y_BasketHandle
Definition XSectKernels.hpp:262
OPENSWMM_KERNEL_FN const LocateLut * lut(LutId id) const
The bucket map for one inverted table, or null when none was built.
Definition XSectKernels.hpp:316
const double * Y_Horseshoe
Definition XSectKernels.hpp:267
int N_S_BasketHandle
Definition XSectKernels.hpp:287
int N_S_SemiEllip
Definition XSectKernels.hpp:294
int N_A_VertEllipse
Definition XSectKernels.hpp:279
int N_A_Horseshoe
Definition XSectKernels.hpp:278
const double * W_Arch
Definition XSectKernels.hpp:251
const double * Y_Circ
Definition XSectKernels.hpp:264
int N_A_Baskethandle
Definition XSectKernels.hpp:274
int N_W_SemiCirc
Definition XSectKernels.hpp:303
const double * R_VertEllipse
Definition XSectKernels.hpp:242
int N_S_Gothic
Definition XSectKernels.hpp:291
const double * W_Catenary
Definition XSectKernels.hpp:253
const double * S_SemiCirc
Definition XSectKernels.hpp:249
const double * A_VertEllipse
Definition XSectKernels.hpp:235
int N_A_Circ
Definition XSectKernels.hpp:275
int N_S_Horseshoe
Definition XSectKernels.hpp:292
int N_R_Arch
Definition XSectKernels.hpp:280
const double * A_Egg
Definition XSectKernels.hpp:232
int N_R_Baskethandle
Definition XSectKernels.hpp:281
const double * S_Circ
Definition XSectKernels.hpp:245
int N_Y_SemiEllip
Definition XSectKernels.hpp:313
int N_W_Egg
Definition XSectKernels.hpp:299
const double * Y_Catenary
Definition XSectKernels.hpp:263
const double * W_BasketHandle
Definition XSectKernels.hpp:252
int N_R_VertEllipse
Definition XSectKernels.hpp:286
const double * W_SemiCirc
Definition XSectKernels.hpp:259
int N_R_HorizEllipse
Definition XSectKernels.hpp:284
int N_Y_Horseshoe
Definition XSectKernels.hpp:311
const double * W_Horseshoe
Definition XSectKernels.hpp:258
int N_S_Egg
Definition XSectKernels.hpp:290
const double * A_Horseshoe
Definition XSectKernels.hpp:234
int N_Y_SemiCirc
Definition XSectKernels.hpp:312
int N_S_SemiCirc
Definition XSectKernels.hpp:293
const double * S_BasketHandle
Definition XSectKernels.hpp:243
int N_R_Egg
Definition XSectKernels.hpp:283
const double * W_Egg
Definition XSectKernels.hpp:255
const double * W_SemiEllip
Definition XSectKernels.hpp:260
int N_A_HorizEllipse
Definition XSectKernels.hpp:277
int N_Y_Gothic
Definition XSectKernels.hpp:310