28 _residual_old(addVector(
"residual_old", false,
GHOSTED)),
29 _solution_older(_sys.solutionState(2))
31 mooseInfo(
"ExplicitRK2-derived TimeIntegrators (ExplicitMidpoint, Heun, Ralston) and other "
32 "multistage TimeIntegrators are known not to work with "
33 "Materials/AuxKernels that accumulate 'state' and should be used with caution.");
52 mooseError(
"ExplicitRK2: Time derivative of solution (`u_dot`) is not stored. Please set "
53 "uDotRequested() to true in FEProblemBase befor requesting `u_dot`.");
74 Real time_stage2 = time_old +
a() *
_dt;
85 _console <<
"1st solve" << std::endl;
104 _console <<
"2nd solve" << std::endl;
116 " has undefined behavior if it attempts to re-do a timestep after the first stage.");
171 mooseError(
"ExplicitRK2::postResidual(): _stage = ",
_stage,
", only _stage = 1-3 is allowed.");
DualNumber< Real, DNDerivativeType, true > ADReal
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
const NumericVector< Number > & _solution_older
The older solution.
virtual Real a() const =0
The method coefficients.
static InputParameters validParams()
ExplicitRK2(const InputParameters ¶meters)
virtual void solve() override
Solves the time step and sets the number of nonlinear and linear iterations.
virtual Real b1() const =0
virtual void preSolve() override
virtual void postResidual(NumericVector< Number > &residual) override
Callback to the NonLinearTimeIntegratorInterface called immediately after the residuals are computed ...
NumericVector< Number > * _residual_old
Buffer to store non-time residual from the first stage.
void computeTimeDerivativeHelper(T &u_dot, const T2 &u_old, const T3 &u_older) const
Helper function that actually does the math for computing the time derivative.
void computeADTimeDerivatives(ADReal &ad_u_dot, const dof_id_type &dof, ADReal &ad_u_dotdot) const override
method for computing local automatic differentiation time derivatives
virtual Real b2() const =0
virtual void computeTimeDerivatives() override
Computes the time derivative and the Jacobian of the time derivative.
virtual void advanceState()
Advance all of the state holding vectors / datastructures so that we can move to the next timestep.
void setConstJacobian(bool state)
Set flag that Jacobian is constant (for optimization purposes)
virtual Real & timeOld() const
virtual Real & time() const
virtual void initPetscOutputAndSomeSolverSettings()
Reinitialize PETSc output for proper linear/nonlinear iteration display.
const std::string & type() const
Get the type of this class.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
void mooseInfo(Args &&... args) const
virtual libMesh::System & system() override
Get the reference to the libMesh system.
NonlinearSystemBase * _nl
Pointer to the nonlinear system, can happen that we dont have any.
NumericVector< Number > * _Re_non_time
residual vector for non-time contributions
NumericVector< Number > * _Re_time
residual vector for time contributions
virtual bool converged(const unsigned int sys_num)
Eventually we want to convert this virtual over to taking a solver system number argument.
virtual NumericVector< Number > * solutionUDot()
unsigned int number() const
Gets the number of this system.
Base class for time integrators.
void computeDuDotDu()
Compute _du_dot_du.
unsigned int getNumLinearIterationsLastSolve() const
Gets the number of linear iterations in the most recent solve.
Real & _dt_old
The previous time step size.
const NumericVector< Number > *const & _solution
unsigned int _n_linear_iterations
Total number of linear iterations over all stages of the time step.
unsigned int _n_nonlinear_iterations
Total number of nonlinear iterations over all stages of the time step.
static InputParameters validParams()
FEProblemBase & _fe_problem
Reference to the problem.
unsigned int getNumNonlinearIterationsLastSolve() const
Gets the number of nonlinear iterations in the most recent solve.
SystemBase & _sys
Reference to the system this time integrator operates on.
Real & _dt
The current time step size.
const NumericVector< Number > & _solution_old
virtual void add(const numeric_index_type i, const T value)=0
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real