OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
PostParseResolver.hpp File Reference

Post-parse cross-reference resolution for the input system. More...

#include <string>
Include dependency graph for PostParseResolver.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  openswmm
 
namespace  openswmm::input
 

Functions

void openswmm::input::resolve_cross_references (SimulationContext &ctx)
 Resolve all cross-references in ctx after all sections are parsed.
 
void openswmm::input::load_external_rain_files (SimulationContext &ctx)
 (Re)load every FILE-source rain gage's data from disk.
 
void openswmm::input::convert_internal_to_display (SimulationContext &ctx)
 Convert the input fields the reader scaled to internal units back to display units (matching ctx.options.flow_units).
 
bool openswmm::input::needs_authored_conversion (const SimulationContext &ctx)
 True when the context holds parse-time normalisations that the .inp writer must undo: LINK_OFFSETS=ELEVATION (offsets stored as depths) or any conduit reversed for adverse slope (direction == -1).
 
int openswmm::input::restore_authored_orientation (SimulationContext &ctx)
 Undo the parse-time adverse-slope reversal on every conduit with direction == -1 (node1/node2, offset1/offset2, q0 sign, inlet/outlet losses, slope sign) and reset direction to +1.
 
void openswmm::input::convert_internal_to_authored (SimulationContext &ctx)
 Restore authored link data for writing: un-reverse adverse-slope conduits (node1/node2, offset1/offset2, q0 sign, inlet/outlet losses) and, in ELEVATION offset mode, re-add each node's invert to the depth-normalised offsets and weir/outlet crests.
 
void openswmm::input::resolve_external_file_slots (SimulationContext &ctx, const std::string &anchor_dir)
 Slice IO-3: Resolve every external-file slot's .original token against an anchor directory and populate .absolute.
 
void openswmm::input::recompute_conduit_flow_properties (SimulationContext &ctx, int j)
 Recompute a single conduit's derived dynamic-wave flow properties.
 

Detailed Description

Post-parse cross-reference resolution for the input system.

After all sections are parsed, some object references that appear forward (e.g., a subcatchment referencing a gage that appears later in the file) need to be resolved. This module performs a single sweep to fix up all -1 indices.

Resolutions performed:

  • subcatch.gage[i] — re-look up by gage name
  • subcatch.outlet_node — re-look up outlet by name
  • gages.ts_index — re-look up time series by name
  • nodes.outfall_param for TIDAL/TIMESERIES outfalls — resolve curve index
  • links.pump_curve — resolve pump curve by name
See also
InputReader.hpp — calls resolve() after all sections are dispatched
Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n Apache-2.0