www.mooseframework.org
ConstantDT.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #include "ConstantDT.h"
16 
17 template <>
20 {
22  params.addRequiredParam<Real>("dt", "Size of the time step");
23  params.addRangeCheckedParam<Real>(
24  "growth_factor",
25  2,
26  "growth_factor>=1",
27  "Maximum ratio of new to previous timestep sizes following a step that required the time"
28  " step to be cut due to a failed solve.");
29  params.addClassDescription("Timestepper that takes a constant time step size");
30  return params;
31 }
32 
34  : TimeStepper(parameters),
35  _constant_dt(getParam<Real>("dt")),
36  _growth_factor(getParam<Real>("growth_factor"))
37 {
38 }
39 
40 Real
42 {
43  return _constant_dt;
44 }
45 
46 Real
48 {
49  return std::min(_constant_dt, _growth_factor * getCurrentDT());
50 }
const Real _constant_dt
Definition: ConstantDT.h:35
const Real _growth_factor
Definition: ConstantDT.h:36
Base class for time stepping.
Definition: TimeStepper.h:31
ConstantDT(const InputParameters &parameters)
Definition: ConstantDT.C:33
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
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...
virtual Real computeDT() override
Called to compute _current_dt for a normal step.
Definition: ConstantDT.C:47
virtual Real computeInitialDT() override
Called to compute _current_dt for the first timestep.
Definition: ConstantDT.C:41
InputParameters validParams< ConstantDT >()
Definition: ConstantDT.C:19
InputParameters validParams< TimeStepper >()
Definition: TimeStepper.C:22
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...
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
Real getCurrentDT()
Get the current_dt.
Definition: TimeStepper.h:89