Class template Dune::GDT::AdaptiveRungeKuttaTimeStepper¶
Inherits from Dune::GDT::TimeStepperInterface.
-
template<class OperatorImp, class DiscreteFunctionImp, TimeStepperMethods method = TimeStepperMethods::dormand_prince>
class Dune::GDT::AdaptiveRungeKuttaTimeStepper : public TimeStepperInterface<DiscreteFunctionImp>¶ Time stepper using adaptive Runge Kutta methods
Timestepper using adaptive Runge Kutta methods to solve equations of the form u_t = r * L(u, t) where u is a discrete function, L an operator acting on u and alpha a scalar factor (e.g. -1). The specific Runge Kutta method can be chosen as the third template argument. If your desired Runge Kutta method is not contained in AdaptiveRungeKuttaMethods, choose AdaptiveRungeKuttaMethods::other and supply a DynamicMatrix < RangeFieldType > A and vectors b_1, b_2 (DynamicVector < RangeFieldType >) and c (DynamicVector < RangeFieldType >) in the constructor. Here, A, b_1, b_2 and c form the butcher tableau (see https://en.wikipedia.org/wiki/List_of_Runge%E2%80%93Kutta_methods#Embedded_methods, A is composed of the coefficients a_{ij}, b_1 of b_j, b_2 of b_j^* and c of c_j). The default is the Dormand-Prince RK45 method. In each time step, the error is estimated using the difference between the two solutions obtained using either b_1 or b_2. If the estimated error is higher than a specified tolerance tol, the calculation is repeated with a smaller time step. The tolerance tol and the error estimate are also used to estimate the optimal time step length for the next time step via dt_new = dt_oldmin(max(0.9(tol/error)^(1/5), scale_factor_min), scale_factor_max_);
Notation: For an s-stage method, mathbf {u}^{n+1} = mathbf {u}^n + dt sum_ {i=0}^{s-1} b_i mathbf {k}_i mathbf {k}_i = L( mathbf {u}i, t^n + dt c_i) mathbf {u}i = mathbf {u}^n + dt sum {j=0}^{i-1} a{ij} mathbf {k}_j,
-
RangeFieldType Dune::GDT::AdaptiveRungeKuttaTimeStepper::solve(const RangeFieldType t_end, const RangeFieldType initial_dt, const size_t num_save_steps, const size_t num_output_steps, const bool save_solution, const bool visualize, const bool write_discrete, const bool write_exact, const std::string prefix, typename BaseType::DiscreteSolutionType &sol, const typename BaseType::VisualizerType &visualizer, const typename BaseType::StringifierType &stringifier, const typename BaseType::GridFunctionType &exact_solution) final override¶
No documentation provided.
-
RangeFieldType Dune::GDT::AdaptiveRungeKuttaTimeStepper::step(const RangeFieldType dt, const RangeFieldType max_dt) final override¶
No documentation provided.
-
template<>
Dune::GDT::AdaptiveRungeKuttaTimeStepper::AdaptiveRungeKuttaTimeStepper<OperatorImp, DiscreteFunctionImp, method>(const OperatorType &op, DiscreteFunctionType &initial_values, const RangeFieldType r = 1., const double t_0 = 0., const RangeFieldType tol = 1.0E-4, const RangeFieldType scale_factor_min = 0.20000000000000001, const RangeFieldType scale_factor_max = 5, const int &A = ButcherArrayProviderType::A(), const int &b_1 = ButcherArrayProviderType::b_1(), const int &b_2 = ButcherArrayProviderType::b_2(), const int &c = ButcherArrayProviderType::c())¶ Constructor for AdaptiveRungeKuttaTimeStepper time stepper
:param op: Operator L :param initial_values: Discrete function containing initial values for u at time t_0. :param r: Scalar factor (see above, default is 1) :param t_0: Initial time (default is 0) :param tol: Error tolerance for the adaptive scheme (default is 1e-4) :param scale_factor_min: Minimum allowed factor for time step scaling (default is 0.2). :param scale_factor_max: Maximum allowed factor for time step scaling (default is 5). :param A: Coefficient matrix (only provide if you use AdaptiveRungeKuttaMethods::other) :param b_1: First set of coefficients (only provide if you use AdaptiveRungeKuttaMethods::other) :param b_2: Second set of coefficients (only provide if you use AdaptiveRungeKuttaMethods::other) :param c: Coefficients for time steps (only provide if you use AdaptiveRungeKuttaMethods::other)
-
const OperatorType &Dune::GDT::AdaptiveRungeKuttaTimeStepper::op_¶
No documentation provided.
-
const RangeFieldType Dune::GDT::AdaptiveRungeKuttaTimeStepper::r_¶
No documentation provided.
-
const RangeFieldType Dune::GDT::AdaptiveRungeKuttaTimeStepper::tol_¶
No documentation provided.
-
const RangeFieldType Dune::GDT::AdaptiveRungeKuttaTimeStepper::scale_factor_min_¶
No documentation provided.
-
const RangeFieldType Dune::GDT::AdaptiveRungeKuttaTimeStepper::scale_factor_max_¶
No documentation provided.
-
DiscreteFunctionType Dune::GDT::AdaptiveRungeKuttaTimeStepper::u_tmp_¶
No documentation provided.
-
const int Dune::GDT::AdaptiveRungeKuttaTimeStepper::A_¶
No documentation provided.
-
const int Dune::GDT::AdaptiveRungeKuttaTimeStepper::b_1_¶
No documentation provided.
-
const int Dune::GDT::AdaptiveRungeKuttaTimeStepper::b_2_¶
No documentation provided.
-
const int Dune::GDT::AdaptiveRungeKuttaTimeStepper::c_¶
No documentation provided.
-
const int Dune::GDT::AdaptiveRungeKuttaTimeStepper::b_diff_¶
No documentation provided.
-
int Dune::GDT::AdaptiveRungeKuttaTimeStepper::stages_k_¶
No documentation provided.
-
const size_t Dune::GDT::AdaptiveRungeKuttaTimeStepper::num_stages_¶
No documentation provided.
-
int Dune::GDT::AdaptiveRungeKuttaTimeStepper::last_stage_of_previous_step_¶
No documentation provided.
-
type Dune::GDT::AdaptiveRungeKuttaTimeStepper::BaseType¶
No documentation provided.
-
type Dune::GDT::AdaptiveRungeKuttaTimeStepper::ButcherArrayProviderType¶
No documentation provided.
-
type Dune::GDT::AdaptiveRungeKuttaTimeStepper::OperatorType¶
No documentation provided.
-
type Dune::GDT::AdaptiveRungeKuttaTimeStepper::DiscreteFunctionType¶
No documentation provided.
-
type Dune::GDT::AdaptiveRungeKuttaTimeStepper::DomainFieldType¶
No documentation provided.
-
type Dune::GDT::AdaptiveRungeKuttaTimeStepper::RangeFieldType¶
No documentation provided.