22 "use_last_dt_after_last_t",
24 "If true, uses the final time step size for times after the last time in the sequence, " 25 "instead of taking a single step directly to the simulation end time");
27 "use_last_t_for_end_time",
false,
"Use last time in sequence as 'end_time' in Executioner.");
33 _use_last_dt_after_last_t(getParam<bool>(
"use_last_dt_after_last_t")),
34 _current_step(declareRestartableData<unsigned
int>(
"current_step", 0)),
35 _time_sequence(declareRestartableData<
std::vector<
Real>>(
"time_sequence")),
36 _set_end_time(getParam<bool>(
"use_last_t_for_end_time"))
64 mooseError(
"Timesequencestepper does not allow the start time to be modified.");
70 for (
unsigned int j = 0; j < times.size() - 1; ++j)
71 if (times[j + 1] <= times[j])
72 mooseError(
"time_sequence must be in ascending order.");
75 mooseError(
"The timesequence provided in the restart file must be identical to " 76 "the one in the old file up to entry number ",
78 " but there are only ",
80 " value(s) provided for the timesequence in the restart input.");
91 mooseError(
"The timesequence provided in the restart file must be identical to " 92 "the one in the old file up to entry number ",
98 " in the restart input but ",
99 saved_time_sequence[j],
100 " in the restarted input.");
106 for (
unsigned int j =
_current_step + 1; j < times.size(); ++j)
108 if (times[j] < end_time)
138 if (!
std::is_sorted(times.begin(), times.end(), std::less_equal<Real>()))
139 paramError(
"time_sequence",
"Time points must be in strictly ascending order.");
142 for (
unsigned int j = 0; j < times.size(); ++j)
144 if (times[j] > start_time && times[j] < end_time)
192 mooseError(
"Solve failed and timestep already at or below dtmin, cannot continue!");
TransientBase & _executioner
Reference to transient executioner.
static InputParameters validParams()
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
Function to check whether two variables are equal within an absolute tolerance.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
virtual Real computeFailedDT() override
Computes time step size after a failed time step.
unsigned int & _current_step
the step that the time stepper is currently at
Base class for time stepping.
TimeSequenceStepperBase(const InputParameters ¶meters)
Real getStartTime() const
Return the start time.
void setupSequence(const std::vector< Real > ×)
const Real _cutback_factor_at_failure
Cutback factor if a time step fails to converge.
void increaseCurrentStep()
bool isRestarting() const
Whether or not this is a "restart" calculation.
const bool _set_end_time
Whether to use the last t in sequence as Executioner end_time.
virtual void acceptStep()
This gets called when time step is accepted.
std::vector< Real > & _time_sequence
stores the sequence of time points
bool testCheckpointHalfTransient() const
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
constexpr bool is_sorted()
Check if the given index sequence is sorted ()internal function)
MooseApp & _app
The MOOSE application this is associated with.
virtual Real computeDT() override
Computes time step size after the initial time step.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real & endTime()
Get a modifiable reference to the end time.
virtual Real computeInitialDT() override
Computes time step size for the initial time step.
virtual Real getNextTimeInSequence()
static InputParameters validParams()
const bool _use_last_dt_after_last_t
Whether to use the final dt past the last t in sequence.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
bool absoluteFuzzyGreaterEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
Function to check whether a variable is greater than or equal to another variable within an absolute ...
virtual void acceptStep() override
This gets called when time step is accepted.
bool isRecovering() const
Whether or not this is a "recover" calculation.
void ErrorVector unsigned int
Real & _time
Values from executioner.
void updateSequence(const std::vector< Real > ×)