10#ifndef Tempus_TimeEventBase_decl_hpp
11#define Tempus_TimeEventBase_decl_hpp
14#include "Teuchos_Time.hpp"
15#include "Teuchos_VerboseObject.hpp"
17#include "Tempus_config.hpp"
35template <
class Scalar>
41 name_(
"TimeEventBase"),
43 defaultTol_(std::numeric_limits<Scalar>::epsilon() * Scalar(100.0)),
63 virtual bool isTime(Scalar )
const {
return false; }
124 virtual bool isIndex(
int )
const {
return false; }
174 const Teuchos::EVerbosityLevel )
const
176 auto l_out = Teuchos::fancyOStream(out.getOStream());
177 Teuchos::OSTab ostab(*l_out, 2,
"TimeEventBase");
178 l_out->setOutputToRootOnly(0);
180 *l_out <<
"TimeEventBase name = " <<
getName() << std::endl;
249 Teuchos::RCP<Teuchos::ParameterList> pl =
250 Teuchos::parameterList(
"Time Event Base");
253 pl->set(
"Name", this->
getName());
254 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, Scalar) const
Test if an event occurs within the time range.
virtual int indexToNextEvent(int) const
How many indices until the next event.
const Scalar defaultTime_
Default time.
const Scalar defaultTol_
Default tolerance.
virtual Scalar timeOfNextEvent(Scalar) const
Return the time of the next event following the input time.
virtual int indexOfNextEvent(int) const
Return the index of the next event following the input index.
virtual Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Return ParameterList with current values.
virtual void setType(std::string s)
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 void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel) const
Describe member data.
virtual Scalar timeToNextEvent(Scalar) const
How much time until the next event.
virtual bool isIndex(int) const
Test if index is an event.
virtual void setName(std::string name)
Set the name of the TimeEvent.
virtual bool eventInRangeIndex(int, int) const
Test if an event occurs within the index range.
virtual int getDefaultIndex() const
Return the default index used by TimeEvents.
virtual bool isTime(Scalar) const
Test if time is near an event (within tolerance).
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.