Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
Tempus::TimeEventListIndex< Scalar > Class Template Reference

TimeEventListIndex specifies a list of index events. More...

#include <Tempus_TimeEventListIndex_decl.hpp>

Inheritance diagram for Tempus::TimeEventListIndex< Scalar >:
Tempus::TimeEventBase< Scalar >

Public Member Functions

 TimeEventListIndex ()
 Default constructor. More...
 
 TimeEventListIndex (std::vector< int > indexList, std::string name="TimeEventListIndex")
 Construct with full argument list of data members. More...
 
virtual ~TimeEventListIndex ()
 Destructor. More...
 
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 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 Scalar getAbsTol () const
 Return the absolute tolerance. More...
 
virtual bool getLandOnExactly () const
 Return if the time events need to be landed on exactly. 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< int > indexList_
 

Basic methods

virtual bool isIndex (int index) const
 Test if index is a time 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...
 

Accessor methods

virtual std::vector< int > getIndexList () const
 Return a vector of event indices. More...
 
virtual void setIndexList (std::vector< int > indexList, bool sort=true)
 Set the vector of event indices. More...
 
virtual void addIndex (int index)
 Add the index to event vector. More...
 
virtual void clearIndexList ()
 Clear the vector of all events. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Tempus::TimeEventBase< Scalar >
virtual void setType (std::string s)
 

Detailed Description

template<class Scalar>
class Tempus::TimeEventListIndex< Scalar >

TimeEventListIndex specifies a list of index events.

Definition at line 27 of file Tempus_TimeEventListIndex_decl.hpp.

Constructor & Destructor Documentation

template<class Scalar >
Tempus::TimeEventListIndex< Scalar >::TimeEventListIndex ( )

Default constructor.

Definition at line 15 of file Tempus_TimeEventListIndex_impl.hpp.

template<class Scalar >
Tempus::TimeEventListIndex< Scalar >::TimeEventListIndex ( std::vector< int >  indexList,
std::string  name = "TimeEventListIndex< Scalar >" 
)

Construct with full argument list of data members.

Definition at line 22 of file Tempus_TimeEventListIndex_impl.hpp.

template<class Scalar >
virtual Tempus::TimeEventListIndex< Scalar >::~TimeEventListIndex ( )
inlinevirtual

Destructor.

Definition at line 37 of file Tempus_TimeEventListIndex_decl.hpp.

Member Function Documentation

template<class Scalar >
bool Tempus::TimeEventListIndex< Scalar >::isIndex ( int  index) const
virtual

Test if index is a time event.

Return true if an event is the input index.

Parameters
index[in] The input index.
Returns
True if index is an event.

Reimplemented from Tempus::TimeEventBase< Scalar >.

Definition at line 69 of file Tempus_TimeEventListIndex_impl.hpp.

template<class Scalar >
int Tempus::TimeEventListIndex< Scalar >::indexToNextEvent ( int  index) const
virtual

How many indices until the next event.

Parameters
index[in] The input index.
Returns
The number of steps (indices) to the next event.

Reimplemented from Tempus::TimeEventBase< Scalar >.

Definition at line 76 of file Tempus_TimeEventListIndex_impl.hpp.

template<class Scalar >
int Tempus::TimeEventListIndex< Scalar >::indexOfNextEvent ( int  index) const
virtual

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.

Parameters
index[in] Input index.
Returns
Index of the next event.

Reimplemented from Tempus::TimeEventBase< Scalar >.

Definition at line 82 of file Tempus_TimeEventListIndex_impl.hpp.

template<class Scalar >
bool Tempus::TimeEventListIndex< Scalar >::eventInRangeIndex ( int  index1,
int  index2 
) const
virtual

Test if an event occurs within the index range.

Find if an event is within the input range, ( index1 < event <= index2 ).

Parameters
index1[in] Input index of one end of the range.
index2[in] Input index of the other end of the range.
Returns
True if an index event is within the range.

Reimplemented from Tempus::TimeEventBase< Scalar >.

Definition at line 99 of file Tempus_TimeEventListIndex_impl.hpp.

template<class Scalar >
void Tempus::TimeEventListIndex< Scalar >::describe ( Teuchos::FancyOStream out,
const Teuchos::EVerbosityLevel  verbLevel 
) const
virtual

Describe member data.

Reimplemented from Tempus::TimeEventBase< Scalar >.

Definition at line 124 of file Tempus_TimeEventListIndex_impl.hpp.

template<class Scalar >
virtual std::vector<int> Tempus::TimeEventListIndex< Scalar >::getIndexList ( ) const
inlinevirtual

Return a vector of event indices.

Definition at line 89 of file Tempus_TimeEventListIndex_decl.hpp.

template<class Scalar >
void Tempus::TimeEventListIndex< Scalar >::setIndexList ( std::vector< int >  indexList,
bool  sort = true 
)
virtual

Set the vector of event indices.

This will completely replace the vector of event indices.

Parameters
indexList[in] Vector of event indices.
sort[in] Sort vector into ascending order, if true.

Definition at line 40 of file Tempus_TimeEventListIndex_impl.hpp.

template<class Scalar >
void Tempus::TimeEventListIndex< Scalar >::addIndex ( int  index)
virtual

Add the index to event vector.

The input index will be inserted into the vector of events in ascending order. If the index is already present, it is not added to keep the vector unique.

Parameters
index[in] Index to insert to vector of events.

Definition at line 52 of file Tempus_TimeEventListIndex_impl.hpp.

template<class Scalar >
virtual void Tempus::TimeEventListIndex< Scalar >::clearIndexList ( )
inlinevirtual

Clear the vector of all events.

Definition at line 111 of file Tempus_TimeEventListIndex_decl.hpp.

template<class Scalar >
Teuchos::RCP< const Teuchos::ParameterList > Tempus::TimeEventListIndex< Scalar >::getValidParameters ( ) const
virtual

Return a valid ParameterList with current settings.

The returned ParameterList will contain the current parameters and can be used to reconstruct the exact same object using createTimeEventListIndex(...).

Returns
Teuchos::ParameterList of TimeEventListIndex.

Reimplemented from Tempus::TimeEventBase< Scalar >.

Definition at line 148 of file Tempus_TimeEventListIndex_impl.hpp.

Member Data Documentation

template<class Scalar >
std::vector<int> Tempus::TimeEventListIndex< Scalar >::indexList_
protected

Definition at line 125 of file Tempus_TimeEventListIndex_decl.hpp.


The documentation for this class was generated from the following files: