24 "percent_change", 0.1,
"Fraction to change the timestep by. Should be between 0 and 1");
26 "initial_direction", 1,
"Direction for the first step. 1 for up... -1 for down. ");
27 params.
addParam<
bool>(
"adapt_log",
false,
"Output adaptive time step log");
35 _direction(declareRestartableData<
int>(
"direction", getParam<
int>(
"initial_direction"))),
36 _percent_change(getParam<Real>(
"percent_change")),
37 _older_sol_time_vs_dt(
38 declareRestartableData<Real>(
"older_sol_time_vs_dt",
std::numeric_limits<Real>::max())),
40 declareRestartableData<Real>(
"old_sol_time_vs_dt",
std::numeric_limits<Real>::max())),
42 declareRestartableData<Real>(
"sol_time_vs_dt",
std::numeric_limits<Real>::max())),
43 _adapt_log(getParam<bool>(
"adapt_log"))
47 static const std::string log(
"adaptive_log");
70std::chrono::milliseconds::rep
73 auto start = std::chrono::system_clock::now();
75 auto end = std::chrono::system_clock::now();
76 return std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
82 return getParam<Real>(
"dt");
118 _console <<
"Solve failed... cutting timestep" << std::endl;
120 _adaptive_log <<
"Solve failed... cutting timestep" << std::endl;
registerMooseObject("MooseApp", SolutionTimeAdaptiveDT)
void ErrorVector unsigned int
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
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...
SolutionTimeAdaptiveDT(const InputParameters ¶meters)
virtual Real computeDT() override
Computes time step size after the initial time step.
virtual ~SolutionTimeAdaptiveDT()
virtual std::chrono::milliseconds::rep stepAndRecordElapsedTime()
Take a step and record the elapsed time.
int & _direction
Multiplier specifying the direction the timestep is currently going.
std::ofstream _adaptive_log
The filehandle to hold the log.
virtual void rejectStep() override
This gets called when time step is rejected.
virtual Real computeInitialDT() override
Computes time step size for the initial time step.
const Real _percent_change
Percentage to change the timestep by either way.
virtual void step() override
Take a time step.
Real & _old_sol_time_vs_dt
static InputParameters validParams()
bool _adapt_log
Boolean to control whether a separate adapt log is written to a file.
Real & _older_sol_time_vs_dt
Ratios to control whether to increase or decrease the current timestep.
void max(const T &r, T &o, Request &req) const
Base class for time stepping.
virtual void rejectStep()
This gets called when time step is rejected.
static InputParameters validParams()
virtual void step()
Take a time step.
Real getCurrentDT()
Get the current_dt.
Real & _time
Values from executioner.
const Parallel::Communicator & _communicator
processor_id_type processor_id() const