diff --git a/dumux/common/timeloop.hh b/dumux/common/timeloop.hh index 8ab2aaee507712f3f6750810fe24c6e8ed96bd33..446866cfaa968a2087fd7aebad3fa4bcd9f4032a 100644 --- a/dumux/common/timeloop.hh +++ b/dumux/common/timeloop.hh @@ -259,14 +259,20 @@ public: * if the end time is reached. */ bool finished() const - { return finished_ || time_ >= endTime_; } + { + using std::abs; + return finished_ || abs(time_-endTime_)/endTime_ < 1e-14; + } /*! * \brief Returns true if the simulation is finished after the * time level is incremented by the current time step size. */ bool willBeFinished() const - { return finished_ || time_ + timeStepSize_ >= endTime_; } + { + using std::abs; + return finished_ || abs(time_+timeStepSize_-endTime_)/endTime_ < 1e-14; + } /*! * \brief The current maximum time step size