www.mooseframework.org
AB2PredictorCorrector.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 AB2PREDICTORCORRECTOR_H
16 #define AB2PREDICTORCORRECTOR_H
17 
18 // MOOSE includes
19 #include "TimeStepper.h"
20 
21 // C++ includes
22 #include <fstream>
23 
24 // Forward Declarations
26 
27 namespace libMesh
28 {
29 template <typename T>
30 class NumericVector;
31 }
32 
33 template <>
35 
42 {
43 public:
44  AB2PredictorCorrector(const InputParameters & parameters);
45 
46  virtual void step() override;
47  virtual void preExecute() override;
48  virtual void preSolve() override;
49  virtual bool converged() override;
50 
51 protected:
52  virtual Real computeDT() override;
53  virtual Real computeInitialDT() override;
54 
55  virtual Real estimateTimeError(NumericVector<Number> & sol);
56 
57  NumericVector<Number> & _u1;
58  NumericVector<Number> & _aux1;
59  NumericVector<Number> & _pred1;
60 
62  Real & _dt_full;
63 
65  Real & _error;
67  Real _e_tol;
69  Real _e_max;
77  Real & _my_dt_old;
79  Real & _infnorm;
82  std::ofstream myfile;
83 };
84 
85 #endif // AB2PREDICTORCORRECTOR_H
InputParameters validParams< AB2PredictorCorrector >()
Real & _error
global relative time discretization error estimate
int _steps_between_increase
steps to take before increasing dt
Real _e_tol
error tolerance
NumericVector< Number > & _aux1
Base class for time stepping.
Definition: TimeStepper.h:31
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
NumericVector< Number > & _pred1
Real & _dt_full
dt of the big step
Real _e_max
maximal error
Real _max_increase
maximum increase ratio
Real _scaling_parameter
scaling_parameter for time step selection, default is 0.8
NumericVector< Number > & _u1
Real & _infnorm
infinity norm of the solution vector
int & _dt_steps_taken
steps taken at current dt
A TimeStepper based on the AB2 method.