9 #ifndef Tempus_TimeEventRange_decl_hpp
10 #define Tempus_TimeEventRange_decl_hpp
15 #include "Teuchos_Time.hpp"
28 template<
class Scalar>
37 TimeEventRange(std::string name, Scalar start, Scalar stop, Scalar stride,
38 Scalar relTol,
bool landOnExactly);
41 TimeEventRange(std::string name, Scalar start, Scalar stop,
int numEvents,
42 Scalar relTol,
bool landOnExactly);
50 virtual bool isTime(Scalar time)
const;
59 virtual bool eventInRange(Scalar time1, Scalar time2)
const;
64 virtual void setTimeRange(Scalar start, Scalar stop, Scalar stride)
66 virtual void setTimeRange(Scalar start, Scalar stop,
int numEvents)
This class defines time events which can be used to "trigger" an action. Time events are points in ti...
TimeEventRange specifies a start, stop and stride time.
virtual Scalar getTimeStride() const
virtual Scalar getTimeStart() const
virtual void setTimeRange(Scalar start, Scalar stop, int numEvents)
virtual void setRelTol(Scalar relTol)
virtual void setNumEvents(int numEvents)
virtual void setTimeScale()
virtual void setLandOnExactly(bool LOE)
virtual void describe() const
Describe member data.
bool landOnExactly_
Should these time events be landed on exactly, i.e, adjust the timestep to hit time event,...
virtual void setTimeStop(Scalar stop)
virtual void setTimeStride(Scalar stride)
virtual bool getLandOnExactly() const
Scalar stride_
Stride of time range.
virtual Scalar timeOfNextEvent(Scalar time) const
Time of the next event. Negative indicating the last event is in the past.
virtual bool eventInRange(Scalar time1, Scalar time2) const
Test if an event occurs within the time range.
Scalar timeScale_
A reference time scale, max(abs(start_,stop_)).
virtual Scalar getAbsTol() const
virtual int getNumEvents() const
Scalar start_
Start of time range.
unsigned numEvents_
Number of events in time range.
Scalar absTol_
Absolute time tolerance, relTol_*timeScale_.
virtual void setTimeRange(Scalar start, Scalar stop, Scalar stride)
TimeEventRange()
Default constructor.
virtual void setTimeStart(Scalar start)
Scalar relTol_
Relative time tolerance for matching time events.
virtual Scalar getRelTol() const
virtual bool isTime(Scalar time) const
Test if time is near a TimeEvent (within tolerance).
Scalar stop_
Stop of time range.
virtual ~TimeEventRange()
Destructor.
virtual Scalar timeToNextEvent(Scalar time) const
How much time until the next event. Negative indicating the last event is in the past.
virtual Scalar getTimeStop() const