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

SoA storage for per-edge boundary conditions. More...

#include <BoundaryData.hpp>

Collaboration diagram for openswmm::twoD::BoundaryData:

Classes

struct  RuntimeOriginal
 

Public Member Functions

void ensureReceipt (int slot, int species) const
 Ensure a boundary receipt has the selected transport tuple width.
 
void saveRuntime (int slot)
 Capture a boundary's authored prescription before its first runtime override.
 
void clearRuntime (int slot)
 Restore a saved authored boundary prescription for one runtime slot.
 
void resize (int n_edges)
 Resize all arrays to n_edges and initialize to WALL defaults.
 
int size () const noexcept
 Report the number of padded boundary edge slots.
 

Public Attributes

std::vector< int8_t > edge_bc_type
 Boundary condition type per edge (cast from BoundaryType)
 
std::vector< double > edge_wall_drag
 Optional tangential wall drag: tau/rho = -Cw |ut| ut. Zero = free slip.
 
std::vector< uint8_t > edge_is_exterior
 Derived from authored connectivity before runtime topology exists.
 
std::vector< double > edge_bed_slope
 
std::vector< double > edge_bc_head
 
std::vector< int > edge_bc_tseries
 
std::vector< std::string > edge_bc_tseries_name
 Timeseries name for deferred resolution (cleared after resolve).
 
std::vector< double > edge_bc_cum_flux
 
std::vector< double > edge_bc_flow
 
std::vector< int > edge_bc_flow_tseries
 
std::vector< std::string > edge_bc_flow_tseries_name
 Timeseries name for deferred resolution (cleared after resolve).
 
std::vector< int > edge_bc_rating_curve
 
std::vector< std::string > edge_bc_rating_curve_name
 Curve name for deferred resolution (cleared after resolve).
 
std::map< int, RuntimeOriginal > runtime_original
 
std::map< int, std::string > runtime_owner
 
std::map< int, RuntimeReceipt > receipts
 

Detailed Description

SoA storage for per-edge boundary conditions.

All arrays are flat 2D: indexed as [cell * kMaxCellVerts + edge_local] where edge_local ∈ {0,1,2}. Only meaningful for boundary edges (tri_nbr == -1), but allocated for all edges to avoid indirection in the flux loop.

Member Function Documentation

◆ clearRuntime()

void openswmm::twoD::BoundaryData::clearRuntime ( int slot)
inline

Restore a saved authored boundary prescription for one runtime slot.

Parameters
[in]slotValid internal edge slot with sized boundary arrays.
Postcondition
Restores saved scalar/table/name fields, erases its baseline and runtime owner, and preserves cumulative flux/receipts. An absent baseline is a no-op, including its owner map.
Note
String assignments may allocate/throw after partial scalar restoration. Quality overrides and lookup-cache invalidation are the caller's responsibility; requires exclusive access.

◆ ensureReceipt()

void openswmm::twoD::BoundaryData::ensureReceipt ( int slot,
int species ) const
inline

Ensure a boundary receipt has the selected transport tuple width.

Parameters
[in]slotInternal padded edge slot, MeshData::slot(cell,edge); may create a new receipt map entry.
[in]speciesNonnegative number of transported species.
Postcondition
If applied_mass has a different extent, both species vectors reset to zeros. Existing cumulative water/heat totals are preserved.
Note
This const method mutates the mutable receipts map. Requires exclusive receipt access, may allocate/throw, and may leave partial vectors on failure.
Here is the caller graph for this function:

◆ resize()

void openswmm::twoD::BoundaryData::resize ( int n_edges)
inline

Resize all arrays to n_edges and initialize to WALL defaults.

Parameters
n_edgesTotal number of edge slots (n_cells * kMaxCellVerts).
Precondition
n_edges is nonnegative. Call only during allocation/reset, with exclusive access.
Postcondition
Clears runtime owners/originals/receipts and zeroes cumulative flux. Numeric arrays receive wall defaults; resized string vectors retain names in existing slots, so this is not a complete string reset.
Note
Allocations may throw after partial resizing; prior references/iterators can be invalidated. No transactional guarantee.

◆ saveRuntime()

void openswmm::twoD::BoundaryData::saveRuntime ( int slot)
inline

Capture a boundary's authored prescription before its first runtime override.

Parameters
[in]slotValid internal padded edge slot across every boundary array.
Postcondition
Saves type, scalar values, table indices and table names only if no original exists; repeated calls preserve the first baseline.
Note
Does not save cumulative flux or species receipts. Requires exclusive access; map/string allocation may throw. No slot/extent validation.

◆ size()

int openswmm::twoD::BoundaryData::size ( ) const
inlinenoexcept

Report the number of padded boundary edge slots.

Returns
edge_bc_type.size() narrowed to int; includes interior/padding slots. No mutation or allocation; all boundary arrays are expected to have matching extents.
Here is the caller graph for this function:

Member Data Documentation

◆ edge_bc_cum_flux

std::vector<double> openswmm::twoD::BoundaryData::edge_bc_cum_flux

Cumulative boundary flux (m³, positive = outflow from domain). Tracked for mass balance reporting.

◆ edge_bc_flow

std::vector<double> openswmm::twoD::BoundaryData::edge_bc_flow

Prescribed discharge per metre of edge (m³/s/m) for SPECIFIED_FLOW edges. For time-varying: updated each step from timeseries.

◆ edge_bc_flow_tseries

std::vector<int> openswmm::twoD::BoundaryData::edge_bc_flow_tseries

Timeseries index for time-varying SPECIFIED_FLOW. -1 = constant (use edge_bc_flow as-is), -2 = unresolved name, >= 0 = resolved table index into SimulationContext::tables.

◆ edge_bc_flow_tseries_name

std::vector<std::string> openswmm::twoD::BoundaryData::edge_bc_flow_tseries_name

Timeseries name for deferred resolution (cleared after resolve).

◆ edge_bc_head

std::vector<double> openswmm::twoD::BoundaryData::edge_bc_head

Prescribed total head for SPECIFIED_STAGE edges (m). For time-varying: updated each step from timeseries.

◆ edge_bc_rating_curve

std::vector<int> openswmm::twoD::BoundaryData::edge_bc_rating_curve

Curve registry index for RATING_CURVE edges. -1 = unset, -2 = unresolved name, >= 0 = resolved curve index.

◆ edge_bc_rating_curve_name

std::vector<std::string> openswmm::twoD::BoundaryData::edge_bc_rating_curve_name

Curve name for deferred resolution (cleared after resolve).

◆ edge_bc_tseries

std::vector<int> openswmm::twoD::BoundaryData::edge_bc_tseries

Timeseries index for time-varying SPECIFIED_STAGE. -1 = constant (use edge_bc_head as-is), -2 = unresolved name, >= 0 = resolved table index into SimulationContext::tables.

◆ edge_bc_tseries_name

std::vector<std::string> openswmm::twoD::BoundaryData::edge_bc_tseries_name

Timeseries name for deferred resolution (cleared after resolve).

◆ edge_bc_type

std::vector<int8_t> openswmm::twoD::BoundaryData::edge_bc_type

Boundary condition type per edge (cast from BoundaryType)

◆ edge_bed_slope

std::vector<double> openswmm::twoD::BoundaryData::edge_bed_slope

Signed bed slope for NORMAL_FLOW edges (dimensionless). Positive values drain outward; negative values prescribe inward flow. A zero slope zeroes the Manning outflow — the edge behaves as a Wall (validate_project warns; no auto-compute from bed geometry).

◆ edge_is_exterior

std::vector<uint8_t> openswmm::twoD::BoundaryData::edge_is_exterior

Derived from authored connectivity before runtime topology exists.

◆ edge_wall_drag

std::vector<double> openswmm::twoD::BoundaryData::edge_wall_drag

Optional tangential wall drag: tau/rho = -Cw |ut| ut. Zero = free slip.

◆ receipts

std::map<int, RuntimeReceipt> openswmm::twoD::BoundaryData::receipts
mutable

◆ runtime_original

std::map<int, RuntimeOriginal> openswmm::twoD::BoundaryData::runtime_original

◆ runtime_owner

std::map<int, std::string> openswmm::twoD::BoundaryData::runtime_owner

The documentation for this struct was generated from the following file: