9#ifndef Tempus_TimeEventList_decl_hpp
10#define Tempus_TimeEventList_decl_hpp
14#include "Teuchos_Time.hpp"
15#include "Teuchos_ParameterList.hpp"
17#include "Tempus_config.hpp"
38 std::vector<Scalar> timeList,
39 std::string name =
"TimeEventList",
40 bool landOnExactly =
true,
41 Scalar relTol = std::numeric_limits<Scalar>::epsilon()*Scalar(100.0));
58 virtual bool isTime(Scalar time)
const;
97 virtual bool eventInRange(Scalar time1, Scalar time2)
const;
100 virtual void describe(Teuchos::FancyOStream &out,
101 const Teuchos::EVerbosityLevel verbLevel)
const;
118 virtual void setTimeList(std::vector<Scalar> timeList,
bool sort =
true);
129 virtual void addTime(Scalar time);
223template<
class Scalar>
224Teuchos::RCP<TimeEventList<Scalar> >
This class defines time events which can be used to "trigger" an action.
TimeEventList specifies a list of time events.
virtual Scalar timeToNextEvent(Scalar time) const
How much time until the next event.
std::vector< Scalar > timeList_
Sorted and unique list of time events.
virtual Scalar timeOfNextEvent(Scalar time) const
Return the time of the next event following the input time.
bool landOnExactly_
Should these time events be landed on exactly, i.e, adjust the timestep to hit time event,...
virtual bool isTime(Scalar time) const
Test if time is near an event (within tolerance).
virtual void clearTimeList()
Clear the vector of all events.
virtual Scalar getRelTol() const
Return the relative tolerance.
Scalar timeScale_
A reference time scale.
TimeEventList()
Default constructor.
virtual void setTimeScale()
Set the time scale for the time events.
virtual std::vector< Scalar > getTimeList() const
Return the list of time events.
virtual void addTime(Scalar time)
Add the time to event vector.
virtual ~TimeEventList()
Destructor.
virtual bool eventInRange(Scalar time1, Scalar time2) const
Test if an event occurs within the time range.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Return a valid ParameterList with current settings.
virtual void setRelTol(Scalar relTol)
Set the relative tolerance.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Describe member data.
virtual void setLandOnExactly(bool LOE)
Set if the time event should be landed on exactly.
virtual void setTimeList(std::vector< Scalar > timeList, bool sort=true)
Set the list of time events.
virtual Scalar getAbsTol() const
Return the absolute tolerance.
virtual bool getLandOnExactly() const
Return if the time events need to be landed on exactly.
Scalar absTol_
Absolute time tolerance, relTol_*timeScale_.
Scalar relTol_
Relative time tolerance for matching time events.
Teuchos::RCP< TimeEventList< Scalar > > createTimeEventList(Teuchos::RCP< Teuchos::ParameterList > pList)
Nonmember Constructor via ParameterList.