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 
14 class ImplicitEuler;
15 
16 template <>
18 
23 {
24 public:
26  virtual ~ImplicitEuler();
27 
28  virtual int order() override { return 1; }
29  virtual void computeTimeDerivatives() override;
30  void computeADTimeDerivatives(DualReal & ad_u_dot, const dof_id_type & dof) const override;
31  virtual void postResidual(NumericVector<Number> & residual) override;
32 
33 protected:
37  template <typename T, typename T2>
38  void computeTimeDerivativeHelper(T & u_dot, const T2 & u_old) const;
39 };
40 
41 template <typename T, typename T2>
42 void
43 ImplicitEuler::computeTimeDerivativeHelper(T & u_dot, const T2 & u_old) const
44 {
45  u_dot -= u_old;
46  u_dot *= 1. / _dt;
47 }
48 
void computeADTimeDerivatives(DualReal &ad_u_dot, const dof_id_type &dof) const override
method for computing local automatic differentiation time derivatives
Definition: ImplicitEuler.C:44
virtual void computeTimeDerivatives() override
Definition: ImplicitEuler.C:29
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
DualNumber< Real, NumberArray< AD_MAX_DOFS_PER_ELEM, Real > > DualReal
Definition: DualReal.h:29
virtual ~ImplicitEuler()
Definition: ImplicitEuler.C:26
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:43
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:65
InputParameters validParams< ImplicitEuler >()
Definition: ImplicitEuler.C:17
Base class for time integrators.
ImplicitEuler(const InputParameters &parameters)
Definition: ImplicitEuler.C:24
virtual void postResidual(NumericVector< Number > &residual) override
Callback to the TimeIntegrator called immediately after the residuals are computed in NonlinearSystem...
Definition: ImplicitEuler.C:50
virtual int order() override
Definition: ImplicitEuler.h:28
Implicit Euler&#39;s method.
Definition: ImplicitEuler.h:22