www.mooseframework.org
ImplicitEuler.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "ImplicitEuler.h"
11 #include "NonlinearSystem.h"
12 
14 
17 {
19  params.addClassDescription("Time integration using the implicit Euler method.");
20  return params;
21 }
22 
23 ImplicitEuler::ImplicitEuler(const InputParameters & parameters) : TimeIntegrator(parameters) {}
24 
26 
27 void
29 {
30  if (!_sys.solutionUDot())
31  mooseError("ImplicitEuler: Time derivative of solution (`u_dot`) is not stored. Please set "
32  "uDotRequested() to true in FEProblemBase befor requesting `u_dot`.");
33 
35  u_dot = *_solution;
37  u_dot.close();
38 
39  _du_dot_du = 1.0 / _dt;
40 }
41 
42 void
44  const dof_id_type & dof,
45  DualReal & /*ad_u_dotdot*/) const
46 {
48 }
49 
50 void
52 {
53  residual += _Re_time;
54  residual += _Re_non_time;
55  residual.close();
56 }
virtual NumericVector< Number > * solutionUDot()=0
virtual void computeTimeDerivatives() override
Computes the time derivative and the Jacobian of the time derivative.
Definition: ImplicitEuler.C:28
DualNumber< Real, DNDerivativeType, true > DualReal
Definition: DualReal.h:49
void computeADTimeDerivatives(DualReal &ad_u_dot, const dof_id_type &dof, DualReal &ad_u_dotdot) const override
method for computing local automatic differentiation time derivatives
Definition: ImplicitEuler.C:43
NumericVector< Number > & _Re_non_time
residual vector for non-time contributions
SystemBase & _sys
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
registerMooseObject("MooseApp", ImplicitEuler)
virtual ~ImplicitEuler()
Definition: ImplicitEuler.C:25
void computeTimeDerivativeHelper(T &u_dot, const T2 &u_old) const
Helper function that actually does the math for computing the time derivative.
Definition: ImplicitEuler.h:42
static InputParameters validParams()
Definition: ImplicitEuler.C:16
virtual void close()=0
Real & _du_dot_du
Derivative of time derivative with respect to current solution: .
const NumericVector< Number > *const & _solution
solution vectors
Base class for time integrators.
ImplicitEuler(const InputParameters &parameters)
Definition: ImplicitEuler.C:23
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
NumericVector< Number > & _Re_time
residual vector for time contributions
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
const NumericVector< Number > & _solution_old
virtual void postResidual(NumericVector< Number > &residual) override
Callback to the TimeIntegrator called immediately after the residuals are computed in NonlinearSystem...
Definition: ImplicitEuler.C:51
static InputParameters validParams()
Implicit Euler&#39;s method.
Definition: ImplicitEuler.h:17
uint8_t dof_id_type