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 class FEProblemBase;
18 
19 namespace libMesh
20 {
21 template <typename T>
22 class NumericVector;
23 }
24 
28 class Predictor : public MooseObject, public Restartable
29 {
30 public:
32 
34  virtual ~Predictor();
35 
36  virtual int order() { return 0; }
37  virtual void timestepSetup();
38  virtual bool shouldApply();
39  virtual void apply(NumericVector<Number> & sln) = 0;
40 
42 
43 protected:
46 
47  int & _t_step;
48  Real & _dt;
54  int & _t_step_old;
56 
59 
61  std::vector<Real> _skip_times;
62 
64  std::vector<Real> _skip_times_old;
65 
68 
71 
72  friend class SetupPredictorAction;
73 };
A class for creating restricted objects.
Definition: Restartable.h:28
Base class for predictors.
Definition: Predictor.h:28
NonlinearSystemBase & _nl
Definition: Predictor.h:45
Sets the predictor.
std::vector< Real > _skip_times
Times for which the predictor should not be applied.
Definition: Predictor.h:61
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Real & _dt_old
Definition: Predictor.h:49
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:52
Nonlinear system to be solved.
NumericVector< Number > & _solution_old
Definition: Predictor.h:51
virtual void timestepSetup()
Definition: Predictor.C:69
NumericVector< Number > & _solution_predictor
Definition: Predictor.h:53
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:33
const Real & _timestep_tolerance
Timestep tolerance from Transient executioner.
Definition: Predictor.h:70
const bool & _skip_after_failed_timetep
Option to skip prediction after a failed timestep.
Definition: Predictor.h:67
virtual void apply(NumericVector< Number > &sln)=0
int & _t_step_old
Definition: Predictor.h:54
static InputParameters validParams()
Definition: Predictor.C:19
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real & _dt
Definition: Predictor.h:48
virtual NumericVector< Number > & solutionPredictor()
Definition: Predictor.h:41
Real _scale
Amount by which to scale the predicted value. Must be in [0,1].
Definition: Predictor.h:58
const InputParameters & parameters() const
Get the parameters of the object.
FEProblemBase & _fe_problem
Definition: Predictor.h:44
bool & _is_repeated_timestep
Definition: Predictor.h:55
virtual ~Predictor()
Definition: Predictor.C:66
std::vector< Real > _skip_times_old
Old times for which the predictor should not be applied.
Definition: Predictor.h:64
int & _t_step
Definition: Predictor.h:47
const NumericVector< Number > & _solution
Definition: Predictor.h:50
virtual int order()
Definition: Predictor.h:36
virtual bool shouldApply()
Definition: Predictor.C:82
Predictor(const InputParameters &parameters)
Definition: Predictor.C:41