Tempus
Version of the Day
Time Integration
|
This class defines time events which can be used to "trigger" an action. More...
#include <Tempus_TimeEventBase.hpp>
Public Member Functions | |
TimeEventBase () | |
Constructor. More... | |
virtual | ~TimeEventBase () |
Destructor. More... | |
virtual Teuchos::RCP< const Teuchos::ParameterList > | getValidParameters () const |
Return ParameterList with current values. More... | |
Protected Member Functions | |
virtual void | setType (std::string s) |
Private Attributes | |
std::string | timeEventType_ |
Time Event type. More... | |
std::string | name_ |
Name to identify the TimeEvent. More... | |
const Scalar | defaultTime_ |
Default time. More... | |
const Scalar | defaultTol_ |
Default tolerance. More... | |
const int | defaultIndex_ |
Default index. More... | |
Basic methods | |
virtual bool | isTime (Scalar time) const |
Test if time is near an event (within tolerance). More... | |
virtual Scalar | timeToNextEvent (Scalar time) const |
How much time until the next event. More... | |
virtual Scalar | timeOfNextEvent (Scalar time) const |
Return the time of the next event following the input time. More... | |
virtual bool | eventInRange (Scalar time1, Scalar time2) const |
Test if an event occurs within the time range. More... | |
virtual bool | isIndex (int index) const |
Test if index is an event. More... | |
virtual int | indexToNextEvent (int index) const |
How many indices until the next event. More... | |
virtual int | indexOfNextEvent (int index) const |
Return the index of the next event following the input index. More... | |
virtual bool | eventInRangeIndex (int index1, int index2) const |
Test if an event occurs within the index range. More... | |
virtual void | describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const |
Describe member data. More... | |
virtual Scalar | getAbsTol () const |
Return the absolute tolerance. More... | |
virtual bool | getLandOnExactly () const |
Return if the time events need to be landed on exactly. More... | |
Accessor methods | |
virtual std::string | getName () const |
Return the name of the TimeEvent. More... | |
virtual void | setName (std::string name) |
Set the name of the TimeEvent. More... | |
virtual std::string | getType () const |
Return the type of TimeEvent. More... | |
virtual Scalar | getDefaultTime () const |
Return the default time used for TimeEvents. More... | |
virtual Scalar | getDefaultTol () const |
Return the default tolerance used by TimeEvents. More... | |
virtual int | getDefaultIndex () const |
Return the default index used by TimeEvents. More... | |
This class defines time events which can be used to "trigger" an action.
Time events are points in time and/or timestep index where an an action should occur, such as, solution output (mesh and solution) diagnostic output, restart, screen dump, in-situ visualization, user-specified, or any other action.
This class will store a collection time events, so that an object may query it and take appropriate action. Time events (time and timestep index) can be specified via
Definition at line 36 of file Tempus_TimeEventBase.hpp.
|
inline |
Constructor.
Definition at line 39 of file Tempus_TimeEventBase.hpp.
|
inlinevirtual |
Destructor.
Definition at line 49 of file Tempus_TimeEventBase.hpp.
|
inlinevirtual |
Test if time is near an event (within tolerance).
For TimeEventBase, always return false since it has no events. For TimeEvents that are not time based (e.g., index-based events - TimeEventRangeIndex), they do not do not have a time, so return false.
time | [in] The input time. |
Reimplemented in Tempus::TimeEventComposite< Scalar >, Tempus::TimeEventRange< Scalar >, and Tempus::TimeEventList< Scalar >.
Definition at line 63 of file Tempus_TimeEventBase.hpp.
|
inlinevirtual |
How much time until the next event.
For TimeEventBase, the time to the next event is the default time, since TimeEventBase has no events. For TimeEvents that are not time based (e.g., index-based events - TimeEventRangeIndex), they do not do not have a time to the next event, so return the default time.
Reimplemented in Tempus::TimeEventComposite< Scalar >, Tempus::TimeEventRange< Scalar >, and Tempus::TimeEventList< Scalar >.
Definition at line 75 of file Tempus_TimeEventBase.hpp.
|
inlinevirtual |
Return the time of the next event following the input time.
Returns the time of the next event that follows the input time. If the input time is before all events, the time of the first event is returned. If the input time is after all events, the default time (a time in the distant future) is returned. If the input time is an event time, the time of the next event is returned.
For TimeEventBase, always return the default time. For TimeEvents that are not time based (e.g., index-based events - TimeEventRangeIndex), they do not do not have a time of the next event, so return the default time.
time | [in] Input time. |
Reimplemented in Tempus::TimeEventComposite< Scalar >, Tempus::TimeEventRange< Scalar >, and Tempus::TimeEventList< Scalar >.
Definition at line 93 of file Tempus_TimeEventBase.hpp.
|
inlinevirtual |
Test if an event occurs within the time range.
Find if an event is within the input range, (time1 < timeEvent-absTol and timeEvent-absTol <= time2), including the event's absolute tolerance. Note, this does not include time1, but does include time2.
For TimeEventBase, always return false since it has no events. For TimeEvents that are not time based (e.g., index-based events - TimeEventRangeIndex), there is not not event in range, so return false.
time1 | [in] Input time of one end of the range. |
time2 | [in] Input time of the other end of the range. |
Reimplemented in Tempus::TimeEventComposite< Scalar >, Tempus::TimeEventRange< Scalar >, and Tempus::TimeEventList< Scalar >.
Definition at line 112 of file Tempus_TimeEventBase.hpp.
|
inlinevirtual |
Test if index is an event.
For TimeEventBase, always return false since it has no events. For TimeEvents that are not index based (e.g., time-based events - TimeEventRange), they do not do not have an index, so return false.
index | [in] The input index. |
Reimplemented in Tempus::TimeEventComposite< Scalar >, Tempus::TimeEventListIndex< Scalar >, and Tempus::TimeEventRangeIndex< Scalar >.
Definition at line 124 of file Tempus_TimeEventBase.hpp.
|
inlinevirtual |
How many indices until the next event.
For TimeEventBase, the index to the next event is the default index. For TimeEvents that are not index based (e.g., time-based events - TimeEventRange), they do not do not have an index to the next event, so return the default index.
Reimplemented in Tempus::TimeEventComposite< Scalar >, Tempus::TimeEventListIndex< Scalar >, and Tempus::TimeEventRangeIndex< Scalar >.
Definition at line 135 of file Tempus_TimeEventBase.hpp.
|
inlinevirtual |
Return the index of the next event following the input index.
Returns the index of the next event that follows the input index. If the input index is before all events, the index of the first event is returned. If the input index is after all events, the default index (an index in the distant future) is returned. If the input index is an event index, the index of the next event is returned.
For TimeEventBase, always return the default index. For TimeEvents that are not index based (e.g., time-based events - TimeEventRange), they do not do not have an index of the next event, so return default index.
index | [in] Input index. |
Reimplemented in Tempus::TimeEventComposite< Scalar >, Tempus::TimeEventListIndex< Scalar >, and Tempus::TimeEventRangeIndex< Scalar >.
Definition at line 153 of file Tempus_TimeEventBase.hpp.
|
inlinevirtual |
Test if an event occurs within the index range.
Find if an event is within the input range, ( index1 < event <= index2 ).
For TimeEventBase, always return false since it has no events. For TimeEvents that are not index based (e.g., time-based events - TimeEventRange), they do not do not have an index in range, so return false.
index1 | [in] Input index of one end of the range. |
index2 | [in] Input index of the other end of the range. |
Reimplemented in Tempus::TimeEventComposite< Scalar >, Tempus::TimeEventListIndex< Scalar >, and Tempus::TimeEventRangeIndex< Scalar >.
Definition at line 170 of file Tempus_TimeEventBase.hpp.
|
inlinevirtual |
Describe member data.
Reimplemented in Tempus::TimeEventComposite< Scalar >, Tempus::TimeEventRange< Scalar >, Tempus::TimeEventList< Scalar >, Tempus::TimeEventListIndex< Scalar >, and Tempus::TimeEventRangeIndex< Scalar >.
Definition at line 173 of file Tempus_TimeEventBase.hpp.
|
inlinevirtual |
Return the absolute tolerance.
The absolute tolerance is primarily used to determine if two times are equal (i.e., t1 is equal to t2, if t2-absTol < t1 < t2+absTol).
For TimeEventBase and TimeEvents that are not time based (e.g., index-based events - TimeEventRangeIndex), the absolute tolerance is the default tolerance.
Reimplemented in Tempus::TimeEventComposite< Scalar >, Tempus::TimeEventRange< Scalar >, and Tempus::TimeEventList< Scalar >.
Definition at line 195 of file Tempus_TimeEventBase.hpp.
|
inlinevirtual |
Return if the time events need to be landed on exactly.
If true, this returns whether the time events need to be landed on exactly, e.g., the time step needs to be adjusted so the solution is determined at the time event.
If false, this indicates that time event will still occur but can be stepped over without changing the time step.
This is for TimeEvents that are time based, e.g., TimeEventRange and TimeEventList. For TimeEvents that are not time based (e.g., index-based events - TimeEventRangeIndex and TimeEventListIndex), there is no need to flag this, so return false.
Reimplemented in Tempus::TimeEventComposite< Scalar >, Tempus::TimeEventRange< Scalar >, and Tempus::TimeEventList< Scalar >.
Definition at line 214 of file Tempus_TimeEventBase.hpp.
|
inlinevirtual |
Return the name of the TimeEvent.
The name of the TimeEvent can be used to identify specific TimeEvents in order to take action related to that TimeEvent (e.g., a name of "Output Special" may indicate to output some special information).
Definition at line 229 of file Tempus_TimeEventBase.hpp.
|
inlinevirtual |
Set the name of the TimeEvent.
Definition at line 231 of file Tempus_TimeEventBase.hpp.
|
inlinevirtual |
Return the type of TimeEvent.
Each derived class of TimeEventBase has a type that can be used to identify the type of the TimeEvent.
Definition at line 237 of file Tempus_TimeEventBase.hpp.
|
inlinevirtual |
Return the default time used for TimeEvents.
Definition at line 239 of file Tempus_TimeEventBase.hpp.
|
inlinevirtual |
Return the default tolerance used by TimeEvents.
Definition at line 241 of file Tempus_TimeEventBase.hpp.
|
inlinevirtual |
Return the default index used by TimeEvents.
Definition at line 243 of file Tempus_TimeEventBase.hpp.
|
inlinevirtual |
Return ParameterList with current values.
Reimplemented in Tempus::TimeEventComposite< Scalar >, Tempus::TimeEventRange< Scalar >, Tempus::TimeEventList< Scalar >, Tempus::TimeEventRangeIndex< Scalar >, and Tempus::TimeEventListIndex< Scalar >.
Definition at line 247 of file Tempus_TimeEventBase.hpp.
|
inlineprotectedvirtual |
Definition at line 260 of file Tempus_TimeEventBase.hpp.
|
private |
Time Event type.
Definition at line 263 of file Tempus_TimeEventBase.hpp.
|
private |
Name to identify the TimeEvent.
Definition at line 264 of file Tempus_TimeEventBase.hpp.
|
private |
Default time.
Definition at line 265 of file Tempus_TimeEventBase.hpp.
|
private |
Default tolerance.
Definition at line 266 of file Tempus_TimeEventBase.hpp.
|
private |
Default index.
Definition at line 267 of file Tempus_TimeEventBase.hpp.