preCICE v3.1.2
Loading...
Searching...
No Matches
TimeHandler.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <optional>
5
7
16public:
19
22
23 TimeHandler(const TimeHandler &);
25
28
31
33 void resetTo(double timeStart);
34
36 void progressBy(double dt);
37
39 void resetProgress();
40
46 void completeTimeWindow(double timeWindowSize);
47
51
55 bool reachedEndOfWindow(double timeWindowSize) const;
56
60 bool reachedEnd() const;
61
65
67 double untilWindowEnd(double timeWindowSize) const;
68
70 double untilTime(double t) const;
71
75 double untilEnd() const;
76
78 double windowProgress() const;
79
83
85 double windowStart() const;
86
88 double time() const;
89
91
92private:
94 struct Impl;
95
97
98 double untilProgress(double windowSize) const;
99};
100
101} // namespace precice::cplscheme::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.