diff --git a/ParameterLib/TimeDependentHeterogeneousParameter.cpp b/ParameterLib/TimeDependentHeterogeneousParameter.cpp index a1f0bc29c01585d4ed58474b2b0b6e4aee78d79c..be1eff3c8b10646490edf87dc8ba632efa34cfda 100644 --- a/ParameterLib/TimeDependentHeterogeneousParameter.cpp +++ b/ParameterLib/TimeDependentHeterogeneousParameter.cpp @@ -60,6 +60,13 @@ std::vector<double> TimeDependentHeterogeneousParameter::operator()( break; } } + if (k == _time_parameter_mapping.size()) + { + OGS_FATAL( + "Could not find parameter for time {}. There are {:d} " + "time-parameter pairs.", + t, _time_parameter_mapping.size()); + } auto const t0 = _time_parameter_mapping[k - 1].first; auto const t1 = _time_parameter_mapping[k].first; auto const alpha = (t - t0) / (t1 - t0);