36 _impl->_maxTime = maxTime;
45 : _impl(
std::exchange(other._impl, nullptr))
51 _impl = std::make_unique<TimeHandler::Impl>(*other.
_impl);
63 _impl->_windowStart = timeStart;
69 _impl->_windowProgress.add(dt);
74 _impl->_windowProgress = 0.0;
81 _impl->_windowStart.add(timeWindowSize);
87 _impl->_windowStart.add(
_impl->_windowProgress);
101 if (!
_impl->_maxTime) {
112 if (!
_impl->_maxTime) {
122 return -(
_impl->_windowStart +
_impl->_windowProgress.value() - t).value();
127 if (!
_impl->_maxTime) {
135 return _impl->_windowProgress.value();
142 return _impl->_windowStart.value();
147 return (
_impl->_windowStart +
_impl->_windowProgress.value()).value();
153 return -(
_impl->_windowProgress - windowSize).value();
#define PRECICE_ASSERT(...)
std::unique_ptr< Impl > _impl
double untilTime(double t) const
Returns the time difference until the overall time reaches the given time.
void resetProgress()
Resets the progress of the time window back to 0.
void resetTo(double timeStart)
Resets the handler to the given time.
bool reachedEndOfWindow(double timeWindowSize) const
double untilProgress(double windowSize) const
double time() const
Returns the current time as a double.
double untilWindowEnd(double timeWindowSize) const
Returns the time distance to the possibly truncated end of the current time window.
void completeTimeWindow(double timeWindowSize)
TimeHandler & operator=(const TimeHandler &)
double windowStart() const
Returns the window start as a double.
double windowProgress() const
Returns the window progress as a double.
void progressBy(double dt)
Progress the time window by the given amount.
An accurate aggregator for doubles with usability in mind.
constexpr bool equals(const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, double tolerance=NUMERICAL_ZERO_DIFFERENCE)
Compares two Eigen::MatrixBase for equality up to tolerance.
utils::DoubleAggregator _windowStart
The aggregator for the start of a time window, handles timestep.
utils::DoubleAggregator _windowProgress
The aggregator progress inside a time window, handles substeps.
std::optional< double > _maxTime
The optional maximum time.