33 mooseError(
"CrankNicolson: Time derivative of solution (`u_dot`) is not stored. Please set "
34 "uDotRequested() to true in FEProblemBase befor requesting `u_dot`.");
61 const dof_id_type & dof,
73 mooseError(
"CrankNicolson: Time derivative of solution (`u_dot`) is not stored. Please set "
74 "uDotRequested() to true in FEProblemBase befor requesting `u_dot`.");
103 std::vector<unsigned char> inputs_closed = {
111 if (!inputs_closed[0])
113 if (!inputs_closed[1])
115 if (!inputs_closed[2])
130 *residual_sub += *re_time_sub;
131 *residual_sub += *re_non_time_sub;
132 *residual_sub += *residual_old_sub;
133 residual.restore_subvector(std::move(residual_sub),
_local_indices);
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("MooseApp", CrankNicolson)
Crank-Nicolson time integrator.
virtual void computeTimeDerivatives() override
Computes the time derivative and the Jacobian of the time derivative.
virtual Real duDotDuCoeff() const override
CrankNicolson(const InputParameters ¶meters)
virtual void postStep() override
Callback to the TimeIntegrator called at the very end of time step.
virtual void init() override
Called only before the very first timestep (t_step = 0) Never called again (not even during recover/r...
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 computeTimeDerivativeHelper(T &u_dot, const T2 &u_old) const
Helper function that actually does the math for computing the time derivative.
NumericVector< Number > * _residual_old
virtual void postResidual(NumericVector< Number > &residual) override
Callback to the NonLinearTimeIntegratorInterface called immediately after the residuals are computed ...
static InputParameters validParams()
void clearCurrentResidualVectorTags()
Clear the current residual vector tag data structure.
void setCurrentResidualVectorTags(const std::set< TagID > &vector_tags)
Set the current residual vector tag data structure based on the passed in tag IDs.
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 computeResidualTag(NumericVector< Number > &residual, TagID tag_id)
Computes residual for a given tag.
virtual NumericVector< Number > & RHS()=0
TagID nonTimeVectorTag() const override
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 NumericVector< Number > * solutionUDot()
void min(const T &r, T &o, Request &req) const
Base class for time integrators.
std::vector< dof_id_type > & _local_indices
The local degree of freedom indices this time integrator is being applied to.
bool & _var_restriction
Whether the user has requested that the time integrator be applied to a subset of variables.
std::unique_ptr< NumericVector< Number > > & _solution_old_sub
void computeDuDotDu()
Compute _du_dot_du.
void copyVector(const NumericVector< Number > &from, NumericVector< Number > &to)
Copy from one vector into another.
const NumericVector< Number > *const & _solution
bool integratesVar(const unsigned int var_num) const
static InputParameters validParams()
FEProblemBase & _fe_problem
Reference to the problem.
virtual void init()
Called only before the very first timestep (t_step = 0) Never called again (not even during recover/r...
SystemBase & _sys
Reference to the system this time integrator operates on.
Real & _dt
The current time step size.
std::vector< Real > & _du_dot_du
Derivative of time derivative with respect to current solution: for the different variables.
std::unique_ptr< NumericVector< Number > > & _solution_sub
const NumericVector< Number > & _solution_old
virtual std::unique_ptr< NumericVector< T > > get_subvector(const std::vector< numeric_index_type > &)
virtual void create_subvector(NumericVector< T > &, const std::vector< numeric_index_type > &, bool=true) const
virtual bool closed() const
virtual void restore_subvector(std::unique_ptr< NumericVector< T > >, const std::vector< numeric_index_type > &)
const Parallel::Communicator & comm() const
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...