Shape-grouped cross-section manager for batch computation.
More...
#include <XSectBatch.hpp>
|
| void | build (const SimulationContext &ctx) |
| | Build shape groups from SimulationContext link data.
|
| |
| void | build (const XSectParams *params, int n_links) |
| | Build shape groups from an array of XSectParams.
|
| |
| void | computeAreas (const double *depths, double *areas, int n_links) const |
| | Compute area for every link, reading depth from depths[link].
|
| |
| void | computeHydRad (const double *depths, double *hydrad, int n_links) const |
| | Compute hydraulic radius for every link.
|
| |
| void | computeWidths (const double *depths, double *widths, int n_links) const |
| | Compute top width for every link.
|
| |
| void | computeSectionFactors (const double *areas, double *sfact, int n_links) const |
| | Compute section factor for every link (from area, not depth).
|
| |
| void | computeDepthsFromArea (const double *areas, double *depths, int n_links) const |
| | Compute depth from area for every link (inverse).
|
| |
| int | numGroups () const |
| | Number of non-empty shape groups.
|
| |
| const ShapeGroup & | group (int i) const |
| | Access a specific shape group.
|
| |
| const ShapeGroup * | findGroup (XSectShape shape) const |
| | Find the group for a given shape (returns nullptr if no links have that shape).
|
| |
Shape-grouped cross-section manager for batch computation.
Call build() once after the model is loaded/built. This sorts links by shape type and builds contiguous SoA parameter blocks. Then use computeAreas(), computeHydRad(), computeWidths() in the routing hot loop — each iterates over shape groups and calls the shape-specific vectorised kernel.
Results are written directly into the caller's global arrays (indexed by link) using the scatter index link_idx.
◆ build() [1/2]
Build shape groups from SimulationContext link data.
Scans all links, groups them by xsect shape, and copies the geometry parameters into contiguous SoA arrays. Only shapes that have at least one link get a group.
- Parameters
-
◆ build() [2/2]
| void openswmm::XSectGroups::build |
( |
const XSectParams * |
params, |
|
|
int |
n_links |
|
) |
| |
Build shape groups from an array of XSectParams.
Alternative to build(ctx) — useful for testing.
- Parameters
-
| params | Array of per-link XSectParams. |
| n_links | Number of links. |
◆ computeAreas()
| void openswmm::XSectGroups::computeAreas |
( |
const double * |
depths, |
|
|
double * |
areas, |
|
|
int |
n_links |
|
) |
| const |
Compute area for every link, reading depth from depths[link].
- Parameters
-
| depths | [in] Global depth array (indexed by link). |
| areas | [out] Global area array (indexed by link). |
| n_links | Total number of links. |
◆ computeDepthsFromArea()
| void openswmm::XSectGroups::computeDepthsFromArea |
( |
const double * |
areas, |
|
|
double * |
depths, |
|
|
int |
n_links |
|
) |
| const |
Compute depth from area for every link (inverse).
- Parameters
-
| areas | [in] Global area array. |
| depths | [out] Global depth array. |
| n_links | Total number of links. |
◆ computeHydRad()
| void openswmm::XSectGroups::computeHydRad |
( |
const double * |
depths, |
|
|
double * |
hydrad, |
|
|
int |
n_links |
|
) |
| const |
Compute hydraulic radius for every link.
- Parameters
-
| depths | [in] Global depth array. |
| hydrad | [out] Global hydraulic radius array. |
| n_links | Total number of links. |
◆ computeSectionFactors()
| void openswmm::XSectGroups::computeSectionFactors |
( |
const double * |
areas, |
|
|
double * |
sfact, |
|
|
int |
n_links |
|
) |
| const |
Compute section factor for every link (from area, not depth).
- Parameters
-
| areas | [in] Global area array. |
| sfact | [out] Global section factor array. |
| n_links | Total number of links. |
◆ computeWidths()
| void openswmm::XSectGroups::computeWidths |
( |
const double * |
depths, |
|
|
double * |
widths, |
|
|
int |
n_links |
|
) |
| const |
Compute top width for every link.
- Parameters
-
| depths | [in] Global depth array. |
| widths | [out] Global top width array. |
| n_links | Total number of links. |
◆ findGroup()
Find the group for a given shape (returns nullptr if no links have that shape).
◆ group()
| const ShapeGroup & openswmm::XSectGroups::group |
( |
int |
i | ) |
const |
|
inline |
Access a specific shape group.
◆ numGroups()
| int openswmm::XSectGroups::numGroups |
( |
| ) |
const |
|
inline |
Number of non-empty shape groups.
The documentation for this class was generated from the following files:
- /home/runner/work/openswmm.engine/openswmm.engine/src/engine/hydraulics/XSectBatch.hpp
- /home/runner/work/openswmm.engine/openswmm.engine/src/engine/hydraulics/XSectBatch.cpp