![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
Builds and applies static rainfall-interpolation weights for the mesh. More...
#include <RainfallInterpolator.hpp>
Public Member Functions | |
| void | build (const std::vector< double > &cx, const std::vector< double > &cy, const std::vector< double > &gage_x, const std::vector< double > &gage_y, int n_gages, double gage_scale) |
| Precompute per-cell interpolation weights. | |
| bool | ready () const noexcept |
| True once build() produced usable weights (≥ 1 located gage). | |
| void | apply (const std::vector< double > &rain, std::vector< double > &out) const |
| Map per-gage values onto per-cell values: out[i] = Σ w·rain[gage]. | |
Builds and applies static rainfall-interpolation weights for the mesh.
Degenerate fallbacks handled by build():
| void openswmm::twoD::RainfallInterpolator::apply | ( | const std::vector< double > & | rain, |
| std::vector< double > & | out ) const |
Map per-gage values onto per-cell values: out[i] = Σ w·rain[gage].
| rain | Per-gage value already in the desired output units (m/s), indexed by global gage index (size ≥ n_gages). |
| out | Filled with one value per cell; resized to n_triangles if its size does not already match. |
| void openswmm::twoD::RainfallInterpolator::build | ( | const std::vector< double > & | cx, |
| const std::vector< double > & | cy, | ||
| const std::vector< double > & | gage_x, | ||
| const std::vector< double > & | gage_y, | ||
| int | n_gages, | ||
| double | gage_scale ) |
Precompute per-cell interpolation weights.
| cx,cy | Mesh cell centroids (SI metres), size = n_triangles. |
| gage_x,gage_y | Gage coordinates in project map units. An entry of exactly (0,0) marks an un-located gage (no [SYMBOLS] row) and is excluded from the interpolation. |
| n_gages | Number of gages (rainfall arrays are indexed 0..n_gages-1; the stored gage indices are these global indices). |
| gage_scale | Factor applied to the gage coords to bring them into the SI mesh frame — the same FLOW_UNITS ft→m factor initialize() applies to the mesh (1.0 for SI projects). |
|
inlinenoexcept |
True once build() produced usable weights (≥ 1 located gage).