16 #include "libmesh/nonlinear_solver.h" 37 _solution_intermediate_stage(addVector(
"solution_intermediate_stage", false,
GHOSTED)),
38 _tmp_solution(addVector(
"tmp_solution", false,
GHOSTED)),
39 _tmp_mass_solution_product(addVector(
"tmp_mass_solution_product", false,
GHOSTED))
52 _a = {{1.0, 0.0}, {0.5, 0.5}};
58 _a = {{1.0, 0.0, 0.0}, {0.75, 0.25, 0.0}, {1.0 / 3.0, 0.0, 2.0 / 3.0}};
59 _b = {1.0, 0.25, 2.0 / 3.0};
84 for (
unsigned int k = 0; k <=
_stage; k++)
95 ad_u_dot = std::numeric_limits<typename ADReal::value_type>::quiet_NaN();
110 bool converged =
false;
193 for (
unsigned int k = 0; k <=
_stage; k++)
virtual void computeJacobianTag(const NumericVector< libMesh::Number > &soln, libMesh::SparseMatrix< libMesh::Number > &jacobian, TagID tag)
Form a Jacobian matrix for a given tag.
virtual 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
std::vector< Real > _c
Runge-Kutta "c" coefficient vector.
unsigned int _n_stages
Number of stages.
std::unique_ptr< NonlinearSolver< Number > > nonlinear_solver
virtual void solve() override
Solves the time step and sets the number of nonlinear and linear iterations.
virtual Real & time() const
NumericVector< Real > * _solution_update
Solution vector for the linear solve.
Real _current_time
Save off current time to reset it back and forth.
std::vector< Real > _b
Runge-Kutta "b" coefficient vector.
NumericVector< Number > * _solution_intermediate_stage
Solution vector for intermediate stage.
void vector_mult(NumericVector< T > &dest, const NumericVector< T > &arg) const
FEProblemBase & _fe_problem
Reference to the problem.
virtual Real duDotDuCoeff() const override
virtual void computeTimeDerivatives() override
Computes the time derivative and the Jacobian of the time derivative.
NonlinearSystemBase * _nl
Pointer to the nonlinear system, can happen that we dont have any.
TagID _Ke_time_tag
For computing the mass matrix.
void setSolution(const NumericVector< Number > &soln)
Set the solution to a given vector.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
DualNumber< Real, DNDerivativeType, true > ADReal
Real & _dt
The current time step size.
const MooseEnum & _order
Order of time integration.
bool solveStage()
Solves a stage of the time integrator.
libMesh::NonlinearImplicitSystem * _nonlinear_implicit_system
libMesh nonlinear implicit system, if applicable; otherwise, nullptr
static InputParameters validParams()
std::vector< std::vector< Real > > _a
Runge-Kutta "a" coefficient matrix.
virtual void postResidual(NumericVector< Number > &residual) override
Callback to the NonLinearTimeIntegratorInterface called immediately after the residuals are computed ...
const Real & dt() const
Returns the time step size.
NumericVector< Real > * _explicit_residual
Residual used for the RHS.
std::unique_ptr< NumericVector< Number > > solution
unsigned int _n_linear_iterations
Total number of linear iterations over all stages of the time step.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
virtual bool performExplicitSolve(SparseMatrix< Number > &mass_matrix)
Solves a linear system using the chosen solve type.
unsigned int number() const
Gets the number of this system.
void computeResidual(libMesh::NonlinearImplicitSystem &sys, const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual)
This function is called by Libmesh to form a residual.
ExplicitSSPRungeKutta(const InputParameters ¶meters)
const NumericVector< Number > *const & _solution
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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...
std::unique_ptr< NumericVector< Number > > current_local_solution
static InputParameters validParams()
virtual Real & timeOld() const
const NumericVector< Number > & _solution_old
NumericVector< Number > * _tmp_mass_solution_product
Temporary mass-matrix/solution vector product.
unsigned int _n_nonlinear_iterations
Total number of nonlinear iterations over all stages of the time step.
unsigned int _stage
Current stage.
NumericVector< Number > * _tmp_solution
Temporary solution vector.
Explicit strong stability preserving Runge-Kutta methods.
virtual void add(const numeric_index_type i, const T value)=0
NumericVector< Number > * _Re_non_time
residual vector for non-time contributions
const DofMap & get_dof_map() const
const SparseMatrix< Number > & get_system_matrix() const
Base class for explicit time integrators that are implemented without using a nonlinear solver...
std::vector< const NumericVector< Number > * > _solution_stage
Pointer to solution vector for each stage.
registerMooseObject("MooseApp", ExplicitSSPRungeKutta)
void computeDuDotDu()
Compute _du_dot_du.
void enforce_constraints_exactly(const System &system, NumericVector< Number > *v=nullptr, bool homogeneous=false) const