mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Provide routine to return the step length taken
The output routine needs to know which step that has been taken in the past (to arrive at this result), not which step to take next going forward.
This commit is contained in:
parent
73dfe849d6
commit
f30ab55974
@ -89,6 +89,12 @@ namespace Opm
|
|||||||
return timesteps_[current_step_];
|
return timesteps_[current_step_];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double SimulatorTimer::stepLengthTaken() const
|
||||||
|
{
|
||||||
|
assert(current_step_ > 0);
|
||||||
|
return timesteps_[current_step_ - 1];
|
||||||
|
}
|
||||||
|
|
||||||
/// Current time.
|
/// Current time.
|
||||||
double SimulatorTimer::currentTime() const
|
double SimulatorTimer::currentTime() const
|
||||||
{
|
{
|
||||||
|
@ -59,10 +59,20 @@ namespace Opm
|
|||||||
/// Set current step number.
|
/// Set current step number.
|
||||||
void setCurrentStepNum(int step);
|
void setCurrentStepNum(int step);
|
||||||
|
|
||||||
/// Current step length.
|
/// Current step length. This is the length of the step
|
||||||
/// Note: if done(), it is an error to call currentStepLength().
|
/// the simulator will take in the next iteration.
|
||||||
|
///
|
||||||
|
/// @note if done(), it is an error to call currentStepLength().
|
||||||
double currentStepLength() const;
|
double currentStepLength() const;
|
||||||
|
|
||||||
|
/// Previous step length. This is the length of the step that
|
||||||
|
/// was taken to arrive at this time.
|
||||||
|
///
|
||||||
|
/// @note if no increments have been done (i.e. the timer is
|
||||||
|
/// still in its constructed state and currentStepNum() == 0),
|
||||||
|
/// it is an error to call stepLengthTaken().
|
||||||
|
double stepLengthTaken () const;
|
||||||
|
|
||||||
/// Current time.
|
/// Current time.
|
||||||
double currentTime() const;
|
double currentTime() const;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user