47#ifndef OPENSWMM_RUNOFF_INTERFACE_HPP
48#define OPENSWMM_RUNOFF_INTERFACE_HPP
60static constexpr int N_FIXED_RESULTS = 8;
61static const char FILE_STAMP[] =
"SWMM5-RUNOFF";
74 int openForWrite(
const std::string& path,
int n_subcatch,
int n_pollut,
81 int openForRead(
const std::string& path,
int n_subcatch,
int n_pollut,
105 bool isOpen()
const {
return fp_ !=
nullptr; }
108 std::FILE* fp_ =
nullptr;
109 bool writing_ =
false;
114 int unit_system_ = 0;
116 long max_steps_pos_ = 0;
117 std::vector<float> buf_;
Runoff interface file manager.
Definition RunoffInterface.hpp:66
~RunoffInterfaceFile()
Definition RunoffInterface.hpp:68
int openForWrite(const std::string &path, int n_subcatch, int n_pollut, int flow_units)
Open file for writing (SAVE mode).
Definition RunoffInterface.cpp:33
bool readResults(SimulationContext &ctx, double *dt_out=nullptr)
Read one timestep of runoff results from file.
Definition RunoffInterface.cpp:177
void close()
Close the file and finalize header (write step count for SAVE mode).
Definition RunoffInterface.cpp:224
int openForRead(const std::string &path, int n_subcatch, int n_pollut, int flow_units)
Open file for reading (USE mode).
Definition RunoffInterface.cpp:71
bool isOpen() const
Definition RunoffInterface.hpp:105
void saveResults(const SimulationContext &ctx, double dt)
Save one timestep of runoff results to file.
Definition RunoffInterface.cpp:118
Definition RunoffInterface.cpp:21
Definition NodeCoupling.cpp:15
Central, reentrant simulation context.
Definition SimulationContext.hpp:292