OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::xsect_batch Namespace Reference

Functions

void area_circular (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT y_full, const double *OPENSWMM_RESTRICT a_full, double *OPENSWMM_RESTRICT area, int count)
 Batch area for CIRCULAR/FORCE_MAIN — lookup table interpolation.
 
void area_rect (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT w_max, double *OPENSWMM_RESTRICT area, int count)
 Batch area for RECT_CLOSED / RECT_OPEN: area = depth * w_max.
 
void area_trapezoidal (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT y_bot, const double *OPENSWMM_RESTRICT s_bot, double *OPENSWMM_RESTRICT area, int count)
 Batch area for TRAPEZOIDAL: area = (y_bot + s_bot * depth) * depth.
 
void area_triangular (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT s_bot, double *OPENSWMM_RESTRICT area, int count)
 Batch area for TRIANGULAR: area = s_bot * depth^2.
 
void area_parabolic (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT r_bot, double *OPENSWMM_RESTRICT area, int count)
 Batch area for PARABOLIC: area = (4/3) * r_bot * depth^(3/2).
 
void area_powerfunc (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT s_bot, const double *OPENSWMM_RESTRICT r_bot, double *OPENSWMM_RESTRICT area, int count)
 Batch area for POWERFUNC: area = r_bot * depth^(s_bot+1).
 
void area_tabulated (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT y_full, const double *OPENSWMM_RESTRICT a_full, const double *table, int table_size, double *OPENSWMM_RESTRICT area, int count)
 Batch area for any tabulated shape (egg, horseshoe, arch, ellipse, etc.).
 
void area_inv_tabulated (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT nrm, const double *OPENSWMM_RESTRICT a_full, const double *table, int table_size, const xsect::LocateLut *lut, double *OPENSWMM_RESTRICT area, int count)
 
void perlink_tabulated_pair (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT nrm, const double *OPENSWMM_RESTRICT scale_a, const double *OPENSWMM_RESTRICT scale_b, const double *const *tables_a, const double *const *tables_b, int table_size, double *OPENSWMM_RESTRICT out_a, double *OPENSWMM_RESTRICT out_b, int count)
 
void perlink_tabulated (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT nrm, const double *OPENSWMM_RESTRICT scale, const double *const *tables, int table_size, double *OPENSWMM_RESTRICT result, int count)
 Per-link tabulated lookup (for IRREGULAR shapes where each link has its own table).
 
void hydrad_circular (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT nrm, const double *OPENSWMM_RESTRICT r_full, double *OPENSWMM_RESTRICT hydrad, int count)
 
void area_hydrad_circular (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT y_full, const double *OPENSWMM_RESTRICT a_full, const double *OPENSWMM_RESTRICT r_full, double *OPENSWMM_RESTRICT area, double *OPENSWMM_RESTRICT hydrad, int count)
 Fused area + hydraulic radius for CIRCULAR/FORCE_MAIN (shared table index).
 
void hydrad_trapezoidal (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT y_bot, const double *OPENSWMM_RESTRICT s_bot, const double *OPENSWMM_RESTRICT r_bot, double *OPENSWMM_RESTRICT hydrad, int count)
 
void hydrad_triangular (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT s_bot, const double *OPENSWMM_RESTRICT r_bot, double *OPENSWMM_RESTRICT hydrad, int count)
 
void hydrad_rect (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT w_max, double *OPENSWMM_RESTRICT hydrad, int count)
 
void hydrad_rect_closed (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT w_max, const double *OPENSWMM_RESTRICT a_full, double *OPENSWMM_RESTRICT hydrad, int count)
 
void hydrad_rect_open (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT w_max, const double *OPENSWMM_RESTRICT s_bot, double *OPENSWMM_RESTRICT hydrad, int count)
 
void width_rect_closed (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT nrm, const double *OPENSWMM_RESTRICT w_max, double *OPENSWMM_RESTRICT width, int count)
 
void hydrad_tabulated (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT nrm, const double *OPENSWMM_RESTRICT r_full, const double *table, int table_size, double *OPENSWMM_RESTRICT hydrad, int count)
 
void width_circular (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT nrm, const double *OPENSWMM_RESTRICT w_max, double *OPENSWMM_RESTRICT width, int count)
 
void width_trapezoidal (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT y_bot, const double *OPENSWMM_RESTRICT s_bot, double *OPENSWMM_RESTRICT width, int count)
 
void width_triangular (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT s_bot, double *OPENSWMM_RESTRICT width, int count)
 
void width_rect (const double *OPENSWMM_RESTRICT w_max, double *OPENSWMM_RESTRICT width, int count)
 
void width_tabulated (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT nrm, const double *OPENSWMM_RESTRICT w_max, const double *table, int table_size, double *OPENSWMM_RESTRICT width, int count)
 
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).
 
double norm_x (double depth, double param) noexcept
 

Function Documentation

◆ area_circular()

void openswmm::xsect_batch::area_circular ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT y_full,
const double *OPENSWMM_RESTRICT a_full,
double *OPENSWMM_RESTRICT area,
int count )

Batch area for CIRCULAR/FORCE_MAIN — lookup table interpolation.

For each element i: area[i] = a_full[i] * lookup(depth[i]/y_full[i]). The inner loop is written for auto-vectorisation (no branches, no function calls except for the quadratic refinement at small depths).

Here is the call graph for this function:

◆ area_hydrad_circular()

void openswmm::xsect_batch::area_hydrad_circular ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT nrm,
const double *OPENSWMM_RESTRICT a_full,
const double *OPENSWMM_RESTRICT r_full,
double *OPENSWMM_RESTRICT area,
double *OPENSWMM_RESTRICT hydrad,
int count )

Fused area + hydraulic radius for CIRCULAR/FORCE_MAIN (shared table index).

Here is the call graph for this function:

◆ area_inv_tabulated()

void openswmm::xsect_batch::area_inv_tabulated ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT y_full,
const double *OPENSWMM_RESTRICT a_full,
const double * table,
int table_size,
const xsect::LocateLut * lut,
double *OPENSWMM_RESTRICT area,
int count )

Batch area for shapes using invLookup (gothic, catenary, semielliptical, semicircular).

Parameters
lutBucket map for table (plan A1), or null to bisect.
Here is the call graph for this function:

◆ area_parabolic()

void openswmm::xsect_batch::area_parabolic ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT r_bot,
double *OPENSWMM_RESTRICT area,
int count )

Batch area for PARABOLIC: area = (4/3) * r_bot * depth^(3/2).

Here is the call graph for this function:

◆ area_powerfunc()

void openswmm::xsect_batch::area_powerfunc ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT s_bot,
const double *OPENSWMM_RESTRICT r_bot,
double *OPENSWMM_RESTRICT area,
int count )

Batch area for POWERFUNC: area = r_bot * depth^(s_bot+1).

Here is the call graph for this function:

◆ area_rect()

void openswmm::xsect_batch::area_rect ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT w_max,
double *OPENSWMM_RESTRICT area,
int count )

Batch area for RECT_CLOSED / RECT_OPEN: area = depth * w_max.

Here is the call graph for this function:

◆ area_tabulated()

void openswmm::xsect_batch::area_tabulated ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT nrm,
const double *OPENSWMM_RESTRICT a_full,
const double * table,
int table_size,
double *OPENSWMM_RESTRICT area,
int count )

Batch area for any tabulated shape (egg, horseshoe, arch, ellipse, etc.).

Here is the call graph for this function:

◆ area_trapezoidal()

void openswmm::xsect_batch::area_trapezoidal ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT y_bot,
const double *OPENSWMM_RESTRICT s_bot,
double *OPENSWMM_RESTRICT area,
int count )

Batch area for TRAPEZOIDAL: area = (y_bot + s_bot * depth) * depth.

Here is the call graph for this function:

◆ area_triangular()

void openswmm::xsect_batch::area_triangular ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT s_bot,
double *OPENSWMM_RESTRICT area,
int count )

Batch area for TRIANGULAR: area = s_bot * depth^2.

Here is the call graph for this function:

◆ hydrad_circular()

void openswmm::xsect_batch::hydrad_circular ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT nrm,
const double *OPENSWMM_RESTRICT r_full,
double *OPENSWMM_RESTRICT hydrad,
int count )
Here is the call graph for this function:

◆ hydrad_rect()

void openswmm::xsect_batch::hydrad_rect ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT w_max,
double *OPENSWMM_RESTRICT hydrad,
int count )

◆ hydrad_rect_closed()

void openswmm::xsect_batch::hydrad_rect_closed ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT w_max,
const double *OPENSWMM_RESTRICT a_full,
double *OPENSWMM_RESTRICT hydrad,
int count )
Here is the call graph for this function:

◆ hydrad_rect_open()

void openswmm::xsect_batch::hydrad_rect_open ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT w_max,
const double *OPENSWMM_RESTRICT s_bot,
double *OPENSWMM_RESTRICT hydrad,
int count )
Here is the call graph for this function:

◆ hydrad_tabulated()

void openswmm::xsect_batch::hydrad_tabulated ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT nrm,
const double *OPENSWMM_RESTRICT r_full,
const double * table,
int table_size,
double *OPENSWMM_RESTRICT hydrad,
int count )
Here is the call graph for this function:

◆ hydrad_trapezoidal()

void openswmm::xsect_batch::hydrad_trapezoidal ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT y_bot,
const double *OPENSWMM_RESTRICT s_bot,
const double *OPENSWMM_RESTRICT r_bot,
double *OPENSWMM_RESTRICT hydrad,
int count )
Here is the call graph for this function:

◆ hydrad_triangular()

void openswmm::xsect_batch::hydrad_triangular ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT s_bot,
const double *OPENSWMM_RESTRICT r_bot,
double *OPENSWMM_RESTRICT hydrad,
int count )
Here is the call graph for this function:

◆ norm_lookup()

double openswmm::xsect::norm_lookup ( double depth,
double param,
const double * t,
int n )
inlinenoexcept

Mode-aware normalize + table lookup (bit-exact by default; §6 fast if opted in).

Here is the caller graph for this function:

◆ norm_x()

double openswmm::xsect::norm_x ( double depth,
double param )
inlinenoexcept
Here is the caller graph for this function:

◆ perlink_tabulated()

void openswmm::xsect_batch::perlink_tabulated ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT nrm,
const double *OPENSWMM_RESTRICT scale,
const double *const * tables,
int table_size,
double *OPENSWMM_RESTRICT result,
int count )

Per-link tabulated lookup (for IRREGULAR shapes where each link has its own table).

Per-link tabulated lookup — one shared quantity per call (IRREGULAR/CUSTOM/ STREET, where every link carries its own transect table).

Here is the call graph for this function:

◆ perlink_tabulated_pair()

void openswmm::xsect_batch::perlink_tabulated_pair ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT nrm,
const double *OPENSWMM_RESTRICT scale_a,
const double *OPENSWMM_RESTRICT scale_b,
const double *const * tables_a,
const double *const * tables_b,
int table_size,
double *OPENSWMM_RESTRICT out_a,
double *OPENSWMM_RESTRICT out_b,
int count )

Fused per-link tabulated pair — the tabulated analog of area_hydrad_circular (plan XSECT_LOOKUP_ACCEL §4 item A2).

A transect's area and hydraulic-radius tables share one 51-row normalized depth grid, so evaluating both at the same depth repeats the whole index computation: the normalization, the x / delta truncation, the segment origin and the interpolation weights. This does that work once and interpolates both tables from it, and gathers each link's two table pointers in one visit instead of two.

Bit-identical to two perlink_tabulated passes by construction: every arithmetic op is the DIVIDE form of xsect::lookup_exact in legacy's grouping (no reciprocal, no FMA), the quadratic refinement and the negative clamp are applied per table exactly as lookup_exact applies them, and the i >= n-1 early-out returns the last row unclamped, as there.

(The top width cannot join this pass: the dynamic-wave loop computes widths in STEP B from crown-capped depths and areas in STEP D from depths STEP C has since modified — different inputs, so there is no shared index to share. Fusing them would change the algorithm, not just its cost.)

Fused per-link tabulated pair (area + hyd-radius) sharing one table index — bit-identical to two perlink_tabulated passes (plan A2).

Here is the call graph for this function:

◆ width_circular()

void openswmm::xsect_batch::width_circular ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT nrm,
const double *OPENSWMM_RESTRICT w_max,
double *OPENSWMM_RESTRICT width,
int count )
Here is the call graph for this function:

◆ width_rect()

void openswmm::xsect_batch::width_rect ( const double *OPENSWMM_RESTRICT w_max,
double *OPENSWMM_RESTRICT width,
int count )

◆ width_rect_closed()

void openswmm::xsect_batch::width_rect_closed ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT nrm,
const double *OPENSWMM_RESTRICT w_max,
double *OPENSWMM_RESTRICT width,
int count )
Here is the call graph for this function:

◆ width_tabulated()

void openswmm::xsect_batch::width_tabulated ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT nrm,
const double *OPENSWMM_RESTRICT w_max,
const double * table,
int table_size,
double *OPENSWMM_RESTRICT width,
int count )
Here is the call graph for this function:

◆ width_trapezoidal()

void openswmm::xsect_batch::width_trapezoidal ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT y_bot,
const double *OPENSWMM_RESTRICT s_bot,
double *OPENSWMM_RESTRICT width,
int count )
Here is the call graph for this function:

◆ width_triangular()

void openswmm::xsect_batch::width_triangular ( const double *OPENSWMM_RESTRICT depth,
const double *OPENSWMM_RESTRICT s_bot,
double *OPENSWMM_RESTRICT width,
int count )
Here is the call graph for this function: