16 #include "libmesh/nonlinear_solver.h" 28 "Implementation of Explicit/Forward Euler without invoking any of the nonlinear solver");
30 params.
addParam<
bool>(
"use_constant_mass",
32 "If set to true, will only compute the mass matrix in the first time step, " 33 "and keep using it throughout the simulation.");
47 mooseError(
"ActuallyExplicitEuler: Time derivative of solution (`u_dot`) is not stored. Please " 48 "set uDotRequested() to true in FEProblemBase before requesting `u_dot`.");
virtual void computeJacobianTag(const NumericVector< libMesh::Number > &soln, libMesh::SparseMatrix< libMesh::Number > &jacobian, TagID tag)
Form a Jacobian matrix for a given tag.
std::unique_ptr< NonlinearSolver< Number > > nonlinear_solver
void overwriteNodeFace(NumericVector< Number > &soln)
Called from explicit time stepping to overwrite boundary positions (explicit dynamics).
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.
virtual void postResidual(NumericVector< Number > &residual) override
Callback to the NonLinearTimeIntegratorInterface called immediately after the residuals are computed ...
FEProblemBase & _fe_problem
Reference to the problem.
NonlinearSystemBase * _nl
Pointer to the nonlinear system, can happen that we dont have any.
TagID _Ke_time_tag
For computing the mass matrix.
SystemBase & _sys
Reference to the system this time integrator operates on.
static InputParameters validParams()
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
NumericVector< Number > * _Re_time
residual vector for time contributions
libMesh::NonlinearImplicitSystem * _nonlinear_implicit_system
libMesh nonlinear implicit system, if applicable; otherwise, nullptr
static InputParameters validParams()
NumericVector< Real > * _explicit_residual
Residual used for the RHS.
virtual NumericVector< Number > * solutionUDot()
std::unique_ptr< NumericVector< Number > > solution
unsigned int _n_linear_iterations
Total number of linear iterations over all stages of the time step.
registerMooseObject("MooseApp", ActuallyExplicitEuler)
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.
const bool & _constant_mass
void computeResidual(libMesh::NonlinearImplicitSystem &sys, const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual)
This function is called by Libmesh to form a residual.
const NumericVector< Number > *const & _solution
virtual void solve() override
Solves the time step and sets the number of nonlinear and linear iterations.
ActuallyExplicitEuler(const InputParameters ¶meters)
void computeTimeDerivativeHelper(T &u_dot, const T2 &u_old) const
Helper function that actually does the math for computing the time derivative.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
std::unique_ptr< NumericVector< Number > > current_local_solution
Implements a truly explicit (no nonlinear solve) first-order, forward Euler time integration scheme...
virtual Real & timeOld() const
const NumericVector< Number > & _solution_old
unsigned int _n_nonlinear_iterations
Total number of nonlinear iterations over all stages of the time step.
NumericVector< Number > * _Re_non_time
residual vector for non-time contributions
NumericVector< Number > & solutionOld()
int & _t_step
The current time step number.
virtual void computeTimeDerivatives() override
Computes the time derivative and the Jacobian of the time derivative.
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...
void computeDuDotDu()
Compute _du_dot_du.
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
void enforce_constraints_exactly(const System &system, NumericVector< Number > *v=nullptr, bool homogeneous=false) const