9#ifndef Tempus_TimeEventBase_decl_hpp
10#define Tempus_TimeEventBase_decl_hpp
13#include "Teuchos_Time.hpp"
14#include "Teuchos_VerboseObject.hpp"
16#include "Tempus_config.hpp"
42 name_(
"TimeEventBase"),
44 defaultTol_ (std::numeric_limits<Scalar>::epsilon()*Scalar(100.0)),
63 virtual bool isTime(Scalar time)
const
182 const Teuchos::EVerbosityLevel verbLevel)
const
184 auto l_out = Teuchos::fancyOStream( out.getOStream() );
185 Teuchos::OSTab ostab(*l_out, 2,
"TimeEventBase");
186 l_out->setOutputToRootOnly(0);
188 *l_out <<
"TimeEventBase name = " <<
getName() << std::endl;
258 Teuchos::RCP<Teuchos::ParameterList> pl =
259 Teuchos::parameterList(
"Time Event Base");
262 pl->set(
"Name", this->
getName());
263 pl->set(
"Type", this->
getType());
This class defines time events which can be used to "trigger" an action.
std::string name_
Name to identify the TimeEvent.
virtual bool eventInRange(Scalar time1, Scalar time2) const
Test if an event occurs within the time range.
virtual Scalar timeToNextEvent(Scalar time) const
How much time until the next event.
const Scalar defaultTime_
Default time.
const Scalar defaultTol_
Default tolerance.
virtual Scalar timeOfNextEvent(Scalar time) const
Return the time of the next event following the input time.
virtual Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Return ParameterList with current values.
virtual void setType(std::string s)
virtual int indexOfNextEvent(int index) const
Return the index of the next event following the input index.
virtual int indexToNextEvent(int index) const
How many indices until the next event.
virtual ~TimeEventBase()
Destructor.
virtual std::string getName() const
Return the name of the TimeEvent.
virtual std::string getType() const
Return the type of TimeEvent.
TimeEventBase()
Constructor.
virtual bool isIndex(int index) const
Test if index is an event.
virtual bool eventInRangeIndex(int index1, int index2) const
Test if an event occurs within the index range.
virtual void setName(std::string name)
Set the name of the TimeEvent.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Describe member data.
virtual bool isTime(Scalar time) const
Test if time is near an event (within tolerance).
virtual int getDefaultIndex() const
Return the default index used by TimeEvents.
virtual Scalar getAbsTol() const
Return the absolute tolerance.
virtual Scalar getDefaultTime() const
Return the default time used for TimeEvents.
const int defaultIndex_
Default index.
std::string timeEventType_
Time Event type.
virtual Scalar getDefaultTol() const
Return the default tolerance used by TimeEvents.
virtual bool getLandOnExactly() const
Return if the time events need to be landed on exactly.