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

Dataset groups the 2D results writer can emit ([2D_OPTIONS] REPORT_2D_VARIABLES). One bit per group; the tokens are the names below. Unselected groups are NOT created in the file, so readers treat every time-varying dataset as optional. More...

Enumerations

enum  Var : unsigned {
  DEPTH = 1u << 0 ,
  VELOCITY = 1u << 1 ,
  EDGE_FLUX = 1u << 2 ,
  NODE_HEAD = 1u << 3 ,
  SPECIES = 1u << 4 ,
  RAINFALL = 1u << 5 ,
  INFILTRATION = 1u << 6 ,
  COUPLING = 1u << 7 ,
  GRADIENTS = 1u << 8 ,
  CONTINUITY = 1u << 9 ,
  ENVELOPES = 1u << 10 ,
  BUILDUP = 1u << 11 ,
  GROUNDWATER ,
  GW_DETAILED ,
  HEAT = 1u << 14 ,
  TURBULENCE = 1u << 15 ,
  ALL_MASK = (1u << 16) - 1u ,
  DEFAULT_MASK ,
  MINIMAL_MASK = DEPTH | NODE_HEAD | ENVELOPES
}
 

Functions

const std::vector< std::string > & tokens ()
 Group tokens in bit order (index i ↔ bit 1u << i).
 
bool iequalsTok (const std::string &a, const char *b)
 Compare one report token against a required literal ignoring byte case.
 
std::vector< std::string > splitList (const std::string &text)
 Split on whitespace / commas.
 
std::string parseMask (const std::string &text, unsigned &mask)
 Parse a token list or a preset (DEFAULT | MINIMAL | ALL | NONE) into a bitmask. DEPTH is always included — every reader keys the time axis on it. Returns an error string, empty on success.
 
std::string formatMask (unsigned mask)
 Preset name when the mask equals one, else the space-separated token list.
 
std::string formatSpecies (const std::vector< std::string > &species)
 "ALL" for an empty (unfiltered) list, else the space-separated names.
 
std::vector< std::string > parseSpecies (const std::string &text)
 Species list from text; "ALL" (alone) → empty list.
 
std::string formatStep (double seconds)
 Preserve whole and fractional 2D cadence values.
 

Detailed Description

Dataset groups the 2D results writer can emit ([2D_OPTIONS] REPORT_2D_VARIABLES). One bit per group; the tokens are the names below. Unselected groups are NOT created in the file, so readers treat every time-varying dataset as optional.

Enumeration Type Documentation

◆ Var

Enumerator
DEPTH 

Mesh2_face_depth, Mesh2_face_head.

VELOCITY 

Mesh2_face_vx, Mesh2_face_vy.

EDGE_FLUX 

Mesh2_edge_flux (GUI velocity reconstruction, profile flux)

NODE_HEAD 

Mesh2_node_head, Mesh2_node_depth (render reconstruction)

SPECIES 

Mesh2_face_species_conc (when transport rows exist)

RAINFALL 

Mesh2_face_rainfall, Mesh2_face_rain_cum.

INFILTRATION 

Mesh2_face_infil_rate, Mesh2_face_infil_cum.

COUPLING 

Mesh2_face_coupling_flux, Mesh2_face_net_source.

GRADIENTS 

Mesh2_face_grad_hx/hy and the _lim pair (solver diagnostics)

CONTINUITY 

Mesh2_face_continuity_err (solver diagnostic)

ENVELOPES 

Mesh2_face_max_depth / _max_velocity / _max_continuity_err.

BUILDUP 

S7: Mesh2_face_buildup (when [2D_COVERAGES] rows resolved)

GROUNDWATER 

G-O: Mesh2_face_gw_* per-cell fields, groundwater_ledger, groundwater_node_exchange_cum (when a [2D_AQUIFER] resolved)

GW_DETAILED 

G-O: Mesh2_face_gw_theta_sigma [time, layer, face] — m × nFace per step.

HEAT 

Thermal temperatures, soil layers, and signed cumulative heat budgets.

TURBULENCE 

Horizontal eddy viscosity and strain rate diagnostics.

ALL_MASK 
DEFAULT_MASK 

DEFAULT: everything a user renders or plots; solver diagnostics off.

MINIMAL_MASK 

MINIMAL: depth map + render reconstruction + envelopes only.

Function Documentation

◆ formatMask()

std::string openswmm::twoD::report2d::formatMask ( unsigned mask)
inline

Preset name when the mask equals one, else the space-separated token list.

Parameters
[in]maskDataset-group bitmask; unknown bits are discarded.
Returns
Owned preset name or ordered space-separated tokens. Empty recognized selection formats as DEPTH. Allocation may throw; no mutation or retained input.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ formatSpecies()

std::string openswmm::twoD::report2d::formatSpecies ( const std::vector< std::string > & species)
inline

"ALL" for an empty (unfiltered) list, else the space-separated names.

Parameters
[in]speciesBorrowed ordered species-name filter; empty means unfiltered.
Returns
Newly owned ALL string for an empty list, otherwise names joined by one space without validation/escaping. Allocation may throw.
Here is the caller graph for this function:

◆ formatStep()

std::string openswmm::twoD::report2d::formatStep ( double seconds)
inline

Preserve whole and fractional 2D cadence values.

Parameters
[in]secondsInterval in seconds; nonpositive and NaN become zero.
Returns
HH:MM:SS for representable whole seconds, otherwise roundtrippable numeric seconds. These 2D keys parse bare numbers as seconds. Formatting uses a bounded local buffer; no shared storage or model mutation.
Here is the caller graph for this function:

◆ iequalsTok()

bool openswmm::twoD::report2d::iequalsTok ( const std::string & a,
const char * b )
inline

Compare one report token against a required literal ignoring byte case.

Parameters
[in]aBorrowed token string.
[in]bRequired NUL-terminated token/literal; NULL is unsupported.
Returns
True for equal lengths/content ignoring case; no allocation or mutation. std::toupper receives unsigned-byte values.
Here is the caller graph for this function:

◆ parseMask()

std::string openswmm::twoD::report2d::parseMask ( const std::string & text,
unsigned & mask )
inline

Parse a token list or a preset (DEFAULT | MINIMAL | ALL | NONE) into a bitmask. DEPTH is always included — every reader keys the time axis on it. Returns an error string, empty on success.

Parameters
[in]textBorrowed case-insensitive preset/token list; empty lists are errors.
[out]maskReset to zero on entry, then ORed incrementally. A successful parse always includes DEPTH, including the NONE spelling.
Returns
Empty string on success or a descriptive error for an unknown/empty list.
Note
A rejected later token leaves a partial mask; do not publish it on error. Allocations may throw. No model state or input storage retained.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseSpecies()

std::vector< std::string > openswmm::twoD::report2d::parseSpecies ( const std::string & text)
inline

Species list from text; "ALL" (alone) → empty list.

Parameters
[in]textBorrowed list split by splitList(). A sole case-insensitive ALL removes filtering.
Returns
Newly owned ordered names, empty for ALL or empty input. Species existence and duplicate validity are not checked; allocation may throw.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ splitList()

std::vector< std::string > openswmm::twoD::report2d::splitList ( const std::string & text)
inline

Split on whitespace / commas.

Parameters
[in]textBorrowed comma/space/tab/CR/LF-separated list.
Returns
Newly owned tokens with empty fields discarded, preserving order/case. Other characters remain literal; no quoting grammar or semantic validation. Allocation may throw and no input storage is retained.
Here is the caller graph for this function:

◆ tokens()

const std::vector< std::string > & openswmm::twoD::report2d::tokens ( )
inline

Group tokens in bit order (index i ↔ bit 1u << i).

Returns
Borrowed immutable vector in dataset-group bit order. Its process-lifetime storage must not be modified or freed; first initialization may allocate/throw and is synchronized by C++ static initialization.
Here is the caller graph for this function: