Go to the documentation of this file.
25 "percent_change", 0.1,
"Percentage to change the timestep by. Should be between 0 and 1");
27 "initial_direction", 1,
"Direction for the first step. 1 for up... -1 for down. ");
28 params.
addParam<
bool>(
"adapt_log",
false,
"Output adaptive time step log");
36 _direction(getParam<int>(
"initial_direction")),
37 _percent_change(getParam<Real>(
"percent_change")),
38 _older_sol_time_vs_dt(
std::numeric_limits<Real>::max()),
39 _old_sol_time_vs_dt(
std::numeric_limits<Real>::max()),
40 _sol_time_vs_dt(
std::numeric_limits<Real>::max()),
41 _adapt_log(getParam<bool>(
"adapt_log"))
46 static const std::string log(
"adaptive_log");
59 auto solve_start = std::chrono::system_clock::now();
65 auto solve_end = std::chrono::system_clock::now();
67 std::chrono::duration_cast<std::chrono::milliseconds>(solve_end - solve_start).count();
78 return getParam<Real>(
"dt");
114 _console <<
"Solve failed... cutting timestep" << std::endl;
116 _adaptive_log <<
"Solve failed... cutting timestep" << std::endl;
Real _percent_change
Percentage to change the timestep by either way.
Real getCurrentDT()
Get the current_dt.
void mooseError(Args &&... args) const
SolutionTimeAdaptiveDT(const InputParameters ¶meters)
Real & _time
Values from executioner.
Real _older_sol_time_vs_dt
Ratios to control whether to increase or decrease the current timestep.
virtual bool converged() const
If the time step converged.
std::ofstream _adaptive_log
The filehandle to hold the log.
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
short _direction
Multiplier specifying the direction the timestep is currently going.
virtual ~SolutionTimeAdaptiveDT()
Base class for time stepping.
virtual Real computeDT() override
Called to compute _current_dt for a normal step.
virtual void step() override
Take a time step.
virtual void step()
Take a time step.
registerMooseObject("MooseApp", SolutionTimeAdaptiveDT)
virtual void rejectStep()
This gets called when time step is rejected.
virtual Real computeInitialDT() override
Called to compute _current_dt for the first timestep.
virtual void rejectStep() override
This gets called when time step is rejected.
static InputParameters validParams()
defineLegacyParams(SolutionTimeAdaptiveDT)
static InputParameters validParams()
bool _adapt_log
Boolean to control whether a separate adapt log is written to a file.