www.mooseframework.org
IterationAdaptiveDT.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 // MOOSE includes
11 #include "IterationAdaptiveDT.h"
12 #include "Function.h"
13 #include "PiecewiseLinear.h"
14 #include "Transient.h"
15 #include "NonlinearSystem.h"
16 
18 
20 
23 {
25  params.addClassDescription("Adjust the timestep based on the number of iterations");
26  params.addParam<int>("optimal_iterations",
27  "The target number of nonlinear iterations for adaptive timestepping");
28  params.addParam<int>("iteration_window",
29  "Attempt to grow/shrink timestep if the iteration count "
30  "is below/above 'optimal_iterations plus/minus "
31  "iteration_window' (default = optimal_iterations/5).");
32  params.addParam<unsigned>("linear_iteration_ratio",
33  "The ratio of linear to nonlinear iterations "
34  "to determine target linear iterations and "
35  "window for adaptive timestepping (default = "
36  "25)");
37  params.addParam<PostprocessorName>("timestep_limiting_postprocessor",
38  "If specified, the postprocessor value "
39  "is used as an upper limit for the "
40  "current time step length");
41  params.addParam<FunctionName>("timestep_limiting_function",
42  "A 'PiecewiseBase' type function used to control the timestep by "
43  "limiting the change in the function over a timestep");
44  params.addParam<Real>(
45  "max_function_change",
46  "The absolute value of the maximum change in timestep_limiting_function over a timestep");
47  params.addParam<bool>("force_step_every_function_point",
48  false,
49  "Forces the timestepper to take "
50  "a step that is consistent with "
51  "points defined in the function");
52  params.addRequiredParam<Real>("dt", "The default timestep size between solves");
53  params.addParam<std::vector<Real>>("time_t", "The values of t");
54  params.addParam<std::vector<Real>>("time_dt", "The values of dt");
55  params.addParam<Real>("growth_factor",
56  2.0,
57  "Factor to apply to timestep if easy convergence (if "
58  "'optimal_iterations' is specified) or if recovering "
59  "from failed solve");
60  params.addParam<Real>("cutback_factor",
61  0.5,
62  "Factor to apply to timestep if difficult "
63  "convergence (if 'optimal_iterations' is specified) "
64  "or if solution failed");
65 
66  params.addParam<bool>("reject_large_step",
67  false,
68  "If 'true', time steps that are too large compared to the "
69  "ideal time step will be rejected and repeated");
70  params.addRangeCheckedParam<Real>("reject_large_step_threshold",
71  0.1,
72  "reject_large_step_threshold > 0 "
73  "& reject_large_step_threshold < 1",
74  "Ratio between the the ideal time step size and the "
75  "current time step size below which a time step will "
76  "be rejected if 'reject_large_step' is 'true'");
77 
78  params.declareControllable("growth_factor cutback_factor");
79 
80  return params;
81 }
82 
84  : TimeStepper(parameters),
86  _dt_old(declareRestartableData<Real>("dt_old", 0.0)),
87  _input_dt(getParam<Real>("dt")),
88  _tfunc_last_step(declareRestartableData<bool>("tfunc_last_step", false)),
89  _sync_last_step(declareRestartableData<bool>("sync_last_step", false)),
90  _linear_iteration_ratio(isParamValid("linear_iteration_ratio")
91  ? getParam<unsigned>("linear_iteration_ratio")
92  : 25), // Default to 25
93  _adaptive_timestepping(false),
94  _pps_value(isParamValid("timestep_limiting_postprocessor")
95  ? &getPostprocessorValue("timestep_limiting_postprocessor")
96  : nullptr),
97  _timestep_limiting_function(nullptr),
98  _piecewise_timestep_limiting_function(nullptr),
99  _piecewise_linear_timestep_limiting_function(nullptr),
100  _times(0),
101  _max_function_change(-1),
102  _force_step_every_function_point(getParam<bool>("force_step_every_function_point")),
103  _tfunc_times(getParam<std::vector<Real>>("time_t").begin(),
104  getParam<std::vector<Real>>("time_t").end()),
105  _time_ipol(getParam<std::vector<Real>>("time_t"), getParam<std::vector<Real>>("time_dt")),
106  _use_time_ipol(_time_ipol.getSampleSize() > 0),
107  _growth_factor(getParam<Real>("growth_factor")),
108  _cutback_factor(getParam<Real>("cutback_factor")),
109  _nl_its(declareRestartableData<unsigned int>("nl_its", 0)),
110  _l_its(declareRestartableData<unsigned int>("l_its", 0)),
111  _cutback_occurred(declareRestartableData<bool>("cutback_occurred", false)),
112  _at_function_point(false),
113  _reject_large_step(getParam<bool>("reject_large_step")),
114  _large_step_rejection_threshold(getParam<Real>("reject_large_step_threshold"))
115 {
116  if (isParamValid("optimal_iterations"))
117  {
118  _adaptive_timestepping = true;
119  _optimal_iterations = getParam<int>("optimal_iterations");
120 
121  if (isParamValid("iteration_window"))
122  _iteration_window = getParam<int>("iteration_window");
123  else
125  }
126  else
127  {
128  if (isParamValid("iteration_window"))
129  mooseError("'optimal_iterations' must be used for 'iteration_window' to be used");
130  if (isParamValid("linear_iteration_ratio"))
131  mooseError("'optimal_iterations' must be used for 'linear_iteration_ratio' to be used");
132  }
133 
134  if (isParamValid("timestep_limiting_function"))
136  isParamValid("max_function_change") ? getParam<Real>("max_function_change") : -1;
137  else
138  {
139  if (isParamValid("max_function_change"))
140  mooseError("'timestep_limiting_function' must be used for 'max_function_change' to be used");
142  mooseError("'timestep_limiting_function' must be used for 'force_step_every_function_point' "
143  "to be used");
144  }
145 }
146 
147 void
149 {
150  if (isParamValid("timestep_limiting_function"))
151  {
153  &_fe_problem.getFunction(getParam<FunctionName>("timestep_limiting_function"),
154  isParamValid("_tid") ? getParam<THREAD_ID>("_tid") : 0);
156  dynamic_cast<const PiecewiseBase *>(_timestep_limiting_function);
157 
159  {
161  dynamic_cast<const PiecewiseLinear *>(_piecewise_timestep_limiting_function);
162  unsigned int time_size = _piecewise_timestep_limiting_function->functionSize();
163  _times.resize(time_size);
164 
165  for (unsigned int i = 0; i < time_size; ++i)
167  }
168  else
169  mooseError("timestep_limiting_function must be a PiecewiseBase function");
170  }
171 }
172 
173 void
175 {
177 
178  // Delete all tfunc times that are at or before the begin time
179  while (!_tfunc_times.empty() && _time + _timestep_tolerance >= *_tfunc_times.begin())
180  _tfunc_times.erase(_tfunc_times.begin());
181 }
182 
183 Real
185 {
186  return _input_dt;
187 }
188 
189 Real
191 {
192  Real dt = _dt_old;
193 
194  if (_cutback_occurred)
195  {
196  _cutback_occurred = false;
198  {
199  // Don't allow it to grow this step, but shrink if needed
200  bool allowToGrow = false;
201  computeAdaptiveDT(dt, allowToGrow);
202  }
203  }
204  else if (_tfunc_last_step)
205  {
206  _tfunc_last_step = false;
207  _sync_last_step = false;
209 
210  if (_verbose)
211  {
212  _console << "Setting dt to value specified by dt function: " << std::setw(9) << dt << '\n';
213  }
214  }
215  else if (_sync_last_step)
216  {
217  _sync_last_step = false;
218  dt = _dt_old;
219 
220  if (_verbose)
221  {
222  _console << "Setting dt to value used before sync: " << std::setw(9) << dt << '\n';
223  }
224  }
225  else if (_adaptive_timestepping)
226  computeAdaptiveDT(dt);
227  else if (_use_time_ipol)
228  dt = computeInterpolationDT();
229  else
230  {
231  dt *= _growth_factor;
232  if (dt > _dt_old * _growth_factor)
233  dt = _dt_old * _growth_factor;
234  }
235 
236  return dt;
237 }
238 
239 bool
241 {
242  bool at_sync_point = TimeStepper::constrainStep(dt);
243 
244  // Limit the timestep to postprocessor value
246 
247  // Limit the timestep to limit change in the function
248  limitDTByFunction(dt);
249 
250  // Adjust to the next tfunc time if needed
251  if (!_tfunc_times.empty() && _time + dt + _timestep_tolerance >= *_tfunc_times.begin())
252  {
253  dt = *_tfunc_times.begin() - _time;
254 
255  if (_verbose)
256  {
257  _console << "Limiting dt to sync with dt function time: " << std::setw(9)
258  << *_tfunc_times.begin() << " dt: " << std::setw(9) << dt << '\n';
259  }
260  }
261 
262  return at_sync_point;
263 }
264 
265 Real
267 {
268  _cutback_occurred = true;
269 
270  // Can't cut back any more
271  if (_dt <= _dt_min)
272  mooseError("Solve failed and timestep already at dtmin, cannot continue!");
273 
274  if (_verbose)
275  {
276  _console << "\nSolve failed with dt: " << std::setw(9) << _dt
277  << "\nRetrying with reduced dt: " << std::setw(9) << _dt * _cutback_factor << '\n';
278  }
279  else
280  _console << "\nSolve failed, cutting timestep.\n";
281 
282  return _dt * _cutback_factor;
283 }
284 
285 bool
287 {
288  if (!_reject_large_step)
289  return TimeStepper::converged();
290 
291  // the solver has not converged
292  if (!TimeStepper::converged())
293  return false;
294 
295  // we are already at dt_min or at the start of the simulation
296  // in which case we can move on to the next step
297  if (_dt == _dt_min || _t_step < 2)
298  return true;
299 
300  // we get what the next time step should be
301  Real dt_test = _dt;
303 
304  // we cannot constrain the time step any further
305  if (dt_test == 0)
306  return true;
307 
308  // if the time step is much smaller than the current time step
309  // we need to repeat the current iteration with a smaller time step
310  if (dt_test < _dt * _large_step_rejection_threshold)
311  return false;
312 
313  // otherwise we move one
314  return true;
315 }
316 
317 void
319 {
320  if (_pps_value && _t_step > 1)
321  {
322  if (limitedDT > *_pps_value)
323  {
324  limitedDT = std::max(_dt_min, *_pps_value);
325 
326  if (_verbose)
327  _console << "Limiting dt to postprocessor value. dt = " << limitedDT << '\n';
328  }
329  }
330 }
331 
332 void
334 {
335  Real orig_dt = limitedDT;
336 
337  // Limit by function change for piecewise linear functions.
339  {
340  const auto current_function_value =
342 
343  for (std::size_t next_time_index = 1; next_time_index < _times.size(); ++next_time_index)
344  {
345  const auto next_time = _times[next_time_index];
346 
347  // Skip ahead to find time point that is just past the current time.
348  if (next_time + _timestep_tolerance <= _time)
349  continue;
350 
351  // Find out how far we can go without exceeding the max function change.
352  const auto next_function_value =
354  const auto change = std::abs(next_function_value - current_function_value);
355  if (change > _max_function_change)
356  {
357  // Interpolate to find step.
358  const auto restrictedStep = (_max_function_change / change) * (next_time - _time);
359  if (restrictedStep < limitedDT)
360  {
361  limitedDT = std::max(_dt_min, restrictedStep);
362  }
363  break;
364  }
365 
366  // Don't keep going if we've already passed the current limited step.
367  if (next_time > _time + limitedDT)
368  break;
369  }
370  }
372  {
373  Point dummyPoint;
374  Real oldValue = _timestep_limiting_function->value(_time_old, dummyPoint);
375  Real newValue = _timestep_limiting_function->value(_time_old + limitedDT, dummyPoint);
376  Real change = std::abs(newValue - oldValue);
377 
378  if (_max_function_change > 0.0 && change > _max_function_change)
379  {
380  do
381  {
382  limitedDT /= 2.0;
383  newValue = _timestep_limiting_function->value(_time_old + limitedDT, dummyPoint);
384  change = std::abs(newValue - oldValue);
385  } while (change > _max_function_change);
386  }
387  }
388 
389  _at_function_point = false;
391  {
392  for (unsigned int i = 0; i + 1 < _times.size(); ++i)
393  {
394  if (_time >= _times[i] && _time < _times[i + 1])
395  {
396  if (limitedDT > _times[i + 1] - _time - _timestep_tolerance)
397  {
398  limitedDT = _times[i + 1] - _time;
399  _at_function_point = true;
400  }
401  break;
402  }
403  }
404  }
405 
406  if (_verbose && limitedDT != orig_dt)
407  {
408  if (_at_function_point)
409  _console << "Limiting dt to match function point. dt = ";
410  else
411  _console << "Limiting dt to limit change in function. dt = ";
412 
413  _console << limitedDT << '\n';
414  }
415 }
416 
417 void
418 IterationAdaptiveDT::computeAdaptiveDT(Real & dt, bool allowToGrow, bool allowToShrink)
419 {
420  const unsigned int growth_nl_its(
422  const unsigned int shrink_nl_its(_optimal_iterations + _iteration_window);
423  const unsigned int growth_l_its(_optimal_iterations > _iteration_window
426  : 0);
427  const unsigned int shrink_l_its(_linear_iteration_ratio *
429 
430  if (allowToGrow && (_nl_its < growth_nl_its && _l_its < growth_l_its))
431  {
432  // Grow the timestep
433  dt *= _growth_factor;
434 
435  if (_verbose)
436  {
437  _console << "Growing dt: nl its = " << _nl_its << " < " << growth_nl_its
438  << " && lin its = " << _l_its << " < " << growth_l_its << " old dt: " << std::setw(9)
439  << _dt_old << " new dt: " << std::setw(9) << dt << '\n';
440  }
441  }
442  else if (allowToShrink && (_nl_its > shrink_nl_its || _l_its > shrink_l_its))
443  {
444  // Shrink the timestep
445  dt *= _cutback_factor;
446 
447  if (_verbose)
448  {
449  _console << "Shrinking dt: nl its = " << _nl_its << " > " << shrink_nl_its
450  << " || lin its = " << _l_its << " > " << shrink_l_its << " old dt: " << std::setw(9)
451  << _dt_old << " new dt: " << std::setw(9) << dt << '\n';
452  }
453  }
454 }
455 
456 Real
458 {
459  Real dt = _time_ipol.sample(_time_old);
460 
461  if (dt > _dt_old * _growth_factor)
462  {
463  dt = _dt_old * _growth_factor;
464 
465  if (_verbose)
466  {
467  _console << "Growing dt to recover from cutback. "
468  << " old dt: " << std::setw(9) << _dt_old << " new dt: " << std::setw(9) << dt
469  << '\n';
470  }
471  }
472 
473  return dt;
474 }
475 
476 void
478 {
480 }
481 
482 void
484 {
486 
487  while (!_tfunc_times.empty() && _time + _timestep_tolerance >= *_tfunc_times.begin())
488  {
489  if (std::abs(_time - *_tfunc_times.begin()) <= _timestep_tolerance)
490  _tfunc_last_step = true;
491 
492  _tfunc_times.erase(_tfunc_times.begin());
493  }
494 
497 
500  {
502  _sync_last_step = true;
503 
504  if (_verbose)
505  {
506  _console << "Sync point hit in current step, using previous dt for old dt: " << std::setw(9)
507  << _dt_old << '\n';
508  }
509  }
510  else
511  _dt_old = _dt;
512 }
PiecewiseBase::functionSize
virtual Real functionSize() const
Definition: PiecewiseBase.C:70
InputParameters::declareControllable
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
Declare the given parameters as controllable.
Definition: InputParameters.C:297
IterationAdaptiveDT::limitDTToPostprocessorValue
void limitDTToPostprocessorValue(Real &limitedDT) const
Definition: IterationAdaptiveDT.C:318
IterationAdaptiveDT::_cutback_occurred
bool & _cutback_occurred
Definition: IterationAdaptiveDT.h:106
TimeStepper::_time_old
Real & _time_old
Definition: TimeStepper.h:127
TimeStepper::_dt
Real & _dt
Definition: TimeStepper.h:129
IterationAdaptiveDT::limitDTByFunction
void limitDTByFunction(Real &limitedDT)
Definition: IterationAdaptiveDT.C:333
IterationAdaptiveDT::computeInitialDT
virtual Real computeInitialDT() override
Called to compute _current_dt for the first timestep.
Definition: IterationAdaptiveDT.C:184
MooseObject::mooseError
void mooseError(Args &&... args) const
Definition: MooseObject.h:141
Function::value
virtual Real value(Real t, const Point &p) const
Override this to evaluate the scalar function at point (t,x,y,z), by default this returns zero,...
Definition: Function.C:39
TimeStepper::_time
Real & _time
Values from executioner.
Definition: TimeStepper.h:126
FEProblemBase::dtOld
virtual Real & dtOld() const
Definition: FEProblemBase.h:444
MooseObject::isParamValid
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
Definition: MooseObject.h:100
TimeStepper::_executioner
Transient & _executioner
Reference to transient executioner.
Definition: TimeStepper.h:123
IterationAdaptiveDT::computeAdaptiveDT
void computeAdaptiveDT(Real &dt, bool allowToGrow=true, bool allowToShrink=true)
Definition: IterationAdaptiveDT.C:418
LinearInterpolationTempl::sample
T sample(const T &x) const
This function will take an independent variable input and will return the dependent variable based on...
Definition: LinearInterpolation.C:48
std::abs
MetaPhysicL::DualNumber< T, D > abs(const MetaPhysicL::DualNumber< T, D > &in)
TimeStepper::_timestep_tolerance
Real & _timestep_tolerance
Definition: TimeStepper.h:135
IterationAdaptiveDT::init
virtual void init() override
Initialize the time stepper.
Definition: IterationAdaptiveDT.C:148
TimeStepper::constrainStep
virtual bool constrainStep(Real &dt)
Called after computeStep() is called.
Definition: TimeStepper.C:97
InputParameters::addParam
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object.
Definition: InputParameters.h:1198
TimeStepper::converged
virtual bool converged() const
If the time step converged.
Definition: TimeStepper.C:183
TimeStepper::_fe_problem
FEProblemBase & _fe_problem
Definition: TimeStepper.h:121
Transient::unconstrainedDT
Real unconstrainedDT()
Get the unconstrained dt.
Definition: Transient.h:186
IterationAdaptiveDT.h
IterationAdaptiveDT::computeInterpolationDT
Real computeInterpolationDT()
Definition: IterationAdaptiveDT.C:457
PiecewiseLinear.h
IterationAdaptiveDT::_tfunc_last_step
bool _tfunc_last_step
Definition: IterationAdaptiveDT.h:63
IterationAdaptiveDT::_force_step_every_function_point
bool _force_step_every_function_point
insert sync points at the time nodes of the _piecewise_timestep_limiting_function
Definition: IterationAdaptiveDT.h:87
IterationAdaptiveDT::_growth_factor
const Real & _growth_factor
grow the timestep by this factor
Definition: IterationAdaptiveDT.h:97
TimeStepper::_verbose
const bool & _verbose
should detailed diagnostic output be printed
Definition: TimeStepper.h:138
IterationAdaptiveDT::_at_function_point
bool _at_function_point
Definition: IterationAdaptiveDT.h:107
IterationAdaptiveDT::computeFailedDT
virtual Real computeFailedDT() override
Called to compute _current_dt after a solve has failed.
Definition: IterationAdaptiveDT.C:266
ConsoleStreamInterface::_console
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
Definition: ConsoleStreamInterface.h:31
InputParameters
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Definition: InputParameters.h:53
IterationAdaptiveDT::_timestep_limiting_function
const Function * _timestep_limiting_function
Definition: IterationAdaptiveDT.h:78
IterationAdaptiveDT::_nl_its
unsigned int & _nl_its
Number of nonlinear iterations in previous solve.
Definition: IterationAdaptiveDT.h:102
IterationAdaptiveDT::converged
virtual bool converged() const override
If the time step converged.
Definition: IterationAdaptiveDT.C:286
NonlinearSystem.h
IterationAdaptiveDT::validParams
static InputParameters validParams()
Definition: IterationAdaptiveDT.C:22
PiecewiseLinearBase::value
virtual Real value(Real t, const Point &pt) const override
Override this to evaluate the scalar function at point (t,x,y,z), by default this returns zero,...
Definition: PiecewiseLinearBase.C:48
IterationAdaptiveDT::_times
std::vector< Real > _times
time point defined in the piecewise function
Definition: IterationAdaptiveDT.h:83
IterationAdaptiveDT::rejectStep
virtual void rejectStep() override
This gets called when time step is rejected.
Definition: IterationAdaptiveDT.C:477
defineLegacyParams
defineLegacyParams(IterationAdaptiveDT)
PostprocessorInterface
Interface class for classes which interact with Postprocessors.
Definition: PostprocessorInterface.h:34
TimeStepper
Base class for time stepping.
Definition: TimeStepper.h:26
PiecewiseBase::range
virtual Real range(const int i) const
Definition: PiecewiseBase.C:82
IterationAdaptiveDT::_large_step_rejection_threshold
double _large_step_rejection_threshold
Threshold used to detect whether we need to reject a step.
Definition: IterationAdaptiveDT.h:112
IterationAdaptiveDT::_adaptive_timestepping
bool _adaptive_timestepping
adaptive timestepping is active if the optimal_iterations input parameter is specified
Definition: IterationAdaptiveDT.h:73
IterationAdaptiveDT::_iteration_window
int _iteration_window
...plus/minus this value.
Definition: IterationAdaptiveDT.h:69
InputParameters::addClassDescription
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
Definition: InputParameters.C:70
IterationAdaptiveDT::IterationAdaptiveDT
IterationAdaptiveDT(const InputParameters &parameters)
Definition: IterationAdaptiveDT.C:83
TimeStepper::acceptStep
virtual void acceptStep()
This gets called when time step is accepted.
Definition: TimeStepper.C:167
IterationAdaptiveDT::computeDT
virtual Real computeDT() override
Called to compute _current_dt for a normal step.
Definition: IterationAdaptiveDT.C:190
Transient::atSyncPoint
bool atSyncPoint()
Is the current step at a sync point (sync times, time interval, target time, etc)?
Definition: Transient.h:180
InputParameters::addRangeCheckedParam
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
Definition: InputParameters.h:1245
Transient.h
IterationAdaptiveDT::_piecewise_linear_timestep_limiting_function
const PiecewiseLinear * _piecewise_linear_timestep_limiting_function
Definition: IterationAdaptiveDT.h:80
TimeStepper::_dt_min
Real & _dt_min
Definition: TimeStepper.h:130
IterationAdaptiveDT::acceptStep
virtual void acceptStep() override
This gets called when time step is accepted.
Definition: IterationAdaptiveDT.C:483
std
Definition: TheWarehouse.h:80
IterationAdaptiveDT::_reject_large_step
bool _reject_large_step
Indicates whether we need to reject a time step much larger than its ideal size.
Definition: IterationAdaptiveDT.h:110
IterationAdaptiveDT::_time_ipol
LinearInterpolation _time_ipol
PiecewiseBase linear definition of time stepping.
Definition: IterationAdaptiveDT.h:92
IterationAdaptiveDT::_piecewise_timestep_limiting_function
const PiecewiseBase * _piecewise_timestep_limiting_function
Definition: IterationAdaptiveDT.h:79
FEProblemBase::getFunction
virtual Function & getFunction(const std::string &name, THREAD_ID tid=0)
Definition: FEProblemBase.C:1878
IterationAdaptiveDT::_tfunc_times
std::set< Real > _tfunc_times
Definition: IterationAdaptiveDT.h:89
TimeStepper::_t_step
int & _t_step
Definition: TimeStepper.h:128
IterationAdaptiveDT::constrainStep
virtual bool constrainStep(Real &dt) override
Called after computeStep() is called.
Definition: IterationAdaptiveDT.C:240
Function.h
IterationAdaptiveDT::_input_dt
const Real _input_dt
The dt from the input file.
Definition: IterationAdaptiveDT.h:61
IterationAdaptiveDT::_cutback_factor
const Real & _cutback_factor
cut the timestep by by this factor
Definition: IterationAdaptiveDT.h:99
PiecewiseBase::domain
virtual Real domain(const int i) const
Definition: PiecewiseBase.C:76
IterationAdaptiveDT::preExecute
virtual void preExecute() override
Definition: IterationAdaptiveDT.C:174
FEProblemBase::getNonlinearSystemBase
NonlinearSystemBase & getNonlinearSystemBase()
Definition: FEProblemBase.h:560
TimeStepper::rejectStep
virtual void rejectStep()
This gets called when time step is rejected.
Definition: TimeStepper.C:177
registerMooseObject
registerMooseObject("MooseApp", IterationAdaptiveDT)
IterationAdaptiveDT::_pps_value
const PostprocessorValue * _pps_value
if specified, the postprocessor value is an upper limit for the time step length
Definition: IterationAdaptiveDT.h:76
NonlinearSystemBase::nLinearIterations
unsigned int nLinearIterations() const
Return the number of linear iterations.
Definition: NonlinearSystemBase.h:502
IterationAdaptiveDT::_dt_old
Real & _dt_old
Definition: IterationAdaptiveDT.h:58
IterationAdaptiveDT::_sync_last_step
bool _sync_last_step
Definition: IterationAdaptiveDT.h:64
TimeStepper::validParams
static InputParameters validParams()
Definition: TimeStepper.C:18
IterationAdaptiveDT
Adjust the timestep based on the number of iterations.
Definition: IterationAdaptiveDT.h:32
IterationAdaptiveDT::_l_its
unsigned int & _l_its
Number of linear iterations in previous solve.
Definition: IterationAdaptiveDT.h:104
IterationAdaptiveDT::_optimal_iterations
int _optimal_iterations
Adapt the timestep to maintain this non-linear iteration count...
Definition: IterationAdaptiveDT.h:67
IterationAdaptiveDT::_use_time_ipol
const bool _use_time_ipol
true if we want to use piecewise-defined time stepping
Definition: IterationAdaptiveDT.h:94
TimeStepper::preExecute
virtual void preExecute()
Definition: TimeStepper.C:68
InputParameters::addRequiredParam
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
Definition: InputParameters.h:1176
IterationAdaptiveDT::_linear_iteration_ratio
const int _linear_iteration_ratio
use _optimal_iterations and _iteration_window multiplied with this factor for linear iterations
Definition: IterationAdaptiveDT.h:71
IterationAdaptiveDT::_max_function_change
Real _max_function_change
Definition: IterationAdaptiveDT.h:85
NonlinearSystemBase::nNonlinearIterations
unsigned int nNonlinearIterations() const
Return the number of non-linear iterations.
Definition: NonlinearSystemBase.h:497