www.mooseframework.org
ImplicitEuler.h
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 #pragma once
11 
12 #include "TimeIntegrator.h"
13 
18 {
19 public:
21 
23  virtual ~ImplicitEuler();
24 
25  virtual int order() override { return 1; }
26  virtual void computeTimeDerivatives() override;
27  void computeADTimeDerivatives(DualReal & ad_u_dot,
28  const dof_id_type & dof,
29  DualReal & ad_u_dotdot) const override;
30  virtual void postResidual(NumericVector<Number> & residual) override;
31 
32 protected:
36  template <typename T, typename T2>
37  void computeTimeDerivativeHelper(T & u_dot, const T2 & u_old) const;
38 };
39 
40 template <typename T, typename T2>
41 void
42 ImplicitEuler::computeTimeDerivativeHelper(T & u_dot, const T2 & u_old) const
43 {
44  u_dot -= u_old;
45  u_dot *= 1. / _dt;
46 }
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
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
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
Base class for time integrators.
ImplicitEuler(const InputParameters &parameters)
Definition: ImplicitEuler.C:23
const InputParameters & parameters() const
Get the parameters of the object.
virtual void postResidual(NumericVector< Number > &residual) override
Callback to the TimeIntegrator called immediately after the residuals are computed in NonlinearSystem...
Definition: ImplicitEuler.C:51
virtual int order() override
Definition: ImplicitEuler.h:25
Implicit Euler&#39;s method.
Definition: ImplicitEuler.h:17
uint8_t dof_id_type