20 #include "libmesh/nonlinear_solver.h" 21 #include "libmesh/numeric_vector.h" 35 "Implements second order Adams-Bashforth method for timestep calculation.");
39 params.
addParam<
Real>(
"max_increase", 1.0e9,
"Maximum ratio that the time step can increase.");
41 "steps_between_increase", 1,
"the number of time steps before recalculating dt");
42 params.
addParam<
int>(
"start_adapting", 2,
"when to start taking adaptive time steps");
43 params.
addParam<
Real>(
"scaling_parameter", .8,
"scaling parameter for dt selection");
49 _u1(_fe_problem.getNonlinearSystemBase(0).addVector(
"u1", true,
GHOSTED)),
50 _aux1(_fe_problem.getAuxiliarySystem().addVector(
"aux1", true,
GHOSTED)),
51 _pred1(_fe_problem.getNonlinearSystemBase(0).addVector(
"pred1", true,
GHOSTED)),
52 _dt_full(declareRestartableData<
Real>(
"dt_full", 0)),
53 _error(declareRestartableData<
Real>(
"error", 0)),
54 _e_tol(getParam<
Real>(
"e_tol")),
55 _e_max(getParam<
Real>(
"e_max")),
56 _max_increase(getParam<
Real>(
"max_increase")),
57 _steps_between_increase(getParam<
int>(
"steps_between_increase")),
58 _dt_steps_taken(declareRestartableData<
int>(
"dt_steps_taken", 0)),
59 _start_adapting(getParam<
int>(
"start_adapting")),
60 _my_dt_old(declareRestartableData<
Real>(
"my_dt_old", 0)),
61 _infnorm(declareRestartableData<
Real>(
"infnorm", 0)),
62 _scaling_parameter(getParam<
Real>(
"scaling_parameter"))
66 params.
set<
Real>(
"scale") = predscale;
162 return getParam<Real>(
"dt");
170 auto scheme = Moose::stringToEnum<Moose::TimeIntegratorType>(ti->
type());
195 Real topcalc = 2.0 * (
_dt + dt_old) * (
_dt + dt_old);
196 Real bottomcalc = 6.0 *
_dt *
_dt + 12.0 *
_dt * dt_old + 5.0 * dt_old * dt_old;
197 _pred1 *= topcalc / bottomcalc;
static InputParameters validParams()
AB2PredictorCorrector(const InputParameters ¶meters)
Real & _error
global relative time discretization error estimate
virtual Real computeInitialDT() override
Called to compute _current_dt for the first timestep.
int _steps_between_increase
steps to take before increasing dt
virtual bool converged(const unsigned int nl_sys_num)
Eventually we want to convert this virtual over to taking a nonlinear system number argument...
Predictor * getPredictor()
Real _e_tol
error tolerance
NumericVector< Number > & _aux1
TimeIntegrator * getTimeIntegrator()
InputParameters getValidParams(const std::string &name) const
Get valid parameters for the object.
Base class for time stepping.
const NumericVector< Number > *const & currentSolution() const override
The solution vector that is currently being operated on.
NumericVector< Number > & _pred1
virtual void preSolve() override
Real & _dt_full
dt of the big step
virtual void solve(const unsigned int nl_sys_num)
Factory & getFactory()
Retrieve a writable reference to the Factory associated with this App.
virtual void step() override
Take a time step.
Nonlinear system to be solved.
FEProblemBase & _fe_problem
virtual void addPredictor(const std::string &type, const std::string &name, InputParameters ¶meters)
virtual void postSolve() override
virtual Real l2_norm() const =0
virtual const NumericVector< Number > *const & currentSolution() const override final
The solution vector that is currently being operated on.
virtual Real estimateTimeError(NumericVector< Number > &sol)
const std::string & type() const
Get the type of this class.
NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num)
Real _max_increase
maximum increase ratio
MooseApp & _app
The MOOSE application this is associated with.
Real _scaling_parameter
scaling_parameter for time step selection, default is 0.8
AuxiliarySystem & getAuxiliarySystem()
registerMooseObject("MooseApp", AB2PredictorCorrector)
bool _converged
Whether or not the previous solve converged.
NumericVector< Number > & _u1
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Base class for time integrators.
virtual bool converged() const override
If the time step converged.
virtual NumericVector< Number > & solutionPredictor()
virtual void preExecute()
Real & _infnorm
infinity norm of the solution vector
virtual Real computeDT() override
Called to compute _current_dt for a normal step.
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
virtual void preExecute() override
int & _dt_steps_taken
steps taken at current dt
A TimeStepper based on the AB2 method.
MooseUnits pow(const MooseUnits &, int)
A system that holds auxiliary variables.
virtual Real linfty_norm() const =0
void ErrorVector unsigned int
static InputParameters validParams()