KASKADE 7 development version
Loading...
Searching...
No Matches
Kaskade::SemiImplicitEulerStep< PE > Class Template Reference

Linearly implicit Euler method. More...

#include <semieuler.hh>

Inheritance diagram for Kaskade::SemiImplicitEulerStep< PE >:
Kaskade::SemiEulerDetail::SemiImplicitEulerInnerBoundaryPolicyImpl< PE, SemiImplicitEulerStep< PE >, hasInnerBoundaryCache< PE > >

Classes

class  BoundaryCache
struct  D1
struct  D2
class  DomainCache

Public Types

typedef PE ParabolicEquation
typedef ParabolicEquation::Scalar Scalar
typedef ParabolicEquation::AnsatzVars AnsatzVars
typedef ParabolicEquation::TestVars TestVars
typedef ParabolicEquation::OriginVars OriginVars
typedef AnsatzVars::Grid Grid
using GridView = typename AnsatzVars::GridView
typedef PE EvolutionEquation
typedef EvolutionEquation::AnsatzVars::template CoefficientVector< 0, EvolutionEquation::TestVars::noOfVariables > CoefficientVectors

Public Member Functions

 SemiImplicitEulerStep (ParabolicEquation *eq_, Scalar dt)
 Constructor.
template<class Cell>
int integrationOrder (Cell const &cell, int shapeFunctionOrder, bool boundary) const
Self & setTau (Scalar dt)
 Sets the time step size.
Scalar getTau () const
Access to the underlying parabolic equation.
ParabolicEquation & parabolicEquation ()
ParabolicEquation const & parabolicEquation () const

Static Public Attributes

static ProblemType const type = WeakFormulation

Detailed Description

template<class PE>
class Kaskade::SemiImplicitEulerStep< PE >

Linearly implicit Euler method.

A class that defines the weak formulation of the stationary elliptic problem that results from the linearly implicit Euler method for

\[ B \dot u = L(u) , \]

which is, doing the linearization at \( u_0 \),

\[(B - \tau L'(u_0)) \delta u_k = \tau L(u_k), \quad u_{k+1} = u_k + \delta u_k. \]

The left hand side \( B - \tau L'(u_0) \) is assembled as matrix, and the right hand side \( \tau L(u_k) \) is assembled as right hand side by the assembler, if fed with this weak problem formulation:

assembler.assemble(semiLinearization(SemiImplicitEulerStep,u,uJ,du));
SemiImplicitEulerStep(ParabolicEquation *eq_, Scalar dt)
Constructor.
Definition semieuler.hh:465
SemiLinearizationAt< Functional > semiLinearization(Functional const &f, typename Functional::AnsatzVars::VariableSet const &u, typename Functional::AnsatzVars::VariableSet const &uJ, typename Functional::AnsatzVars::VariableSet const &du)
Convenience routine for constructing semi-linearizations.

\( B \) may depend on \( u \), made explicit by setting

B2<row,col>::constant = false

in the parabolic equation class. In this case, \( B(u) \) has to be an invertable Nemyckii operator (a diagonal operator, mapping \( u(x) \) to \( B(x,u(x)) u(x) \). Then the linearly implicit Euler scheme is (see below for derivation)

\[(B(u_0) - \tau L'(u_0) + \tau_k B^{-1}(u_0)B'(u_0)\mathrm{diag}L(u_0)) \delta u_k = \tau_k L(u)+\frac{\tau_k}{\tau_{k-1}}(B(u_0)-B(u_k))\delta u_{k-1}. \]

The values \( u_0 \) (linearization point for the Jacobian), \( u_k \) (evaluation point for the right hand side), and \( \tau_k/\tau_{k-1}\, \delta u_{k-1} \) (previous increment) have to be specified when constructing the DomainCache. This is most conveniently done via SemiLinearizationAt.

Due to the evaluation at both \( u_0 \) and \( u_k \), two domain and boundary caches are instantiated and can be evaluated. Keep this in mind in case you want to have side effects in the caches (e.g., for logging or debugging purposes).

Template Parameters
PEthe weak formulation of the parabolic equation, adhering to the ParabolicEquation interface.
See also
SemiLinearizationAt

Derivation: Lubich and Roche (Rosenbrock Methods for Differential-algebraic Systems with Solution-dependent Singular Matrix Multiplying the Derivative, Computing 43:325-342, 1990) suggest to reformulate the parabolic system with non-constant \( B \) above as

\[ \begin{aligned} \dot u &= z \\ 0 &= L(u)-B(u)z \end{aligned} \]

and applying, e.g., Rosenbrock methods. Here, simply a linearly implicit Euler. Linearizing the right hand side of the extended system at \( u_0, z_0 \) yields

\[ \Bigg( \begin{bmatrix} I & 0 \\ 0 & 0 \end{bmatrix} - \tau_k \begin{bmatrix} 0 & I \\ L'(u_0)-B'(u_0)z_0 & -B(u_0) \end{bmatrix} \Bigg) \begin{bmatrix} \delta u_k \\ \delta z_k \end{bmatrix} = \tau_k \begin{bmatrix} z_k \\ L(u_k)-B(u_k)z_k \end{bmatrix}. \]

The first row immediately gives \( \delta u_k = \tau_k (z_k + \delta z_k) \), and the second one

\[ - \tau_k (L'(u_0)-B'(u_0)z_0) \delta u_k + \tau (B(u_0)\delta z_k + B(u_k)z_k) = \tau_k f(u_k). \]

The second term on the left hand side is just

\[ \tau_k (B(u_0)(z_k+\delta z_k) + (B(u_k)-B(u_0))z_k) = B(u_0)\delta u_k + (B(u_k)-B(u_0)) \tau_k z_k, \]

hence we obtain

\[ \left(B(u_0) - \tau_k(L'(u_0)-B'(u_0)z_0)\right)\delta u_k = \tau_k L(u_k)+(B(u_0)-B(u_k)) \frac{\tau_k}{\tau_{k-1}}\delta u_{k-1}. \]

Choosing a consistent initial value \( z_0 = B(u_0)^{-1} L(u_0) \) finally results in the form given above.

Definition at line 232 of file semieuler.hh.

Member Typedef Documentation

◆ AnsatzVars

template<class PE>
typedef ParabolicEquation::AnsatzVars Kaskade::SemiImplicitEulerStep< PE >::AnsatzVars

Definition at line 243 of file semieuler.hh.

◆ CoefficientVectors

template<class PE>
typedef EvolutionEquation::AnsatzVars::template CoefficientVector<0,EvolutionEquation::TestVars::noOfVariables> Kaskade::SemiImplicitEulerStep< PE >::CoefficientVectors

Definition at line 253 of file semieuler.hh.

◆ EvolutionEquation

template<class PE>
typedef PE Kaskade::SemiImplicitEulerStep< PE >::EvolutionEquation

Definition at line 251 of file semieuler.hh.

◆ Grid

template<class PE>
typedef AnsatzVars::Grid Kaskade::SemiImplicitEulerStep< PE >::Grid

Definition at line 246 of file semieuler.hh.

◆ GridView

template<class PE>
using Kaskade::SemiImplicitEulerStep< PE >::GridView = typename AnsatzVars::GridView

Definition at line 247 of file semieuler.hh.

◆ OriginVars

template<class PE>
typedef ParabolicEquation::OriginVars Kaskade::SemiImplicitEulerStep< PE >::OriginVars

Definition at line 245 of file semieuler.hh.

◆ ParabolicEquation

template<class PE>
typedef PE Kaskade::SemiImplicitEulerStep< PE >::ParabolicEquation

Definition at line 240 of file semieuler.hh.

◆ Scalar

template<class PE>
typedef ParabolicEquation::Scalar Kaskade::SemiImplicitEulerStep< PE >::Scalar

Definition at line 242 of file semieuler.hh.

◆ TestVars

template<class PE>
typedef ParabolicEquation::TestVars Kaskade::SemiImplicitEulerStep< PE >::TestVars

Definition at line 244 of file semieuler.hh.

Constructor & Destructor Documentation

◆ SemiImplicitEulerStep()

template<class PE>
Kaskade::SemiImplicitEulerStep< PE >::SemiImplicitEulerStep ( ParabolicEquation * eq_,
Scalar dt )
inline

Constructor.

Parameters
eqa pointer to a parabolic equation object. This needs to exist during the life time of the SemiImplicitEulerStep object.
dtthe time step. dt>=0 has to hold.

Definition at line 465 of file semieuler.hh.

Referenced by Kaskade::SemiImplicitEulerStep< PE >::BoundaryCache::BoundaryCache(), and Kaskade::SemiImplicitEulerStep< PE >::DomainCache::DomainCache().

Member Function Documentation

◆ getTau()

template<class PE>
Scalar Kaskade::SemiImplicitEulerStep< PE >::getTau ( ) const
inline

Definition at line 488 of file semieuler.hh.

◆ integrationOrder()

template<class PE>
template<class Cell>
int Kaskade::SemiImplicitEulerStep< PE >::integrationOrder ( Cell const & cell,
int shapeFunctionOrder,
bool boundary ) const
inline

Definition at line 471 of file semieuler.hh.

◆ parabolicEquation() [1/2]

template<class PE>
ParabolicEquation & Kaskade::SemiImplicitEulerStep< PE >::parabolicEquation ( )
inline

Definition at line 495 of file semieuler.hh.

◆ parabolicEquation() [2/2]

template<class PE>
ParabolicEquation const & Kaskade::SemiImplicitEulerStep< PE >::parabolicEquation ( ) const
inline

Definition at line 496 of file semieuler.hh.

◆ setTau()

template<class PE>
Self & Kaskade::SemiImplicitEulerStep< PE >::setTau ( Scalar dt)
inline

Sets the time step size.

Parameters
dtThe new time step size. dt>=0 has to hold.

Definition at line 481 of file semieuler.hh.

Member Data Documentation

◆ type

template<class PE>
ProblemType const Kaskade::SemiImplicitEulerStep< PE >::type = WeakFormulation
static

Definition at line 249 of file semieuler.hh.


The documentation for this class was generated from the following file: