A generic implementation of explicit Runge-Kutta algorithms with error estimation.
More...
|
typedef
explicit_error_stepper_base
< explicit_error_generic_rk
< StageCount, Order,
StepperOrder, ErrorOrder,
State, Value, Deriv, Time,
Algebra, Operations, Resizer >
, Order, StepperOrder,
ErrorOrder, State, Value,
Deriv, Time, Algebra,
Operations, Resizer > | stepper_base_type |
| |
typedef
stepper_base_type::state_type | state_type |
| |
typedef
stepper_base_type::wrapped_state_type | wrapped_state_type |
| |
typedef
stepper_base_type::value_type | value_type |
| |
typedef
stepper_base_type::deriv_type | deriv_type |
| |
typedef
stepper_base_type::wrapped_deriv_type | wrapped_deriv_type |
| |
typedef
stepper_base_type::time_type | time_type |
| |
typedef
stepper_base_type::algebra_type | algebra_type |
| |
typedef
stepper_base_type::operations_type | operations_type |
| |
typedef
stepper_base_type::resizer_type | resizer_type |
| |
typedef
explicit_error_generic_rk
< StageCount, Order,
StepperOrder, ErrorOrder,
State, Value, Deriv, Time,
Algebra, Operations, Resizer > | stepper_type |
| |
typedef
detail::generic_rk_algorithm
< StageCount, Value, Algebra,
Operations > | rk_algorithm_type |
| |
typedef
rk_algorithm_type::coef_a_type | coef_a_type |
| |
typedef
rk_algorithm_type::coef_b_type | coef_b_type |
| |
typedef
rk_algorithm_type::coef_c_type | coef_c_type |
| |
typedef algebra_stepper_base
< Algebra, Operations > | algebra_stepper_base_type |
| |
| typedef explicit_error_stepper_tag | stepper_category |
| |
typedef
explicit_error_stepper_base
< explicit_error_generic_rk
< StageCount, Order,
StepperOrder, ErrorOrder,
State, Value, Deriv, Time,
Algebra, Operations, Resizer >
, Order, StepperOrder,
ErrorOrder, State, Value,
Deriv, Time, Algebra,
Operations, Resizer > | internal_stepper_base_type |
| |
| typedef unsigned short | order_type |
| |
|
| | explicit_error_generic_rk (const coef_a_type &a, const coef_b_type &b, const coef_b_type &b2, const coef_c_type &c, const algebra_type &algebra=algebra_type()) |
| | Constructs the explicit_error_generik_rk class with the given parameters a, b, b2 and c. More...
|
| |
| template<class System , class StateIn , class DerivIn , class StateOut , class Err > |
| void | do_step_impl (System system, const StateIn &in, const DerivIn &dxdt, time_type t, StateOut &out, time_type dt, Err &xerr) |
| | This method performs one step. More...
|
| |
| template<class System , class StateIn , class DerivIn , class StateOut > |
| void | do_step_impl (System system, const StateIn &in, const DerivIn &dxdt, time_type t, StateOut &out, time_type dt) |
| | This method performs one step. More...
|
| |
| template<class StateIn > |
| void | adjust_size (const StateIn &x) |
| | Adjust the size of all temporaries in the stepper manually. More...
|
| |
| order_type | order (void) const |
| |
| order_type | stepper_order (void) const |
| |
| order_type | error_order (void) const |
| |
| void | do_step (System system, StateInOut &x, time_type t, time_type dt) |
| | This method performs one step. More...
|
| |
| void | do_step (System system, const StateInOut &x, time_type t, time_type dt) |
| | Second version to solve the forwarding problem, can be called with Boost.Range as StateInOut. More...
|
| |
boost::disable_if
< boost::is_same< DerivIn,
time_type >, void >::type | do_step (System system, StateInOut &x, const DerivIn &dxdt, time_type t, time_type dt) |
| | The method performs one step with the stepper passed by Stepper. More...
|
| |
boost::disable_if
< boost::is_same< StateIn,
time_type >, void >::type | do_step (System system, const StateIn &in, time_type t, StateOut &out, time_type dt) |
| | The method performs one step with the stepper passed by Stepper. More...
|
| |
boost::disable_if
< boost::is_same< DerivIn,
time_type >, void >::type | do_step (System system, const StateIn &in, const DerivIn &dxdt, time_type t, StateOut &out, time_type dt) |
| | The method performs one step with the stepper passed by Stepper. More...
|
| |
| void | do_step (System system, StateInOut &x, time_type t, time_type dt, Err &xerr) |
| | The method performs one step with the stepper passed by Stepper and estimates the error. More...
|
| |
| void | do_step (System system, const StateInOut &x, time_type t, time_type dt, Err &xerr) |
| | Second version to solve the forwarding problem, can be called with Boost.Range as StateInOut. More...
|
| |
boost::disable_if
< boost::is_same< DerivIn,
time_type >, void >::type | do_step (System system, StateInOut &x, const DerivIn &dxdt, time_type t, time_type dt, Err &xerr) |
| | The method performs one step with the stepper passed by Stepper. More...
|
| |
| void | do_step (System system, const StateIn &in, time_type t, StateOut &out, time_type dt, Err &xerr) |
| | The method performs one step with the stepper passed by Stepper. More...
|
| |
| void | do_step (System system, const StateIn &in, const DerivIn &dxdt, time_type t, StateOut &out, time_type dt, Err &xerr) |
| | The method performs one step with the stepper passed by Stepper. More...
|
| |
| algebra_type & | algebra () |
| |
| const algebra_type & | algebra () const |
| |
template<size_t StageCount, size_t Order, size_t StepperOrder, size_t ErrorOrder, class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
class boost::numeric::odeint::explicit_error_generic_rk< StageCount, Order, StepperOrder, ErrorOrder, State, Value, Deriv, Time, Algebra, Operations, Resizer >
A generic implementation of explicit Runge-Kutta algorithms with error estimation.
This class is as a base class for all explicit Runge-Kutta steppers with error estimation.
This class implements the explicit Runge-Kutta algorithms with error estimation in a generic way. The Butcher tableau is passed to the stepper which constructs the stepper scheme with the help of a template-metaprogramming algorithm. ToDo : Add example!
This class derives explicit_error_stepper_base which provides the stepper interface.
- Template Parameters
-
| StageCount | The number of stages of the Runge-Kutta algorithm. |
| Order | The order of a stepper if the stepper is used without error estimation. |
| StepperOrder | The order of a step if the stepper is used with error estimation. Usually Order and StepperOrder have the same value. |
| ErrorOrder | The order of the error step if the stepper is used with error estimation. |
| State | The type representing the state of the ODE. |
| Value | The floating point type which is used in the computations. |
| Time | The type representing the independent variable - the time - of the ODE. |
| Algebra | The algebra type. |
| Operations | The operations type. |
| Resizer | The resizer policy type. |
template<size_t StageCount, size_t Order, size_t StepperOrder, size_t ErrorOrder, class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
| boost::numeric::odeint::explicit_error_generic_rk< StageCount, Order, StepperOrder, ErrorOrder, State, Value, Deriv, Time, Algebra, Operations, Resizer >::explicit_error_generic_rk |
( |
const coef_a_type & |
a, |
|
|
const coef_b_type & |
b, |
|
|
const coef_b_type & |
b2, |
|
|
const coef_c_type & |
c, |
|
|
const algebra_type & |
algebra = algebra_type() |
|
) |
| |
|
inline |
Constructs the explicit_error_generik_rk class with the given parameters a, b, b2 and c.
See examples section for details on the coefficients.
- Parameters
-
| a | Triangular matrix of parameters b in the Butcher tableau. |
| b | Last row of the butcher tableau. |
| b2 | Parameters for lower-order evaluation to estimate the error. |
| c | Parameters to calculate the time points in the Butcher tableau. |
| algebra | A copy of algebra is made and stored inside explicit_stepper_base. |
template<size_t StageCount, size_t Order, size_t StepperOrder, size_t ErrorOrder, class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
template<class System , class StateIn , class DerivIn , class StateOut , class Err >
| boost::numeric::odeint::explicit_error_generic_rk< StageCount, Order, StepperOrder, ErrorOrder, State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step_impl |
( |
System |
system, |
|
|
const StateIn & |
in, |
|
|
const DerivIn & |
dxdt, |
|
|
time_type |
t, |
|
|
StateOut & |
out, |
|
|
time_type |
dt, |
|
|
Err & |
xerr |
|
) |
| |
|
inline |
This method performs one step.
The derivative dxdt of in at the time t is passed to the method. The result is updated out-of-place, hence the input is in in and the output in out. Futhermore, an estimation of the error is stored in xerr. do_step_impl is used by explicit_error_stepper_base.
- Parameters
-
| system | The system function to solve, hence the r.h.s. of the ODE. It must fulfill the Simple System concept. |
| in | The state of the ODE which should be solved. in is not modified in this method |
| dxdt | The derivative of x at t. |
| t | The value of the time, at which the step should be performed. |
| out | The result of the step is written in out. |
| dt | The step size. |
| xerr | The result of the error estimation is written in xerr. |
Referenced by boost::numeric::odeint::explicit_error_generic_rk< 6, 5, 5, 4, State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step_impl().
template<size_t StageCount, size_t Order, size_t StepperOrder, size_t ErrorOrder, class State, class Value = double, class Deriv = State, class Time = Value, class Algebra = typename algebra_dispatcher< State >::algebra_type, class Operations = typename operations_dispatcher< State >::operations_type, class Resizer = initially_resizer>
template<class System , class StateIn , class DerivIn , class StateOut >
| boost::numeric::odeint::explicit_error_generic_rk< StageCount, Order, StepperOrder, ErrorOrder, State, Value, Deriv, Time, Algebra, Operations, Resizer >::do_step_impl |
( |
System |
system, |
|
|
const StateIn & |
in, |
|
|
const DerivIn & |
dxdt, |
|
|
time_type |
t, |
|
|
StateOut & |
out, |
|
|
time_type |
dt |
|
) |
| |
|
inline |
This method performs one step.
The derivative dxdt of in at the time t is passed to the method. The result is updated out-of-place, hence the input is in in and the output in out. Access to this step functionality is provided by explicit_stepper_base and do_step_impl should not be called directly.
- Parameters
-
| system | The system function to solve, hence the r.h.s. of the ODE. It must fulfill the Simple System concept. |
| in | The state of the ODE which should be solved. in is not modified in this method |
| dxdt | The derivative of x at t. |
| t | The value of the time, at which the step should be performed. |
| out | The result of the step is written in out. |
| dt | The step size. |