LifeV
TimeAdvanceBDF< feVectorType > Class Template Reference

class TimeAdvanceBDF - Backward differencing formula time discretization for the first and the second order problem in time. More...

#include <TimeAdvanceBDF.hpp>

+ Inheritance diagram for TimeAdvanceBDF< feVectorType >:
+ Collaboration diagram for TimeAdvanceBDF< feVectorType >:

Public Types

typedef TimeAdvance< feVectorType > super
 class super More...
 
typedef super::feVector_Type feVector_Type
 type of template More...
 
typedef super::feVectorContainer_Type feVectorContainer_Type
 container of feVector More...
 
typedef super::feVectorContainerPtr_Type feVectorContainerPtr_Type
 container of pointer of feVector; More...
 
typedef feVectorContainerPtr_Type::iterator feVectorContainerPtrIterate_Type
 iterator; More...
 
typedef super::feVectorSharedPtrContainer_Type feVectorSharedPtrContainer_Type
 container of pointer of feVector; More...
 

Constructor & Destructor

 TimeAdvanceBDF ()
 Empty Constructor. More...
 
virtual ~TimeAdvanceBDF ()
 Destructor. More...
 

Methods

void shiftRight (const feVector_Type &solution)
 Update the state vector. More...
 
void RHSFirstDerivative (const Real &timeStep, feVectorType &rhsContribution) const
 Update the right hand side $ f_V $ of the time derivative formula. More...
 
void updateRHSSecondDerivative (const Real &timeStep=1)
 Update the right hand side $ f_W $ of the time derivative formula. More...
 
void showMe (std::ostream &output=std::cout) const
 Show the properties of temporal scheme. More...
 

Set Methods

void setup (const UInt &order, const UInt &orderDerivative=1)
 Initialize the parameters of time advance scheme. More...
 
void setup (const std::vector< Real > &, const UInt &)
 Initialize the parameters of time advance scheme used in TimeAdvanceNewmark. More...
 
void setInitialCondition (const feVector_Type &x0)
 Initialize the StateVector. More...
 
void setInitialCondition (const feVector_Type &, const feVector_Type &)
 Initialize the StateVector used in TimeAdvanceNewmark. More...
 
void setInitialCondition (const feVector_Type &, const feVector_Type &, const feVector_Type &)
 Initialize the StateVector used in TimeAdvanceNewmark. More...
 
void setInitialCondition (const feVectorSharedPtrContainer_Type &x0)
 Initialize all the entries of the unknown vector to be derived with a. More...
 

Get Methods

Real coefficientExtrapolation (const UInt &i) const
 Return the $i$-th coefficient of the unk's extrapolation. More...
 
Real coefficientExtrapolationFirstDerivative (const UInt &i) const
 Return the $i$-th coefficient of the velocity's extrapolation. More...
 
void extrapolation (feVector_Type &extrapolation) const
 Compute the polynomial extrapolation of solution. More...
 
void extrapolationFirstDerivative (feVector_Type &extrapolation) const
 Compute the polynomial extrapolation of velocity. More...
 
feVectorType firstDerivative () const
 Return the current velocity. More...
 
feVectorType secondDerivative () const
 Return the current acceleration. More...
 

Additional Inherited Members

- Public Types inherited from TimeAdvance< feVectorType >
typedef feVectorType feVector_Type
 
typedef ScalarVector container_Type
 
typedef std::vector< feVector_TypefeVectorContainer_Type
 
typedef std::vector< feVector_Type * > feVectorContainerPtr_Type
 
typedef feVectorContainerPtr_Type::iterator feVectorContainerPtrIterate_Type
 
typedef std::vector< std::shared_ptr< feVector_Type > > feVectorSharedPtrContainer_Type
 
- Public Member Functions inherited from TimeAdvance< feVectorType >
 TimeAdvance ()
 Empty Constructor. More...
 
virtual ~TimeAdvance ()
 Destructor. More...
 

Detailed Description

template<typename feVectorType = VectorEpetra>
class LifeV::TimeAdvanceBDF< feVectorType >

class TimeAdvanceBDF - Backward differencing formula time discretization for the first and the second order problem in time.

Author
Simone Deparis simon.nosp@m.e.de.nosp@m.paris.nosp@m.@epf.nosp@m.l.ch
Matteo Pozzoli matte.nosp@m.o1.p.nosp@m.ozzol.nosp@m.i@ma.nosp@m.il.po.nosp@m.limi.nosp@m..it
  1. First order problem

    A differential equation of the form

    \[ M \dot{u} + A u = f \]

    is discretizated in time as

    \[ M V_{k+1} + A U_{k+1} = f_{k+1} \]

    where V denotes the polynomial of order n in t that interpolates $(t_i,u_i)$ for $i = k-n+1,...,k+1$.

    The approximative time derivative $ V $ is a linear combination of state vectors $u_i$:

    \[ V_{k+1} = \frac{1}{\Delta t} (\alpha_0 U_{k+1} - \sum_{i=0}^n \alpha_i U_{k+1-i} )\]

    Thus we have

    \[ \frac{\alpha_0}{\Delta t} M U_{k+1} = A U_{k+1} + f + M f_V \]

    with

    \[ f_V= \frac{1}{\Delta t} \sum_{i=1}^n \alpha_i U_{k+1-i} \]

    This class stores the n last state vectors in order to be able to calculate $ f_V $. It also provides $\alpha_i$ and can extrapolate the the new state from the $n$ last states with a polynomial of order $n-1$:

    \[ U_{k+1} \approx \sum_{i=0}^{n-1} \beta_i U_{k-i} \]

  2. Second order problem

    A differential equation of the form

    \[ M \ddot{u}= D( u, \dot{u}) + A(u) + f \]

    is discretized in time as

    \[ M W_{k+1} = A(U^*) U_{k+1} +D(U^*, V^*) V_{k+1} + f_{k+1} \]

    where $W$ and $V$ denotes the polynomial of order $n+1$ and order $ n$, while $U^*$ and $V^*$ are suitable extrapolations.

    The velocity vector, as for first order problem, is:

    \[ V_{k+1} = \frac{1}{\Delta t} (\alpha_0 U_{k+1} - \sum_{i=0}^n \alpha_i U_{k+1-i} )\]

    while the acceleration vector $W^{n+1}$ is:

    \[ W_{k+1} = \frac{1}{\Delta t^2} (\xi_0 U_{k+1} - \sum_{i=0}^{n+1} \xi_i U_{k+1-i} )\]

    Thus we have

    \[ \frac{\xi_0}{\Delta t^2} M U_{k+1} + \frac{\alpha_0}{\Delta t } D U_{k+1} + A U_{k+1} + f + M f_W + D f_V \]

    with

    \[ f_V= \frac{1}{\Delta t} \sum_{i=1}^n \alpha_i U_{k+1-i} \]

    and

    \[ f_W =\frac{1}{\Delta t^2} \sum_{i=1}^{n+1} \xi_i U_{ k+1 - i} \]

    It also provides $\alpha_i$ and can extrapolate the the new state from the $n$ last states with a polynomial of order $n-1$:

    \[ U_{k+1} \approx U^*= \sum_{i=0}^{n-1} \beta_i U_{k-i} \]

    and $V^*$ in following way:

    \[ V_{k+1} \approx V^*=\sum_{i=0}^p \frac{\beta_i^V}{\Delta t} U^{n-i} = W^{n+1}+O(\Delta t^p), \]

Definition at line 140 of file TimeAdvanceBDF.hpp.

Member Typedef Documentation

◆ super

typedef TimeAdvance< feVectorType > super

class super

Definition at line 149 of file TimeAdvanceBDF.hpp.

◆ feVector_Type

type of template

Definition at line 151 of file TimeAdvanceBDF.hpp.

◆ feVectorContainer_Type

container of feVector

Definition at line 154 of file TimeAdvanceBDF.hpp.

◆ feVectorContainerPtr_Type

container of pointer of feVector;

Definition at line 157 of file TimeAdvanceBDF.hpp.

◆ feVectorContainerPtrIterate_Type

typedef feVectorContainerPtr_Type::iterator feVectorContainerPtrIterate_Type

iterator;

Definition at line 160 of file TimeAdvanceBDF.hpp.

◆ feVectorSharedPtrContainer_Type

container of pointer of feVector;

Definition at line 163 of file TimeAdvanceBDF.hpp.

Constructor & Destructor Documentation

◆ TimeAdvanceBDF()

Empty Constructor.

Definition at line 304 of file TimeAdvanceBDF.hpp.

◆ ~TimeAdvanceBDF()

virtual ~TimeAdvanceBDF ( )
inlinevirtual

Destructor.

Definition at line 175 of file TimeAdvanceBDF.hpp.

Member Function Documentation

◆ shiftRight()

void shiftRight ( const feVector_Type solution)
virtual

Update the state vector.

Update the vectors of the previous time steps by shifting on the right the old values.

Parameters
solutioncurrent (new) value of the state vector

Implements TimeAdvance< feVectorType >.

Definition at line 314 of file TimeAdvanceBDF.hpp.

◆ RHSFirstDerivative()

void RHSFirstDerivative ( const Real timeStep,
feVectorType &  rhsContribution 
) const

Update the right hand side $ f_V $ of the time derivative formula.

Return the right hand side $ f_V $ of the time derivative formula

Parameters
timeStepdefined the time step need to compute the
Returns
rhsV

Definition at line 337 of file TimeAdvanceBDF.hpp.

◆ updateRHSSecondDerivative()

void updateRHSSecondDerivative ( const Real timeStep = 1)

Update the right hand side $ f_W $ of the time derivative formula.

Sets and Returns the right hand side $ f_W $ of the time derivative formula

Parameters
timeStepdefined the time step need to compute the $ f_W $
Returns
rhsW

Definition at line 351 of file TimeAdvanceBDF.hpp.

◆ showMe()

void showMe ( std::ostream &  output = std::cout) const

Show the properties of temporal scheme.

Definition at line 370 of file TimeAdvanceBDF.hpp.

◆ setup() [1/2]

void setup ( const UInt order,
const UInt orderDerivative = 1 
)

Initialize the parameters of time advance scheme.

Initialize parameters of time advance scheme;

Parameters
orderdefine the order of BDF;
orderDerivativedefine the order of derivate;

Definition at line 403 of file TimeAdvanceBDF.hpp.

◆ setup() [2/2]

void setup ( const std::vector< Real > &  ,
const UInt  
)
inline

Initialize the parameters of time advance scheme used in TimeAdvanceNewmark.

Note
: this setup does not run for BDF class;

Definition at line 224 of file TimeAdvanceBDF.hpp.

◆ setInitialCondition() [1/4]

void setInitialCondition ( const feVector_Type x0)

Initialize the StateVector.

Initialize all the entries of the unknown vector to be derived with the vector x0 (duplicated). this class is virtual because used in BDF;

Parameters
x0is the initial unk;

Definition at line 526 of file TimeAdvanceBDF.hpp.

◆ setInitialCondition() [2/4]

void setInitialCondition ( const feVector_Type ,
const feVector_Type  
)
inline

Initialize the StateVector used in TimeAdvanceNewmark.

Definition at line 238 of file TimeAdvanceBDF.hpp.

◆ setInitialCondition() [3/4]

void setInitialCondition ( const feVector_Type ,
const feVector_Type ,
const feVector_Type  
)
inline

Initialize the StateVector used in TimeAdvanceNewmark.

Definition at line 244 of file TimeAdvanceBDF.hpp.

◆ setInitialCondition() [4/4]

void setInitialCondition ( const feVectorSharedPtrContainer_Type x0)

Initialize all the entries of the unknown vector to be derived with a.

set of vectors x0

Note
: this is taken as a copy (not a reference), since x0 is resized inside the method.

initialize zero

Definition at line 551 of file TimeAdvanceBDF.hpp.

◆ coefficientExtrapolation()

Real coefficientExtrapolation ( const UInt i) const
inline

Return the $i$-th coefficient of the unk's extrapolation.

Parameters

Definition at line 606 of file TimeAdvanceBDF.hpp.

◆ coefficientExtrapolationFirstDerivative()

double coefficientExtrapolationFirstDerivative ( const UInt i) const
inline

Return the $i$-th coefficient of the velocity's extrapolation.

Parameters

Definition at line 616 of file TimeAdvanceBDF.hpp.

◆ extrapolation()

void extrapolation ( feVector_Type extrapolation) const

Compute the polynomial extrapolation of solution.

Compute the polynomial extrapolation approximation of order $n-1$ of $u^{n+1}$ defined by the n stored state vectors

Definition at line 626 of file TimeAdvanceBDF.hpp.

◆ extrapolationFirstDerivative()

void extrapolationFirstDerivative ( feVector_Type extrapolation) const

Compute the polynomial extrapolation of velocity.

Compute the polynomial extrapolation approximation of order $n-1$ of $u^{n+1}$ defined by the n stored state vectors

Definition at line 638 of file TimeAdvanceBDF.hpp.

◆ firstDerivative()

feVectorType firstDerivative ( ) const

Return the current velocity.

Definition at line 653 of file TimeAdvanceBDF.hpp.

◆ secondDerivative()

feVectorType secondDerivative ( ) const

Return the current acceleration.

Definition at line 681 of file TimeAdvanceBDF.hpp.


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