www.mooseframework.org
TimeStepper.h
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 #ifndef TIMESTEPPER_H
16 #define TIMESTEPPER_H
17 
18 #include "MooseObject.h"
19 #include "Restartable.h"
20 
21 class TimeStepper;
22 class FEProblemBase;
23 class Transient;
24 
25 template <>
27 
31 class TimeStepper : public MooseObject, public Restartable
32 {
33 public:
35  virtual ~TimeStepper();
36 
40  virtual void init();
41 
42  virtual void preExecute();
43  virtual void preSolve() {}
44  virtual void postSolve() {}
45  virtual void postExecute() {}
46  virtual void preStep() {}
47  virtual void postStep() {}
48 
57  void computeStep();
58 
63  virtual bool constrainStep(Real & dt);
64 
68  virtual void step();
69 
73  virtual void acceptStep();
74 
78  virtual void rejectStep();
79 
84  virtual bool converged();
85 
89  Real getCurrentDT() { return _current_dt; }
90 
91  virtual void forceTimeStep(Real dt);
92 
94 
98  void addSyncTime(Real sync_time);
99  void addSyncTime(const std::set<Real> & times);
101 
102 protected:
108  virtual Real computeInitialDT() = 0;
109 
115  virtual Real computeDT() = 0;
116 
122  virtual Real computeFailedDT();
123 
127 
129  Real & _time;
130  Real & _time_old;
131  int & _t_step;
132  Real & _dt;
133  Real & _dt_min;
134  Real & _dt_max;
135  Real & _end_time;
136  std::set<Real> & _sync_times;
137 
139 
141  bool & _verbose;
142 
145 
147  bool _reset_dt;
148 
151 
152 private:
154  Real & _current_dt;
155 };
156 
157 #endif /* TIMESTEPPER_H */
Real & _timestep_tolerance
Definition: TimeStepper.h:138
virtual ~TimeStepper()
Definition: TimeStepper.C:57
virtual Real computeInitialDT()=0
Called to compute _current_dt for the first timestep.
virtual Real computeFailedDT()
Called to compute _current_dt after a solve has failed.
Definition: TimeStepper.C:188
Transient executioners usually loop through a number of timesteps...
Definition: Transient.h:36
A class for creating restricted objects.
Definition: Restartable.h:31
void computeStep()
Called before a new step is started.
Definition: TimeStepper.C:73
virtual void preStep()
Definition: TimeStepper.h:46
Real & _time_old
Definition: TimeStepper.h:130
Base class for time stepping.
Definition: TimeStepper.h:31
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void preSolve()
Definition: TimeStepper.h:43
Transient & _executioner
Reference to transient executioner.
Definition: TimeStepper.h:126
virtual void postExecute()
Definition: TimeStepper.h:45
virtual bool constrainStep(Real &dt)
Called after computeStep() is called.
Definition: TimeStepper.C:94
Real & _current_dt
Size of the current time step as computed by the Stepper. Note that the actual dt that was taken migh...
Definition: TimeStepper.h:154
void addSyncTime(Real sync_time)
Add a sync time.
std::set< Real > & _sync_times
Definition: TimeStepper.h:136
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
FEProblemBase & _fe_problem
Definition: TimeStepper.h:124
virtual void acceptStep()
This gets called when time step is accepted.
Definition: TimeStepper.C:165
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:36
virtual Real computeDT()=0
Called to compute _current_dt for a normal step.
TimeStepper(const InputParameters &parameters)
Definition: TimeStepper.C:33
bool _has_reset_dt
True if dt has been reset.
Definition: TimeStepper.h:150
virtual void forceTimeStep(Real dt)
Definition: TimeStepper.C:201
bool _converged
Whether or not the previous solve converged.
Definition: TimeStepper.h:144
InputParameters validParams< TimeStepper >()
Definition: TimeStepper.C:22
Real & _end_time
Definition: TimeStepper.h:135
virtual void preExecute()
Definition: TimeStepper.C:65
virtual void rejectStep()
This gets called when time step is rejected.
Definition: TimeStepper.C:175
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
Real & _dt_min
Definition: TimeStepper.h:133
virtual void postSolve()
Definition: TimeStepper.h:44
virtual void step()
Take a time step.
Definition: TimeStepper.C:158
virtual bool converged()
If the time step converged.
Definition: TimeStepper.C:182
int & _t_step
Definition: TimeStepper.h:131
virtual void postStep()
Definition: TimeStepper.h:47
bool _reset_dt
If true then the next dt will be computed by computeInitialDT()
Definition: TimeStepper.h:147
Real & _dt_max
Definition: TimeStepper.h:134
virtual void init()
Initialize the time stepper.
Definition: TimeStepper.C:60
bool & _verbose
should detailed diagnostic output be printed
Definition: TimeStepper.h:141
Real & _dt
Definition: TimeStepper.h:132
Real getCurrentDT()
Get the current_dt.
Definition: TimeStepper.h:89
Real & _time
Values from executioner.
Definition: TimeStepper.h:129