Tempus
Version of the Day
Time Integration
|
This composite TimeEvent loops over added TimeEvents. More...
#include <Tempus_TimeEventComposite.hpp>
Public Member Functions | |
TimeEventComposite () | |
Default Constructor. More... | |
TimeEventComposite (std::vector< Teuchos::RCP< TimeEventBase< Scalar > > > te, std::string name="TimeEventComposite") | |
Construct with full argument list of data members. More... | |
virtual | ~TimeEventComposite () |
Destructor. More... | |
void | add (Teuchos::RCP< TimeEventBase< Scalar > > timeEvent) |
Add TimeEvent to the TimeEvent vector. More... | |
void | remove (std::string name) |
Remove TimeEvent based on name. More... | |
Teuchos::RCP< TimeEventBase < Scalar > > | find (std::string name) |
Find TimeEvent based on name. More... | |
void | clear () |
Clear the TimeEvent vector. More... | |
std::size_t | getSize () const |
Return the size of the TimeEvent vector. More... | |
std::string | getTimeEventNames () const |
Return a string of the names of Time Events (comma separated). More... | |
virtual void | describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const |
Describe member data. More... | |
virtual Teuchos::RCP< const Teuchos::ParameterList > | getValidParameters () const |
Return a valid ParameterList with current settings. More... | |
Public Member Functions inherited from Tempus::TimeEventBase< Scalar > | |
TimeEventBase () | |
Constructor. More... | |
virtual | ~TimeEventBase () |
Destructor. More... | |
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... | |
Protected Attributes | |
std::vector< Teuchos::RCP < TimeEventBase< Scalar > > > | timeEvents_ |
Basic methods | |
virtual std::vector < Teuchos::RCP< TimeEventBase < Scalar > > > | getTimeEvents () const |
Get a copy of the current set of TimeEvents. More... | |
virtual void | setTimeEvents (std::vector< Teuchos::RCP< TimeEventBase< Scalar > > > te) |
Set the TimeEvents. More... | |
virtual bool | isTime (Scalar time) const |
Test if time is near a TimeEvent (within tolerance). More... | |
virtual bool | isTime (Scalar time, std::vector< Teuchos::RCP< TimeEventBase< Scalar > > > &timeEvents) const |
Test if time is near a TimeEvent (within tolerance) plus the constraining TimeEvent(s). More... | |
virtual Scalar | timeToNextEvent (Scalar time) const |
How much time until the next event. More... | |
virtual Scalar | timeToNextEvent (Scalar time, std::vector< Teuchos::RCP< TimeEventBase< Scalar > > > &timeEvents) const |
How much time until the next event plus the constraining TimeEvent(s). More... | |
virtual Scalar | timeOfNextEvent (Scalar time) const |
Return the time of the next event following the input time. More... | |
virtual Scalar | timeOfNextEvent (Scalar time, std::vector< Teuchos::RCP< TimeEventBase< Scalar > > > &timeEvents) const |
Return the time of the next time event and constraining TimeEvent(s). More... | |
virtual bool | eventInRange (Scalar time1, Scalar time2) const |
Test if an event occurs within the time range. More... | |
virtual bool | eventInRange (Scalar time1, Scalar time2, std::vector< Teuchos::RCP< TimeEventBase< Scalar > > > &timeEvents) const |
Test if an event occurs within the time range plus the constraining TimeEvent(s). More... | |
virtual bool | isIndex (int index) const |
Test if index is a time event. More... | |
virtual bool | isIndex (int index, std::vector< Teuchos::RCP< TimeEventBase< Scalar > > > &timeEvents) const |
Test if index is a time event plus the constraining TimeEvent(s). More... | |
virtual int | indexToNextEvent (int index) const |
How many indices until the next event. More... | |
virtual int | indexToNextEvent (int index, std::vector< Teuchos::RCP< TimeEventBase< Scalar > > > &timeEvents) 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 int | indexOfNextEvent (int index, std::vector< Teuchos::RCP< TimeEventBase< Scalar > > > &timeEvents) const |
Return the index of the next event following the input index plus the constraining TimeEvent(s). More... | |
virtual bool | eventInRangeIndex (int index1, int index2) const |
Test if an event occurs within the index range. More... | |
virtual bool | eventInRangeIndex (int index1, int index2, std::vector< Teuchos::RCP< TimeEventBase< Scalar > > > &timeEvents) const |
Test if an event occurs within the index range plus the constraining TimeEvent(s). More... | |
virtual Scalar | getAbsTol () const |
Return the largest absolute tolerance from all the TimeEvents. More... | |
virtual Scalar | getAbsTol (std::vector< Teuchos::RCP< TimeEventBase< Scalar > > > &timeEvents) const |
Return the largest absolute tolerance from all the TimeEvents plus the constraining TimeEvent(s). More... | |
virtual bool | getLandOnExactly () const |
Return if the time events need to be landed on exactly. More... | |
virtual bool | getLandOnExactly (std::vector< Teuchos::RCP< TimeEventBase< Scalar > > > &timeEvents) const |
Return if the time events need to be landed on exactly plus the constraining TimeEvent(s). More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Tempus::TimeEventBase< Scalar > | |
virtual void | setType (std::string s) |
This composite TimeEvent loops over added TimeEvents.
Individual TimeEvents are executed in the order in which they were added.
Definition at line 32 of file Tempus_TimeEventComposite.hpp.
|
inline |
Default Constructor.
Definition at line 35 of file Tempus_TimeEventComposite.hpp.
|
inline |
Construct with full argument list of data members.
Definition at line 42 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
Destructor.
Definition at line 51 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
Get a copy of the current set of TimeEvents.
Definition at line 56 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
Set the TimeEvents.
This completely replaces the current set of TimeEvents with the input TimeEvents
te | [in] The input set of TimeEvents. |
Definition at line 70 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
Test if time is near a TimeEvent (within tolerance).
Return true if one of the TimeEvents in the composite is within tolerance of the input time.
time | [in] The input time. |
Reimplemented from Tempus::TimeEventBase< Scalar >.
Definition at line 84 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
Test if time is near a TimeEvent (within tolerance) plus the constraining TimeEvent(s).
Return true if one of the TimeEvents in the composite is near the input time, and the constraining TimeEvent(s) so additional details about the event can be queried.
time | [in] The input time. |
timeEvents | [out] Vector of constraining TimeEvents. |
Definition at line 101 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
How much time until the next event.
Return the amount of time to the next event (i.e., time of next event minus the input time).
time | [in] The input time. |
Reimplemented from Tempus::TimeEventBase< Scalar >.
Definition at line 120 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
How much time until the next event plus the constraining TimeEvent(s).
Return the amount of time to the next event (i.e., time of next event minus the input time), and the constraining TimeEvent so additional details about the event can be queried.
time | [in] The input time. |
timeEvents | [out] Vector of constraining TimeEvent. |
Definition at line 136 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
Return the time of the next event following the input time.
See timeOfNextEvent(time, timeEvent).
time | [in] Input time. |
Reimplemented from Tempus::TimeEventBase< Scalar >.
Definition at line 150 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
Return the time of the next time event and constraining TimeEvent(s).
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 TimeEventComposite, find the next time event from all the TimeEvents in the composite.
Additionally, output the constraining TimeEvents so additional details about the events can be queried.
time | [in] Input time. |
timeEvents | [out] Constraining TimeEvent. |
Definition at line 175 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
Test if an event occurs within the time range.
Find if an event is within the input range, (time1 < event-absTol and timeEvent-absTol <= time2), including the event's absolute tolerance. For TimeEventComposite, test each TimeEvent to determine if the input time is within the range.
time1 | [in] Input time of one end of the range. |
time2 | [in] Input time of the other end of the range. |
Reimplemented from Tempus::TimeEventBase< Scalar >.
Definition at line 214 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
Test if an event occurs within the time range plus the constraining TimeEvent(s).
Find if an event is within the input range, (time1 < event-absTol and timeEvent-absTol <= time2), including the event's absolute tolerance. For TimeEventComposite, test each TimeEvent to determine if the input time is within the range.
Additionally, the constraining TimeEvents are sorted by "time of next event", and returned, so additional details about the events can be queried.
time1 | [in] Input time of one end of the range. |
time2 | [in] Input time of the other end of the range. |
timeEvents | [out] Vector of sorted constraining TimeEvent(s). |
Definition at line 239 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
Test if index is a time event.
Return true if one of the TimeEvents in the composite is the input index.
index | [in] The input index. |
Reimplemented from Tempus::TimeEventBase< Scalar >.
Definition at line 267 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
Test if index is a time event plus the constraining TimeEvent(s).
Return true if one of the TimeEvents indices in the composite is near the input index, and the constraining TimeEvent so additional details about the event can be queried.
index | [in] The input index. |
timeEvents | [out] Vector of constraining TimeEvents. |
Definition at line 283 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
How many indices until the next event.
index | [in] The input index. |
Reimplemented from Tempus::TimeEventBase< Scalar >.
Definition at line 299 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
How many indices until the next event.
index | [in] The input index. |
timeEvents | [out] The constraining TimeEvent. |
Definition at line 310 of file Tempus_TimeEventComposite.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.
index | [in] Input index. |
Reimplemented from Tempus::TimeEventBase< Scalar >.
Definition at line 328 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
Return the index of the next event following the input index plus the constraining TimeEvent(s).
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 (a index in the distant future) is returned. If the input index is an event index, the index of the next event is returned.
index | [in] Input index. |
timeEvents | [out] Vector of constraining TimeEvent(s). |
Definition at line 347 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
Test if an event occurs within the index range.
Find if an event is within the input range, inclusively ( index1 <= event <= index2 ). This may require testing each event in the TimeEvent.
index1 | [in] Input index of one end of the range. |
index2 | [in] Input index of the other end of the range. |
Reimplemented from Tempus::TimeEventBase< Scalar >.
Definition at line 384 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
Test if an event occurs within the index range plus the constraining TimeEvent(s).
Find if an event is within the input range, inclusively ( index1 <= event <= index2 ). This may require testing each event in the TimeEvent.
Additionally, the constraining TimeEvents are sorted by "index of next event", and returned, so additional details about the events can be queried.
index1 | [in] Input index of one end of the range. |
index2 | [in] Input index of the other end of the range. |
timeEvents | [out] Vector of constraining TimeEvents. |
Definition at line 407 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
Return the largest absolute tolerance from all the TimeEvents.
Reimplemented from Tempus::TimeEventBase< Scalar >.
Definition at line 431 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
Return the largest absolute tolerance from all the TimeEvents plus the constraining TimeEvent(s).
All the constraining TimeEvents have the same largest absolute tolerance (within numerical tolerance).
timeEvents | [out] Vector of constraining TimeEvent(s). |
Definition at line 446 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
Return if the time events need to be landed on exactly.
Will return true if any of the events requires to be landed on exactly.
LOE | [in] Flag indicating if TimeEvent should land on the event exactly. |
Reimplemented from Tempus::TimeEventBase< Scalar >.
Definition at line 469 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
Return if the time events need to be landed on exactly plus the constraining TimeEvent(s).
Will return true if any of the events requires to be landed on exactly. All the constraining TimeEvents that require to be landed on exactly will be returned through the input vector of TimeEvents.
timeEvents | [out] Vector of constraining TimeEvent(s). |
Definition at line 485 of file Tempus_TimeEventComposite.hpp.
|
inline |
Add TimeEvent to the TimeEvent vector.
Add the TimeEvent to the composite vector. If the TimeEvent is already in the composite (based on the TimeEvent's name), the input TimeEvent will replace the one in the composite.
timeEvent | [in] The input TimeEvent. |
Definition at line 505 of file Tempus_TimeEventComposite.hpp.
|
inline |
Remove TimeEvent based on name.
If the TimeEvent is not in the composite based on the TimeEvent's name, nothing is done.
name | [in] The name of the TimeEvent to remove. |
Definition at line 528 of file Tempus_TimeEventComposite.hpp.
|
inline |
Find TimeEvent based on name.
If the TimeEvent is not found, Teuchos::null is returned.
name | [in] The name of the TimeEvent to find. |
Definition at line 546 of file Tempus_TimeEventComposite.hpp.
|
inline |
Clear the TimeEvent vector.
Definition at line 555 of file Tempus_TimeEventComposite.hpp.
|
inline |
Return the size of the TimeEvent vector.
Definition at line 558 of file Tempus_TimeEventComposite.hpp.
|
inline |
Return a string of the names of Time Events (comma separated).
Definition at line 561 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
Describe member data.
Reimplemented from Tempus::TimeEventBase< Scalar >.
Definition at line 572 of file Tempus_TimeEventComposite.hpp.
|
inlinevirtual |
Return a valid ParameterList with current settings.
The returned ParameterList will contain the current parameters and can be used to reconstruct the TimeEventComposite using createTimeEventComposite(...). The ParameterList will have the TimeEventComposite parameters along with all the parameters for the TimeEvents contained in the composite.
Reimplemented from Tempus::TimeEventBase< Scalar >.
Definition at line 603 of file Tempus_TimeEventComposite.hpp.
|
protected |
Definition at line 619 of file Tempus_TimeEventComposite.hpp.