33 mooseError(
"CrankNicolson: Time derivative of solution (`u_dot`) is not stored. Please set " 34 "uDotRequested() to true in FEProblemBase befor requesting `u_dot`.");
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;
NumericVector< Number > * _residual_old
virtual void postResidual(NumericVector< Number > &residual) override
Callback to the NonLinearTimeIntegratorInterface called immediately after the residuals are computed ...
void clearCurrentResidualVectorTags()
Clear the current residual vector tag data structure.
void computeTimeDerivativeHelper(T &u_dot, const T2 &u_old) const
Helper function that actually does the math for computing the time derivative.
bool & _var_restriction
Whether the user has requested that the time integrator be applied to a subset of variables...
FEProblemBase & _fe_problem
Reference to the problem.
virtual void init() override
Called only before the very first timestep (t_step = 0) Never called again (not even during recover/r...
virtual Real duDotDuCoeff() const override
TagID nonTimeVectorTag() const override
NonlinearSystemBase * _nl
Pointer to the nonlinear system, can happen that we dont have any.
SystemBase & _sys
Reference to the system this time integrator operates on.
const Parallel::Communicator & comm() const
virtual void postStep() override
Callback to the TimeIntegrator called at the very end of time step.
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.
NumericVector< Number > * _Re_time
residual vector for time contributions
virtual void init()
Called only before the very first timestep (t_step = 0) Never called again (not even during recover/r...
virtual void create_subvector(NumericVector< Number > &, const std::vector< numeric_index_type > &, bool=true) const
void min(const T &r, T &o, Request &req) const
virtual NumericVector< Number > * solutionUDot()
std::vector< dof_id_type > & _local_indices
The local degree of freedom indices this time integrator is being applied to.
registerMooseObject("MooseApp", CrankNicolson)
virtual std::unique_ptr< NumericVector< Number > > get_subvector(const std::vector< numeric_index_type > &)
std::unique_ptr< NumericVector< Number > > & _solution_old_sub
std::vector< Real > & _du_dot_du
Derivative of time derivative with respect to current solution: for the different variables...
CrankNicolson(const InputParameters ¶meters)
virtual bool closed() const
virtual NumericVector< Number > & RHS()=0
const NumericVector< Number > *const & _solution
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Base class for time integrators.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
void setCurrentResidualVectorTags(const std::set< TagID > &vector_tags)
Set the current residual vector tag data structure based on the passed in tag IDs.
const NumericVector< Number > & _solution_old
bool integratesVar(const unsigned int var_num) const
void computeResidualTag(NumericVector< Number > &residual, TagID tag_id)
Computes residual for a given tag.
static InputParameters validParams()
NumericVector< Number > * _Re_non_time
residual vector for non-time contributions
virtual void computeTimeDerivatives() override
Computes the time derivative and the Jacobian of the time derivative.
static InputParameters validParams()
Crank-Nicolson time integrator.
auto index_range(const T &sizable)
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::unique_ptr< NumericVector< Number > > & _solution_sub
void computeDuDotDu()
Compute _du_dot_du.
void copyVector(const NumericVector< Number > &from, NumericVector< Number > &to)
Copy from one vector into another.
virtual void restore_subvector(std::unique_ptr< NumericVector< Number >>, const std::vector< numeric_index_type > &)