OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
XSectBatch.cpp File Reference

Data-oriented batch cross-section geometry — shape-grouped SoA. More...

#include "XSectBatch.hpp"
#include "xsect_tables.hpp"
#include "../core/SimulationContext.hpp"
#include "../math/SIMD.hpp"
#include <cmath>
#include <algorithm>
#include <numeric>
Include dependency graph for XSectBatch.cpp:

Namespaces

namespace  openswmm
 
namespace  openswmm::xsect_batch
 

Functions

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.
 
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.
 
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.
 
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.
 
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).
 
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).
 
void openswmm::xsect_batch::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 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, double *OPENSWMM_RESTRICT area, int count)
 Batch area for shapes using invLookup (gothic, catenary, semielliptical, semicircular).
 
void openswmm::xsect_batch::hydrad_circular (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT y_full, const double *OPENSWMM_RESTRICT r_full, double *OPENSWMM_RESTRICT hydrad, int count)
 
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)
 
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)
 
void openswmm::xsect_batch::hydrad_rect (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT w_max, double *OPENSWMM_RESTRICT hydrad, int count)
 
void openswmm::xsect_batch::hydrad_tabulated (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT y_full, const double *OPENSWMM_RESTRICT r_full, const double *table, int table_size, double *OPENSWMM_RESTRICT hydrad, int count)
 
void openswmm::xsect_batch::width_circular (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT y_full, const double *OPENSWMM_RESTRICT w_max, double *OPENSWMM_RESTRICT width, int count)
 
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)
 
void openswmm::xsect_batch::width_triangular (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT s_bot, double *OPENSWMM_RESTRICT width, int count)
 
void openswmm::xsect_batch::width_rect (const double *OPENSWMM_RESTRICT w_max, double *OPENSWMM_RESTRICT width, int count)
 
void openswmm::xsect_batch::width_tabulated (const double *OPENSWMM_RESTRICT depth, const double *OPENSWMM_RESTRICT y_full, const double *OPENSWMM_RESTRICT w_max, const double *table, int table_size, double *OPENSWMM_RESTRICT width, int count)
 

Detailed Description

Data-oriented batch cross-section geometry — shape-grouped SoA.

Shape-specific kernels are written as tight loops over contiguous arrays with no branching — the compiler can auto-vectorise them (and we can add explicit SIMD intrinsics later for hot paths).

The XSectGroups::computeXxx() methods iterate over shape groups, call the appropriate kernel, then scatter results back to the global link arrays via the link_idx mapping.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n MIT License

Variable Documentation

◆ data

const double* data

◆ size

int size