WARPXM v1.10.0
|
Base class for objects which can be advanced in time. More...
#include <wxstepper.h>
Base class for objects which can be advanced in time.
Classes derived from this must provide the step() method which advances the state of the object by the assigned time step dt, getDt(). Objects can obtain the current time at which they are called by using the getCurrentTime() method.
Public Types | |
typedef real | time_t |
Time scalar data type. | |
Public Member Functions | |
WxStepper () | |
Create a new stepper. | |
virtual | ~WxStepper () |
Dtor: destroy object. | |
void | setDt (time_t dt) |
Set time-step for the step method. | |
time_t | getDt () const |
Get time-step for the step method. | |
void | setTimeData (const WxStepper &timeData) |
Set time data for the step method. | |
void | setCurrentTime (time_t tcurr) |
Set current time. | |
time_t | incrementCurrentTime (time_t tadd) |
Increment current time. | |
time_t | getCurrentTime () const |
Get the current time. | |
void | setCurrentFrame (int frame) |
Set current frame number. | |
int | incrementCurrentFrame () |
Increment current frame number. | |
int | getCurrentFrame () const |
Get the current frame number. | |
virtual WxStepperStatus | step ()=0 |
Advance the stepper by assigned time step. | |
virtual WxStepperStatus | end () |
Perform actions only done at simulation end. | |
typedef real WxStepper::time_t |
Time scalar data type.
|
inline |
Create a new stepper.
setDt_callback | pointer to optional callback function. When provided, function will be called after dt is updated, and before returning from the set member function. |
setCurrentTime_callback | pointer to optional callback function. When provided, function will be called after current time is updated, and before returning from the set member function. Both callbacks provide a pointer to this instance and the new value in question. |
|
virtual |
Dtor: destroy object.
|
inlinevirtual |
Perform actions only done at simulation end.
Unless redifined by the child class, will just call step() by default.
Reimplemented in WmWriteOut.
|
inline |
Get the current frame number.
|
inline |
Get the current time.
|
inline |
Get time-step for the step method.
int WxStepper::incrementCurrentFrame | ( | ) |
Increment current frame number.
Increment current time.
tadd | Amout of time to increment by. |
void WxStepper::setCurrentFrame | ( | int | frame | ) |
Set current frame number.
frame | Current frame number |
void WxStepper::setCurrentTime | ( | time_t | tcurr | ) |
Set current time.
tcurr | Current time |
void WxStepper::setDt | ( | time_t | dt | ) |
Set time-step for the step method.
dt | Time-step |
void WxStepper::setTimeData | ( | const WxStepper & | timeData | ) |
Set time data for the step method.
time | data object to copy from |
|
pure virtual |
Advance the stepper by assigned time step.
The status of the step should be encoded in the return object. See WxStepperStatus for details on what fields can be set.
Implemented in wxm::host_actions::data_loader, WmFillValue, WmFunctionApplicator, WmGhostSync, WmICGenerator, WmPatchProcessor, WmProbeLocation, WmSynchronizer, WmTestSuggestedDt, WmTimedSwapVariables, WmVariableLoader, WmVariableSwapper, wxm::temporal::implicit, WmTemporalSolver_RK, wxm::diagnostics::Diagnostic, wxm::diagnostics::WmIntegrator, wxm::diagnostics::DiagnosticsWriter, wxm::dt_calc::time_stepper_base, wxm::va_runner, and WmWriteOut.