Medusa  1.1
Coordinate Free Mehless Method implementation
mm::integrators::Explicit Namespace Reference

Detailed Description

Namespace containing factory functions for explicit single step integrators.

Factory functions are provided for the most common ones, such as Euler's method, Midpoint rule, RK4, ...

Usage example:

std::function<Eigen::VectorXd(double, const Eigen::VectorXd&)> func =
[](double, const Eigen::VectorXd& y) {
return -y;
};
Eigen::VectorXd y0(1);
y0 << 1.0;
double tmax = 10.0;
double dt = 0.1;
auto integrator = integrators::Explicit::RK4().solve(func, 0.0, tmax, dt, y0);
std::cout << integrator << std::endl;
for (auto& step : integrator) {
// You can use read write access to:
step.value();
step.time();
// and check if this is the last step:
step.is_last();
}
// Aditionally, one can iterate manually
auto step = integrator.begin();
while (step) {
// do something with step
++step;
}
Eigen::VectorXd value = step.value(); // do something with value

Functions

template<class scalar_t >
RKExplicit< scalar_t, 4 > RK4 ()
 Standard RK4 4th order method. More...
 
template<class scalar_t >
RKExplicit< scalar_t, 4 > RK38 ()
 3/8 rule 4th order method More...
 
template<class scalar_t >
RKExplicit< scalar_t, 1 > Euler ()
 Explicit Euler's method, 1st order. More...
 
template<class scalar_t >
RKExplicit< scalar_t, 2 > Midpoint ()
 Explicit midpoint rule, 2nd order. More...
 
template<class scalar_t >
RKExplicit< scalar_t, 3 > RK3 ()
 Kutta's third order method. More...
 
template<class scalar_t >
RKExplicit< scalar_t, 6 > Fehlberg5 ()
 Fifth order method appearing in Fehlberg's method. More...
 
template<int order, class scalar_t = double>
static RKExplicit< scalar_t, order > of_order ()
 Returns Runge Kutta explicit method of requested order with given floating point type. More...
 

Function Documentation

◆ Euler()

template<class scalar_t >
RKExplicit< scalar_t, 1 > mm::integrators::Explicit::Euler ( )

Explicit Euler's method, 1st order.

Examples
test/end2end/diffusion_explicit.cpp, and test/integrators/RKExplicit_test.cpp.

Definition at line 44 of file RKExplicit.hpp.

◆ Fehlberg5()

template<class scalar_t >
RKExplicit< scalar_t, 6 > mm::integrators::Explicit::Fehlberg5 ( )

Fifth order method appearing in Fehlberg's method.

Examples
test/integrators/AdamsBashforth_test.cpp.

Definition at line 79 of file RKExplicit.hpp.

◆ Midpoint()

template<class scalar_t >
RKExplicit< scalar_t, 2 > mm::integrators::Explicit::Midpoint ( )

Explicit midpoint rule, 2nd order.

Examples
test/integrators/RKExplicit_test.cpp.

Definition at line 55 of file RKExplicit.hpp.

◆ of_order()

template<int order, class scalar_t = double>
static RKExplicit<scalar_t, order> mm::integrators::Explicit::of_order ( )
static

Returns Runge Kutta explicit method of requested order with given floating point type.

Definition at line 293 of file RKExplicit_fwd.hpp.

◆ RK3()

template<class scalar_t >
RKExplicit< scalar_t, 3 > mm::integrators::Explicit::RK3 ( )

Kutta's third order method.

Examples
test/integrators/RKExplicit_test.cpp.

Definition at line 66 of file RKExplicit.hpp.

◆ RK38()

template<class scalar_t >
RKExplicit< scalar_t, 4 > mm::integrators::Explicit::RK38 ( )

3/8 rule 4th order method

Examples
test/integrators/RKExplicit_test.cpp.

Definition at line 30 of file RKExplicit.hpp.

◆ RK4()

template<class scalar_t >
RKExplicit< scalar_t, 4 > mm::integrators::Explicit::RK4 ( )

Standard RK4 4th order method.

Examples
test/integrators/RKExplicit_test.cpp.

Definition at line 16 of file RKExplicit.hpp.

mm::integrators::Explicit::RK4
RKExplicit< scalar_t, 4 > RK4()
Standard RK4 4th order method.
Definition: RKExplicit.hpp:16