42 if (!std::isfinite(start) || !std::isfinite(target) || target < start)
43 throw std::invalid_argument(
"FV routing times must be finite and ordered.");
44 const double reached = solver.
advance(start, target, forcing);
45 const double tolerance = 16.0 * std::numeric_limits<double>::epsilon() *
46 std::max({1.0, std::fabs(start), std::fabs(target)});
47 if (!std::isfinite(reached) || reached < start || std::fabs(reached - target) > tolerance)
48 throw std::runtime_error(
"FV backend did not reach the requested routing time; "
49 "partial results were not published.");
Backend-neutral interface for the explicit FV 1D network integrator.
Abstract time integrator for the explicit FV 1D network.
Definition INetworkSolver.hpp:135
virtual double advance(double t_current, double t_target, const FvStepForcing &forcing)=0
Advance bound network state across one requested routing window.
Definition AcceptedWaterVolumes.hpp:8
double advanceNetworkChecked(INetworkSolver &solver, double start, double target, const FvStepForcing &forcing)
Advance an FV backend and verify it reached the full requested time window.
Definition CheckedNetworkAdvance.hpp:40
Definition INetworkSolver.hpp:58