Go to the documentation of this file.
15 #include "libmesh/numeric_vector.h"
24 "The scale factor for the predictor (can range from 0 to 1)");
26 "skip_times",
"Skip the predictor if the current solution time is in this list of times");
29 "Skip the predictor if the previous solution time is in this list of times");
39 _fe_problem(*getCheckedPointerParam<
FEProblemBase *>(
"_fe_problem_base")),
40 _nl(_fe_problem.getNonlinearSystemBase()),
42 _t_step(_fe_problem.timeStep()),
43 _dt(_fe_problem.dt()),
44 _dt_old(_fe_problem.dtOld()),
45 _solution(*_nl.currentSolution()),
46 _solution_old(_nl.solutionOld()),
47 _solution_older(_nl.solutionOlder()),
48 _solution_predictor(_nl.addVector(
"predictor", true, GHOSTED)),
49 _scale(getParam<Real>(
"scale")),
50 _skip_times(getParam<
std::vector<Real>>(
"skip_times")),
51 _skip_times_old(getParam<
std::vector<Real>>(
"skip_times_old"))
53 if (_scale < 0.0 || _scale > 1.0)
54 mooseError(
"Input value for scale = ",
_scale,
" is outside of permissible range (0 to 1)");
67 bool should_apply =
true;
71 for (
unsigned int i = 0; i <
_skip_times.size() && should_apply; ++i)
76 for (
unsigned int i = 0; i <
_skip_times_old.size() && should_apply; ++i)
static InputParameters validParams()
virtual Real & timeOld() const
void mooseError(Args &&... args) const
std::vector< Real > _skip_times_old
Old times for which the predictor should not be applied.
Real _scale
Amount by which to scale the predicted value. Must be in [0,1].
virtual Real & time() const
static InputParameters validParams()
Base class for predictors.
Every object that can be built by the factory should be derived from this class.
std::vector< Real > _skip_times
Times for which the predictor should not be applied.
A class for creating restricted objects.
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
Function to check whether two variables are equal within an absolute tolerance.
virtual bool shouldApply()
Predictor(const InputParameters ¶meters)
virtual void timestepSetup()
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
defineLegacyParams(Predictor)
FEProblemBase & _fe_problem