Tempus Version of the Day
Time Integration
Loading...
Searching...
No Matches
Tempus_TimeEventRangeIndex_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_TimeEventIndexRange_decl_hpp
10#define Tempus_TimeEventIndexRange_decl_hpp
11
12#include <tuple>
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 TimeEventRangeIndex : virtual public TimeEventBase<Scalar>
30{
31public:
32
35
37 TimeEventRangeIndex(int start, int stop, int stride, std::string name = "");
38
41
43
44
51 virtual bool isIndex(int index) const;
52
58 virtual int indexToNextEvent(int index) const;
59
71 virtual int indexOfNextEvent(int index) const;
72
82 virtual bool eventInRangeIndex(int index1, int index2) const;
83
85 virtual void describe(Teuchos::FancyOStream &out,
86 const Teuchos::EVerbosityLevel verbLevel) const;
88
90
91
99 virtual void setIndexRange(int start, int stop, int stride)
100 { setIndexStart(start); setIndexStop(stop); setIndexStride(stride); }
101
103 virtual int getIndexStart() const { return start_; }
105 virtual void setIndexStart(int start);
106
108 virtual int getIndexStop() const { return stop_; }
110 virtual void setIndexStop(int stop);
111
113 virtual int getIndexStride() const { return stride_; }
115 virtual void setIndexStride(int stride);
116
118 virtual int getNumEvents() const { return numEvents_; }
119
121 virtual void setNumEvents();
123
132 Teuchos::RCP<const Teuchos::ParameterList> getValidParameters() const;
133
134
135protected:
136
137 int start_;
138 int stop_;
140 unsigned numEvents_;
141
142};
143
144
145// Nonmember Contructors
146// ------------------------------------------------------------------------
147
157template<class Scalar>
158Teuchos::RCP<TimeEventRangeIndex<Scalar> >
159createTimeEventRangeIndex(Teuchos::RCP<Teuchos::ParameterList> pList);
160
161
162} // namespace Tempus
163
164#endif // Tempus_TimeEventIndexRange_decl_hpp
This class defines time events which can be used to "trigger" an action.
TimeEventRangeIndex specifies a start, stop and stride index.
virtual int getIndexStop() const
Return the stop of the index range.
virtual bool isIndex(int index) const
Test if index is a time event.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Describe member data.
virtual void setIndexStop(int stop)
Set the stop of the index range.
virtual int indexOfNextEvent(int index) const
Return the index of the next event following the input index.
virtual void setIndexRange(int start, int stop, int stride)
Set the range of event indices.
virtual bool eventInRangeIndex(int index1, int index2) const
Test if an event occurs within the index range.
unsigned numEvents_
Number of events in index range.
virtual void setIndexStart(int start)
Set the start of the index range.
virtual int getNumEvents() const
Return the number of events.
virtual void setNumEvents()
Set the number of events from start_, stop_ and stride_.
virtual int indexToNextEvent(int index) const
How many indices until the next event.
virtual int getIndexStride() const
Return the stride of the index range.
virtual int getIndexStart() const
Return the start of the index range.
virtual void setIndexStride(int stride)
Set the stride of the index range.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Return a valid ParameterList with current settings.
Teuchos::RCP< TimeEventRangeIndex< Scalar > > createTimeEventRangeIndex(Teuchos::RCP< Teuchos::ParameterList > pList)
Nonmember Constructor via ParameterList.