www.mooseframework.org
Predictor.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 PREDICTOR_H
16 #define PREDICTOR_H
17 
18 // MOOSE includes
19 #include "MooseObject.h"
20 #include "Restartable.h"
21 
22 // Forward declarations
23 class Predictor;
24 class FEProblemBase;
26 
27 namespace libMesh
28 {
29 template <typename T>
30 class NumericVector;
31 }
32 
33 template <>
35 
39 class Predictor : public MooseObject, public Restartable
40 {
41 public:
42  Predictor(const InputParameters & parameters);
43  virtual ~Predictor();
44 
45  virtual int order() { return 0; }
46  virtual void timestepSetup();
47  virtual bool shouldApply();
48  virtual void apply(NumericVector<Number> & sln) = 0;
49 
50  virtual NumericVector<Number> & solutionPredictor() { return _solution_predictor; }
51 
52 protected:
55 
56  int & _t_step;
57  Real & _dt;
58  Real & _dt_old;
59  const NumericVector<Number> & _solution;
60  NumericVector<Number> & _solution_old;
61  NumericVector<Number> & _solution_older;
62  NumericVector<Number> & _solution_predictor;
63 
65  Real _scale;
66 
68  std::vector<Real> _skip_times;
69 
71  std::vector<Real> _skip_times_old;
72 };
73 
74 #endif /* PREDICTOR_H */
A class for creating restricted objects.
Definition: Restartable.h:31
Base class for predictors.
Definition: Predictor.h:39
NonlinearSystemBase & _nl
Definition: Predictor.h:54
std::vector< Real > _skip_times
Times for which the predictor should not be applied.
Definition: Predictor.h:68
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Real & _dt_old
Definition: Predictor.h:58
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
NumericVector< Number > & _solution_older
Definition: Predictor.h:61
Nonlinear system to be solved.
NumericVector< Number > & _solution_old
Definition: Predictor.h:60
NumericVector< Number > & _solution_predictor
Definition: Predictor.h:62
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:36
InputParameters validParams< Predictor >()
Definition: Predictor.C:24
Real & _dt
Definition: Predictor.h:57
virtual NumericVector< Number > & solutionPredictor()
Definition: Predictor.h:50
Real _scale
Amount by which to scale the predicted value. Must be in [0,1].
Definition: Predictor.h:65
FEProblemBase & _fe_problem
Definition: Predictor.h:53
std::vector< Real > _skip_times_old
Old times for which the predictor should not be applied.
Definition: Predictor.h:71
int & _t_step
Definition: Predictor.h:56
const NumericVector< Number > & _solution
Definition: Predictor.h:59
virtual int order()
Definition: Predictor.h:45