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");
31 _use_last_dt_after_last_t(getParam<bool>(
"use_last_dt_after_last_t")),
32 _current_step(declareRestartableData<unsigned
int>(
"current_step", 0)),
33 _time_sequence(declareRestartableData<
std::vector<
Real>>(
"time_sequence"))
56 if (!
std::is_sorted(times.begin(), times.end(), std::less_equal<Real>()))
57 paramError(
"time_sequence",
"Time points must be in strictly ascending order.");
60 for (
unsigned int j = 0; j < times.size(); ++j)
62 if (times[j] > start_time && times[j] < end_time)
77 mooseError(
"Timesequencestepper does not allow the start time to be modified.");
83 for (
unsigned int j = 0; j < times.size() - 1; ++j)
84 if (times[j + 1] <= times[j])
85 mooseError(
"time_sequence must be in ascending order.");
95 mooseError(
"The timesequence provided in the restart file must be identical to " 96 "the one in the old file up to entry number ",
105 for (
unsigned int j =
_current_step + 1; j < times.size(); ++j)
107 if (times[j] < end_time)
155 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.
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 > ×)
virtual bool converged() const
If the time step converged.
const Real _cutback_factor_at_failure
Cutback factor if a time step fails to converge.
bool isRestarting() const
Whether or not this is a "restart" calculation.
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.
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 ...
bool XFEMRepeatStep() const
This function checks the _xfem_repeat_step flag set by solve.
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.
FixedPointSolve & fixedPointSolve()
static InputParameters validParams()
const bool _use_last_dt_after_last_t
Whether to use the final dt past the last t in sequence.
virtual void step() override
Take a time step.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
virtual void step()
Take a time step.
bool isRecovering() const
Whether or not this is a "recover" calculation.
void ErrorVector unsigned int