www.mooseframework.org
Predictor.h
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 #pragma once
11 
12 // MOOSE includes
13 #include "MooseObject.h"
14 #include "Restartable.h"
15 
16 // Forward declarations
17 class Predictor;
18 class FEProblemBase;
20 
21 namespace libMesh
22 {
23 template <typename T>
24 class NumericVector;
25 }
26 
27 template <>
29 
33 class Predictor : public MooseObject, public Restartable
34 {
35 public:
37  virtual ~Predictor();
38 
39  virtual int order() { return 0; }
40  virtual void timestepSetup();
41  virtual bool shouldApply();
42  virtual void apply(NumericVector<Number> & sln) = 0;
43 
44  virtual NumericVector<Number> & solutionPredictor() { return _solution_predictor; }
45 
46 protected:
49 
50  int & _t_step;
51  Real & _dt;
52  Real & _dt_old;
53  const NumericVector<Number> & _solution;
54  NumericVector<Number> & _solution_old;
55  NumericVector<Number> & _solution_older;
56  NumericVector<Number> & _solution_predictor;
57 
59  Real _scale;
60 
62  std::vector<Real> _skip_times;
63 
65  std::vector<Real> _skip_times_old;
66 };
67 
A class for creating restricted objects.
Definition: Restartable.h:29
Base class for predictors.
Definition: Predictor.h:33
NonlinearSystemBase & _nl
Definition: Predictor.h:48
std::vector< Real > _skip_times
Times for which the predictor should not be applied.
Definition: Predictor.h:62
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Real & _dt_old
Definition: Predictor.h:52
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:55
Nonlinear system to be solved.
NumericVector< Number > & _solution_old
Definition: Predictor.h:54
virtual void timestepSetup()
Definition: Predictor.C:59
NumericVector< Number > & _solution_predictor
Definition: Predictor.h:56
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:42
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:65
virtual void apply(NumericVector< Number > &sln)=0
InputParameters validParams< Predictor >()
Definition: Predictor.C:19
Real & _dt
Definition: Predictor.h:51
virtual NumericVector< Number > & solutionPredictor()
Definition: Predictor.h:44
Real _scale
Amount by which to scale the predicted value. Must be in [0,1].
Definition: Predictor.h:59
FEProblemBase & _fe_problem
Definition: Predictor.h:47
virtual ~Predictor()
Definition: Predictor.C:56
std::vector< Real > _skip_times_old
Old times for which the predictor should not be applied.
Definition: Predictor.h:65
int & _t_step
Definition: Predictor.h:50
const NumericVector< Number > & _solution
Definition: Predictor.h:53
virtual int order()
Definition: Predictor.h:39
virtual bool shouldApply()
Definition: Predictor.C:64
Predictor(const InputParameters &parameters)
Definition: Predictor.C:35