Extension: Matrix functions
#include "dg/matrix/matrix.h"
|
Exponential one step time-integration for \( \dot y = A y \). More...
Public Types | |
using | value_type = get_value_type< ContainerType > |
the value type of the time variable (float or double) More... | |
using | container_type = ContainerType |
Public Member Functions | |
ExponentialStep ()=default | |
no memory allocation More... | |
ExponentialStep (const ContainerType ©able) | |
Reserve internal workspace for the integration. More... | |
const ContainerType & | copyable () const |
template<class MatrixFunction > | |
void | step (MatrixFunction &ode, value_type t0, const ContainerType &u0, value_type &t1, ContainerType &u1, value_type dt) |
Advance one step via \( u_1 = \exp( A \Delta t) u_0\), \( t_1 = t_0 + \Delta_t\). More... | |
Exponential one step time-integration for \( \dot y = A y \).
This integrator computes the exact solution
\[ \begin{align} y^{n+1} = \exp(-\Delta t A) y^n \end{align} \]
This class is usable in the dg::SinglestepTimeloop
ContainerType | Any class for which a specialization of TensorTraits exists and which fulfills the requirements of the there defined data and execution policies derived from AnyVectorTag and AnyPolicyTag . Among others
ContainerTypes in the argument list, then TensorTraits must exist for all of them |
using dg::mat::ExponentialStep< ContainerType >::container_type = ContainerType |
the type of the vector class in use
using dg::mat::ExponentialStep< ContainerType >::value_type = get_value_type<ContainerType> |
the value type of the time variable (float or double)
|
default |
no memory allocation
|
inline |
Reserve internal workspace for the integration.
copyable | vector of the size that is later used in step ( it does not matter what values copyable contains, but its size is important; the step method can only be called with vectors of the same size) |
|
inline |
|
inline |
Advance one step via \( u_1 = \exp( A \Delta t) u_0\), \( t_1 = t_0 + \Delta_t\).
MatrixFunction | The exponential of the (part of the) right hand side is a functor type with no return value (subroutine) of signature void operator()(UnaryOp, const ContainerType&, ContainerType&) The first argument is the matrix function to compute, the second is the input vector, which the functor may not override, and the third is the output. The timestepper will call MatrixFunction(f, y, yp) where f typically is the exponential or dg::mat::phi1 , dg::mat::phi2 , etc. The FunctionalButcherTableau determines which matrix functions are used. The timestepper expects that MatrixFunction(f, y, yp) computes \( y' = f( A) y\). The two ContainerType arguments never alias each other in calls to the functor. The functor can throw to indicate failure. Exceptions should derive from std::exception . |
ode | object that computes matrix functions (for this class always the exponential) of the right hand side |
t0 | start time |
u0 | value at t0 |
t1 | (write only) end time ( equals t0+dt on return, may alias t0 ) |
u1 | (write only) contains result on return (may alias u0) |
dt | timestep |