https://mooseframework.inl.gov
ExplicitEuler.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 
24  virtual void preSolve() override;
25  virtual int order() override { return 1; }
26  virtual void computeTimeDerivatives() override;
27  void computeADTimeDerivatives(ADReal & ad_u_dot,
28  const dof_id_type & dof,
29  ADReal & ad_u_dotdot) const override;
30  virtual void postResidual(NumericVector<Number> & residual) override;
31  virtual bool overridesSolve() const override { return false; }
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 ExplicitEuler::computeTimeDerivativeHelper(T & u_dot, const T2 & u_old) const
44 {
45  u_dot -= u_old;
46  u_dot *= 1. / _dt;
47 }
static InputParameters validParams()
Definition: ExplicitEuler.C:17
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
Definition: ExplicitEuler.C:50
ExplicitEuler(const InputParameters &parameters)
Definition: ExplicitEuler.C:24
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual bool overridesSolve() const override
Definition: ExplicitEuler.h:31
virtual void computeTimeDerivatives() override
Computes the time derivative and the Jacobian of the time derivative.
Definition: ExplicitEuler.C:36
DualNumber< Real, DNDerivativeType, true > ADReal
Definition: ADRealForward.h:47
virtual void postResidual(NumericVector< Number > &residual) override
Callback to the NonLinearTimeIntegratorInterface called immediately after the residuals are computed ...
Definition: ExplicitEuler.C:58
Real & _dt
The current time step size.
virtual int order() override
Definition: ExplicitEuler.h:25
void computeTimeDerivativeHelper(T &u_dot, const T2 &u_old) const
Helper function that actually does the math for computing the time derivative.
Definition: ExplicitEuler.h:43
Explicit Euler time integrator.
Definition: ExplicitEuler.h:17
Base class for time integrators.
const InputParameters & parameters() const
Get the parameters of the object.
virtual void preSolve() override
Definition: ExplicitEuler.C:27
uint8_t dof_id_type