Reference documentation for deal.II version GIT d77e5ebb0a 2023-01-27 22:35:02+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Classes | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
TimeStepping::ImplicitRungeKutta< VectorType > Class Template Reference

#include <deal.II/base/time_stepping.h>

Inheritance diagram for TimeStepping::ImplicitRungeKutta< VectorType >:
[legend]

Classes

struct  Status
 

Public Member Functions

 ImplicitRungeKutta ()=default
 
 ImplicitRungeKutta (const runge_kutta_method method, const unsigned int max_it=100, const double tolerance=1e-6)
 
void initialize (const runge_kutta_method method) override
 
double evolve_one_time_step (const std::function< VectorType(const double, const VectorType &)> &f, const std::function< VectorType(const double, const double, const VectorType &)> &id_minus_tau_J_inverse, double t, double delta_t, VectorType &y) override
 
void set_newton_solver_parameters (const unsigned int max_it, const double tolerance)
 
const Statusget_status () const override
 
double evolve_one_time_step (std::vector< std::function< VectorType(const double, const VectorType &)>> &F, std::vector< std::function< VectorType(const double, const double, const VectorType &)>> &J_inverse, double t, double delta_t, VectorType &y) override
 

Protected Attributes

unsigned int n_stages
 
std::vector< doubleb
 
std::vector< doublec
 
std::vector< std::vector< double > > a
 

Private Member Functions

void compute_stages (const std::function< VectorType(const double, const VectorType &)> &f, const std::function< VectorType(const double, const double, const VectorType &)> &id_minus_tau_J_inverse, double t, double delta_t, VectorType &y, std::vector< VectorType > &f_stages)
 
void newton_solve (const std::function< void(const VectorType &, VectorType &)> &get_residual, const std::function< VectorType(const VectorType &)> &id_minus_tau_J_inverse, VectorType &y)
 
void compute_residual (const std::function< VectorType(const double, const VectorType &)> &f, double t, double delta_t, const VectorType &new_y, const VectorType &y, VectorType &tendency, VectorType &residual) const
 

Private Attributes

unsigned int max_it
 
double tolerance
 
Status status
 

Detailed Description

template<typename VectorType>
class TimeStepping::ImplicitRungeKutta< VectorType >

This class is derived from RungeKutta and implement the implicit methods. This class works only for Diagonal Implicit Runge-Kutta (DIRK) methods.

Definition at line 530 of file time_stepping.h.

Constructor & Destructor Documentation

◆ ImplicitRungeKutta() [1/2]

template<typename VectorType >
TimeStepping::ImplicitRungeKutta< VectorType >::ImplicitRungeKutta ( )
default

Default constructor. initialize(runge_kutta_method) and set_newton_solver_parameters(unsigned int,double) need to be called before the object can be used.

◆ ImplicitRungeKutta() [2/2]

template<typename VectorType >
TimeStepping::ImplicitRungeKutta< VectorType >::ImplicitRungeKutta ( const runge_kutta_method  method,
const unsigned int  max_it = 100,
const double  tolerance = 1e-6 
)

Constructor. This function calls initialize(runge_kutta_method) and initialize the maximum number of iterations and the tolerance of the Newton solver.

Member Function Documentation

◆ initialize()

template<typename VectorType >
void TimeStepping::ImplicitRungeKutta< VectorType >::initialize ( const runge_kutta_method  method)
overridevirtual

Initialize the implicit Runge-Kutta method.

Implements TimeStepping::RungeKutta< VectorType >.

◆ evolve_one_time_step() [1/2]

template<typename VectorType >
double TimeStepping::ImplicitRungeKutta< VectorType >::evolve_one_time_step ( const std::function< VectorType(const double, const VectorType &)> &  f,
const std::function< VectorType(const double, const double, const VectorType &)> &  id_minus_tau_J_inverse,
double  t,
double  delta_t,
VectorType &  y 
)
overridevirtual

This function is used to advance from time t to t+ delta_t. f is the function \( f(t,y) \) that should be integrated, the input parameters are the time t and the vector y and the output is value of f at this point. id_minus_tau_J_inverse is a function that computes \( (I-\tau J)^{-1}\) where \( I \) is the identity matrix, \( \tau \) is given, and \( J \) is the Jacobian \( \frac{\partial f}{\partial y} \). The input parameters this function receives are the time, \( \tau \), and a vector. The output is the value of function at this point. evolve_one_time_step returns the time at the end of the time step.

Implements TimeStepping::RungeKutta< VectorType >.

◆ set_newton_solver_parameters()

template<typename VectorType >
void TimeStepping::ImplicitRungeKutta< VectorType >::set_newton_solver_parameters ( const unsigned int  max_it,
const double  tolerance 
)

Set the maximum number of iterations and the tolerance used by the Newton solver.

◆ get_status()

template<typename VectorType >
const Status& TimeStepping::ImplicitRungeKutta< VectorType >::get_status ( ) const
overridevirtual

Return the status of the current object.

Implements TimeStepping::TimeStepping< VectorType >.

◆ compute_stages()

template<typename VectorType >
void TimeStepping::ImplicitRungeKutta< VectorType >::compute_stages ( const std::function< VectorType(const double, const VectorType &)> &  f,
const std::function< VectorType(const double, const double, const VectorType &)> &  id_minus_tau_J_inverse,
double  t,
double  delta_t,
VectorType &  y,
std::vector< VectorType > &  f_stages 
)
private

Compute the different stages needed.

◆ newton_solve()

template<typename VectorType >
void TimeStepping::ImplicitRungeKutta< VectorType >::newton_solve ( const std::function< void(const VectorType &, VectorType &)> &  get_residual,
const std::function< VectorType(const VectorType &)> &  id_minus_tau_J_inverse,
VectorType &  y 
)
private

Newton solver used for the implicit stages.

◆ compute_residual()

template<typename VectorType >
void TimeStepping::ImplicitRungeKutta< VectorType >::compute_residual ( const std::function< VectorType(const double, const VectorType &)> &  f,
double  t,
double  delta_t,
const VectorType &  new_y,
const VectorType &  y,
VectorType &  tendency,
VectorType &  residual 
) const
private

Compute the residual needed by the Newton solver.

◆ evolve_one_time_step() [2/2]

template<typename VectorType >
double TimeStepping::RungeKutta< VectorType >::evolve_one_time_step ( std::vector< std::function< VectorType(const double, const VectorType &)>> &  F,
std::vector< std::function< VectorType(const double, const double, const VectorType &)>> &  J_inverse,
double  t,
double  delta_t,
VectorType &  y 
)
overridevirtualinherited

This function is used to advance from time t to t+ delta_t. F is a vector of functions \( f(t,y) \) that should be integrated, the input parameters are the time t and the vector y and the output is value of f at this point. J_inverse is a vector functions that compute the inverse of the Jacobians associated to the implicit problems. The input parameters are the time, \( \tau \), and a vector. The output is the value of function at this point. This function returns the time at the end of the time step. When using Runge-Kutta methods, F and @ J_inverse can only contain one element.

Implements TimeStepping::TimeStepping< VectorType >.

Member Data Documentation

◆ max_it

template<typename VectorType >
unsigned int TimeStepping::ImplicitRungeKutta< VectorType >::max_it
private

Maximum number of iterations of the Newton solver.

Definition at line 650 of file time_stepping.h.

◆ tolerance

template<typename VectorType >
double TimeStepping::ImplicitRungeKutta< VectorType >::tolerance
private

Tolerance of the Newton solver.

Definition at line 655 of file time_stepping.h.

◆ status

template<typename VectorType >
Status TimeStepping::ImplicitRungeKutta< VectorType >::status
private

Status structure of the object.

Definition at line 660 of file time_stepping.h.

◆ n_stages

template<typename VectorType >
unsigned int TimeStepping::RungeKutta< VectorType >::n_stages
protectedinherited

Number of stages of the Runge-Kutta method.

Definition at line 282 of file time_stepping.h.

◆ b

template<typename VectorType >
std::vector<double> TimeStepping::RungeKutta< VectorType >::b
protectedinherited

Butcher tableau coefficients.

Definition at line 287 of file time_stepping.h.

◆ c

template<typename VectorType >
std::vector<double> TimeStepping::RungeKutta< VectorType >::c
protectedinherited

Butcher tableau coefficients.

Definition at line 292 of file time_stepping.h.

◆ a

template<typename VectorType >
std::vector<std::vector<double> > TimeStepping::RungeKutta< VectorType >::a
protectedinherited

Butcher tableau coefficients.

Definition at line 297 of file time_stepping.h.


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