20 "reset_dt",
false,
"Use when restarting a calculation to force a change in dt.");
22 "cutback_factor_at_failure",
24 "cutback_factor_at_failure>0 & cutback_factor_at_failure<1",
25 "Factor to apply to timestep if a time step fails to converge.");
26 params.
addParam<
bool>(
"enable",
true,
"whether or not to enable the time stepper");
39 _fe_problem(parameters.have_parameter<
FEProblemBase *>(
"_fe_problem_base")
42 _executioner(*getCheckedPointerParam<
TransientBase *>(
"_executioner")),
43 _time(_fe_problem.time()),
44 _time_old(_fe_problem.timeOld()),
45 _t_step(_fe_problem.timeStep()),
46 _dt(_fe_problem.dt()),
47 _dt_min(_executioner.dtMin()),
48 _dt_max(_executioner.dtMax()),
49 _end_time(_executioner.endTime()),
50 _sync_times(_app.getOutputWarehouse().getSyncTimes()),
51 _timestep_tolerance(_executioner.timestepTol()),
52 _verbose(_executioner.verbose()),
54 _cutback_factor_at_failure(getParam<
Real>(
"cutback_factor_at_failure")),
55 _reset_dt(getParam<bool>(
"reset_dt")),
57 _currently_restepping(false),
59 _current_dt(declareRestartableData<
Real>(
"current_dt", 1.0))
99 " Investigate the TimeStepper to resolve this error");
105 bool at_sync_point =
false;
107 std::ostringstream diag;
113 diag <<
"Limiting dt to dtmax: " << std::setw(9) << std::setprecision(6) << std::setfill(
'0')
114 << std::showpoint << std::left <<
_dt_max << std::endl;
121 diag <<
"Increasing dt to dtmin: " << std::setw(9) << std::setprecision(6) << std::setfill(
'0')
122 << std::showpoint << std::left <<
_dt_min << std::endl;
129 diag <<
"Limiting dt for end_time: " << std::setw(9) << std::setprecision(6)
130 << std::setfill(
'0') << std::showpoint << std::left <<
_end_time <<
" dt: " << std::setw(9)
131 << std::setprecision(6) << std::setfill(
'0') << std::showpoint << std::left << dt
139 diag <<
"Limiting dt for sync_time: " << std::setw(9) << std::setprecision(6)
140 << std::setfill(
'0') << std::showpoint << std::left << *
_sync_times.begin()
141 <<
" dt: " << std::setw(9) << std::setprecision(6) << std::setfill(
'0') << std::showpoint
142 << std::left << dt << std::endl;
147 mooseError(
"Adjusting to sync_time resulted in a non-positive time step. dt: ",
155 at_sync_point =
true;
163 return at_sync_point;
210 mooseError(
"Solve failed and timestep already at or below dtmin, cannot continue!");
TransientBase & _executioner
Reference to transient executioner.
static InputParameters validParams()
Real & _timestep_tolerance
virtual Real computeInitialDT()=0
Computes time step size for the initial time step.
virtual Real computeFailedDT()
Computes time step size after a failed time step.
virtual void forceNumSteps(const unsigned int num_steps)
Set the number of time steps.
A class for creating restricted objects.
virtual SolveObject * timeStepSolveObject()
Return the solve object wrapped by time stepper.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
void computeStep()
Called before a new step is started.
unsigned int numFailures() const
Gets the number of failures and returns them.
virtual bool constrainStep(Real &dt)
Called after computeStep() is called.
virtual bool converged() const
If the time step converged.
const Real _cutback_factor_at_failure
Cutback factor if a time step fails to converge.
Real & _current_dt
Size of the current time step as computed by the Stepper. Note that the actual dt that was taken migh...
std::set< Real > & _sync_times
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const bool & _verbose
whether a detailed diagnostic output should be printed
FEProblemBase & _fe_problem
virtual void acceptStep()
This gets called when time step is accepted.
Every object that can be built by the factory should be derived from this class.
virtual Real computeDT()=0
Computes time step size after the initial time step.
TimeStepper(const InputParameters ¶meters)
bool _has_reset_dt
True if dt has been reset.
virtual void forceNumSteps(const unsigned int num_steps)
Set the number of time steps.
virtual void restoreSolutions()
bool testCheckpointHalfTransient() const
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
Base class for transient executioners that use a FixedPointSolve solve object for multiapp-main app i...
virtual void forceTimeStep(Real dt)
MooseApp & _app
The MOOSE application this is associated with.
bool _converged
Whether or not the previous solve converged.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void preExecute()
virtual void rejectStep()
This gets called when time step is rejected.
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...
Interface for objects that needs scalar coupling capabilities.
virtual void step()
Take a time step.
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
bool _currently_restepping
If we are currently solving a failed step.
static InputParameters validParams()
bool _reset_dt
If true then the next dt will be computed by computeInitialDT()
unsigned int _failure_count
Cumulative amount of steps that have failed.
virtual void init()
Initialize the time stepper.
virtual bool solve()=0
Solve routine provided by this object.
Real & _time
Values from executioner.