63#ifndef OPENSWMM_RUNOFF_INTERFACE_HPP
64#define OPENSWMM_RUNOFF_INTERFACE_HPP
76static constexpr int N_FIXED_RESULTS = 8;
77static const char FILE_STAMP[] =
"SWMM5-RUNOFF";
90 int openForWrite(
const std::string& path,
int n_subcatch,
int n_pollut,
97 int openForRead(
const std::string& path,
int n_subcatch,
int n_pollut,
121 bool isOpen()
const {
return fp_ !=
nullptr; }
124 std::FILE* fp_ =
nullptr;
125 bool writing_ =
false;
130 int unit_system_ = 0;
132 long max_steps_pos_ = 0;
133 std::vector<float> buf_;
Runoff interface file manager.
Definition RunoffInterface.hpp:82
~RunoffInterfaceFile()
Definition RunoffInterface.hpp:84
int openForWrite(const std::string &path, int n_subcatch, int n_pollut, int flow_units)
Open file for writing (SAVE mode).
Definition RunoffInterface.cpp:49
bool readResults(SimulationContext &ctx, double *dt_out=nullptr)
Read one timestep of runoff results from file.
Definition RunoffInterface.cpp:193
void close()
Close the file and finalize header (write step count for SAVE mode).
Definition RunoffInterface.cpp:240
int openForRead(const std::string &path, int n_subcatch, int n_pollut, int flow_units)
Open file for reading (USE mode).
Definition RunoffInterface.cpp:87
bool isOpen() const
Definition RunoffInterface.hpp:121
void saveResults(const SimulationContext &ctx, double dt)
Save one timestep of runoff results to file.
Definition RunoffInterface.cpp:134
Definition RunoffInterface.cpp:37
Definition NodeCoupling.cpp:16
Central, reentrant simulation context.
Definition SimulationContext.hpp:353