SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
GageBlend Namespace Reference

Classes

struct  BlendResult
 Outcome of one blend. More...
 
struct  Box
 A constant-intensity interval, [t0, t1), in depth/hour. More...
 
struct  SeriesPoint
 One (time, value) entry of a rainfall series. More...
 
struct  SourceGage
 A contributing gage: its series plus everything needed to read it. More...
 

Enumerations

enum class  RainType {
  Intensity = 0 ,
  Volume = 1 ,
  Cumulative = 2
}
 Rain-data format, matching SWMM_GageRainType. More...
 

Functions

QVector< BoxtoBoxes (const SourceGage &source)
 Expand one source into explicit intensity boxes.
 
double boxDepth (const QVector< Box > &boxes)
 Total depth carried by a box list.
 
double engineDepth (const QVector< SeriesPoint > &points, qint64 intervalSec, RainType rainType=RainType::Intensity, double scaleFactor=1.0)
 Total depth of an emitted series under the ENGINE's boxcar rule.
 
BlendResult blend (const QVector< SourceGage > &sources, const QVector< double > &weights)
 Blend sources under weights into one INTENSITY series.
 

Variables

constexpr int kMaxGridCells = 200000
 Ceiling on grid cells, so a pathological gcd cannot melt the model.
 
constexpr double kVolumeTolerance = 1e-9
 Relative tolerance for the volume-conservation check.
 

Enumeration Type Documentation

◆ RainType

enum class GageBlend::RainType
strong

Rain-data format, matching SWMM_GageRainType.

Enumerator
Intensity 

Value is a rate (depth/hour).

Volume 

Value is depth accumulated over one interval.

Cumulative 

Value is a running total; deltas carry the depth.

Function Documentation

◆ blend()

BlendResult GageBlend::blend ( const QVector< SourceGage > &  sources,
const QVector< double > &  weights 
)

Blend sources under weights into one INTENSITY series.

Parameters
sourcesContributing gages; must be non-empty and index-aligned with weights.
weightsBlend weights; need not sum to exactly 1 (they are used as given, so the caller's normalisation is what is honoured).
Returns
The blended series plus its volume-conservation figures. On refusal BlendResult::error is set and BlendResult::points is empty.

Refused: a source with no usable entry; a non-positive interval, one that is not a whole number of minutes, or one over 24 h (the INP writer stores h:mm, so anything else cannot round-trip); a grid that would exceed kMaxGridCells; and sources whose time spans are disjoint by more than a year, which is the signature of a relative-hours series mixed with absolute-dated ones.

Here is the call graph for this function:

◆ boxDepth()

double GageBlend::boxDepth ( const QVector< Box > &  boxes)

Total depth carried by a box list.

Here is the caller graph for this function:

◆ engineDepth()

double GageBlend::engineDepth ( const QVector< SeriesPoint > &  points,
qint64  intervalSec,
RainType  rainType = RainType::Intensity,
double  scaleFactor = 1.0 
)

Total depth of an emitted series under the ENGINE's boxcar rule.

Re-derives what the engine would actually apply, rather than what the blend intended, so it can be used to verify a series after it has round-tripped through storage. Any entry lost, reordered, or rounded on the way shows up here.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toBoxes()

QVector< Box > GageBlend::toBoxes ( const SourceGage source)

Expand one source into explicit intensity boxes.

Folds in the gage's own interval, rain type, and scale factor. The box for entry k ends at min(t_k + interval, t_{k+1}); that min is load-bearing, because an entry starting before the previous box ends preempts it in the engine. Without it, a series whose entries are spaced closer than its declared interval reports more volume than the engine would apply.

CUMULATIVE deltas are taken by walking the entries in order, with a decrease read as a counter reset (the new value is then the whole interval's depth) — matching convertRainfall.

Returns
Boxes in ascending time; empty when the source has no usable entry.
Here is the caller graph for this function:

Variable Documentation

◆ kMaxGridCells

constexpr int GageBlend::kMaxGridCells = 200000
constexpr

Ceiling on grid cells, so a pathological gcd cannot melt the model.

◆ kVolumeTolerance

constexpr double GageBlend::kVolumeTolerance = 1e-9
constexpr

Relative tolerance for the volume-conservation check.