Tempus Version of the Day
Time Integration
Loading...
Searching...
No Matches
Tempus_TimeEventListIndex_decl.hpp
Go to the documentation of this file.
1// @HEADER
2// ****************************************************************************
3// Tempus: Copyright (2017) Sandia Corporation
4//
5// Distributed under BSD 3-clause license (See accompanying file Copyright.txt)
6// ****************************************************************************
7// @HEADER
8
9#ifndef Tempus_TimeEventListIndex_decl_hpp
10#define Tempus_TimeEventListIndex_decl_hpp
11
12#include <vector>
13
14#include "Teuchos_Time.hpp"
15#include "Teuchos_ParameterList.hpp"
16
17#include "Tempus_config.hpp"
19
20
21namespace Tempus {
22
23
28template<class Scalar>
29class TimeEventListIndex : virtual public TimeEventBase<Scalar>
30{
31public:
32
35
37 TimeEventListIndex(std::vector<int> indexList,
38 std::string name = "TimeEventListIndex");
39
42
44
45
52 virtual bool isIndex(int index) const;
53
59 virtual int indexToNextEvent(int index) const;
60
72 virtual int indexOfNextEvent(int index) const;
73
83 virtual bool eventInRangeIndex(int index1, int index2) const;
84
86 virtual void describe(Teuchos::FancyOStream &out,
87 const Teuchos::EVerbosityLevel verbLevel) const;
89
91
92
93 virtual std::vector<int> getIndexList() const { return indexList_; }
94
102 virtual void setIndexList(std::vector<int> indexList, bool sort = true);
103
112 virtual void addIndex(int index);
113
115 virtual void clearIndexList() { indexList_.clear(); }
117
126 Teuchos::RCP<const Teuchos::ParameterList> getValidParameters() const;
127
128
129protected:
130
131 std::vector<int> indexList_; // Sorted and unique list of index events.
132
133};
134
135
136// Nonmember Contructors
137// ------------------------------------------------------------------------
138
148template<class Scalar>
149Teuchos::RCP<TimeEventListIndex<Scalar> >
150createTimeEventListIndex(Teuchos::RCP<Teuchos::ParameterList> pList);
151
152
153} // namespace Tempus
154
155#endif // Tempus_TimeEventListIndex_decl_hpp
This class defines time events which can be used to "trigger" an action.
TimeEventListIndex specifies a list of index events.
virtual bool eventInRangeIndex(int index1, int index2) const
Test if an event occurs within the index range.
virtual void setIndexList(std::vector< int > indexList, bool sort=true)
Set the vector of event indices.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Describe member data.
virtual void addIndex(int index)
Add the index to event vector.
virtual bool isIndex(int index) const
Test if index is a time event.
virtual void clearIndexList()
Clear the vector of all events.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Return a valid ParameterList with current settings.
virtual std::vector< int > getIndexList() const
Return a vector of event indices.
virtual int indexToNextEvent(int index) const
How many indices until the next event.
virtual int indexOfNextEvent(int index) const
Return the index of the next event following the input index.
Teuchos::RCP< TimeEventListIndex< Scalar > > createTimeEventListIndex(Teuchos::RCP< Teuchos::ParameterList > pList)
Nonmember Constructor via ParameterList.