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(getParam<
int>(
"initial_direction")),
36 _percent_change(getParam<
Real>(
"percent_change")),
37 _older_sol_time_vs_dt(
std::numeric_limits<
Real>::
max()),
38 _old_sol_time_vs_dt(
std::numeric_limits<
Real>::
max()),
39 _sol_time_vs_dt(
std::numeric_limits<
Real>::
max()),
40 _adapt_log(getParam<bool>(
"adapt_log"))
45 static const std::string
log(
"adaptive_log");
58 auto solve_start = std::chrono::system_clock::now();
62 auto solve_end = std::chrono::system_clock::now();
64 std::chrono::duration_cast<std::chrono::milliseconds>(solve_end - solve_start).count();
77 return getParam<Real>(
"dt");
113 _console <<
"Solve failed... cutting timestep" << std::endl;
115 _adaptive_log <<
"Solve failed... cutting timestep" << std::endl;
static InputParameters validParams()
Real _percent_change
Percentage to change the timestep by either way.
Real _older_sol_time_vs_dt
Ratios to control whether to increase or decrease the current timestep.
registerMooseObject("MooseApp", SolutionTimeAdaptiveDT)
bool _adapt_log
Boolean to control whether a separate adapt log is written to a file.
Base class for time stepping.
static InputParameters validParams()
const Parallel::Communicator & _communicator
std::ofstream _adaptive_log
The filehandle to hold the log.
auto max(const L &left, const R &right)
virtual Real computeDT() override
Computes time step size after the initial time step.
short _direction
Multiplier specifying the direction the timestep is currently going.
SolutionTimeAdaptiveDT(const InputParameters ¶meters)
virtual Real computeInitialDT() override
Computes time step size for the initial time step.
virtual void rejectStep() override
This gets called when time step is rejected.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void max(const T &r, T &o, Request &req) const
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.
virtual void step()
Take a time step.
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
virtual void step() override
Take a time step.
virtual ~SolutionTimeAdaptiveDT()
processor_id_type processor_id() const
Real getCurrentDT()
Get the current_dt.
void ErrorVector unsigned int
Real & _time
Values from executioner.