WARPXM v1.10.0
Loading...
Searching...
No Matches
wxstepper.h
Go to the documentation of this file.
1#ifndef wxstepper_h
2#define wxstepper_h
3
4// WarpX lib includes
5
6// WarpX solver includes
8#include "wxstepperstatus.h"
9
14// Forward declarations
15
26{
27public:
31 typedef real time_t;
32
45 {
46 }
47
49 virtual ~WxStepper();
50
56 void setDt(time_t dt);
57
63 time_t getDt() const
64 {
65 return _step.dt;
66 }
67
73 void setTimeData(const WxStepper& timeData);
74
81
89
96 {
97 return _step.tcurr;
98 }
99
105 void setCurrentFrame(int frame);
106
118 int getCurrentFrame() const
119 {
120 return _step.frame;
121 }
122
132 virtual WxStepperStatus step() = 0;
133
142 {
143 return step();
144 }
145
146private:
147 struct step_attribute_t
148 {
149 // Initialize to zero
150 step_attribute_t() : dt(0.0), tcurr(0.0), frame(0)
151 {
152 }
153
155 time_t dt;
157 time_t tcurr;
159 int frame;
160 };
161
162 step_attribute_t _step;
163};
164
167#endif // wxstepper_h
Base class for objects which can be advanced in time.
Definition: wxstepper.h:26
void setDt(time_t dt)
Set time-step for the step method.
void setCurrentFrame(int frame)
Set current frame number.
virtual WxStepperStatus step()=0
Advance the stepper by assigned time step.
time_t getDt() const
Get time-step for the step method.
Definition: wxstepper.h:63
virtual WxStepperStatus end()
Perform actions only done at simulation end.
Definition: wxstepper.h:141
int getCurrentFrame() const
Get the current frame number.
Definition: wxstepper.h:118
virtual ~WxStepper()
Dtor: destroy object.
WxStepper()
Create a new stepper.
Definition: wxstepper.h:44
void setCurrentTime(time_t tcurr)
Set current time.
int incrementCurrentFrame()
Increment current frame number.
time_t getCurrentTime() const
Get the current time.
Definition: wxstepper.h:95
time_t incrementCurrentTime(time_t tadd)
Increment current time.
real time_t
Time scalar data type.
Definition: wxstepper.h:31
void setTimeData(const WxStepper &timeData)
Set time data for the step method.
Represents important parameters for the efficacy of a completing simulation step.
Definition: wxstepperstatus.h:19
int dt
Definition: avisc_artificial_dissipation_1d.py:184
frame
Definition: postproc_1d.py:35
#define real
Definition: wmoclunstructuredreconstruction.h:11