3
#include <yade/core/Scene.hpp>
4
#include<yade/pkg/dem/Integrator.hpp>
5
#include<boost/numeric/odeint.hpp>
8
typedef boost::numeric::odeint::runge_kutta_cash_karp54< stateVector > error_stepper_type; //Runge-Kutta 54 error stepper other steppers can also be used
10
typedef boost::numeric::odeint::controlled_runge_kutta< error_stepper_type > controlled_stepper_type;//Controlled Runge Kutta stepper
12
typedef boost::numeric::odeint::default_error_checker< error_stepper_type::value_type,error_stepper_type::algebra_type ,error_stepper_type::operations_type > error_checker_type; //Error checker type that is redefined for initialization using different tolerance values
15
shared_ptr<Integrator> RungeKuttaCashKarp54Integrator_ctor_list(const boost::python::list& slaves);
16
class RungeKuttaCashKarp54Integrator: public Integrator {
20
error_checker_type rungekuttaerrorcontroller;
22
controlled_stepper_type rungekuttastepper;
26
rungekuttaerrorcontroller=error_checker_type(abs_err,rel_err,a_x,a_dxdt);
27
rungekuttastepper=controlled_stepper_type(rungekuttaerrorcontroller);
32
virtual void action();
34
YADE_CLASS_BASE_DOC_ATTRS_CTOR_PY(RungeKuttaCashKarp54Integrator,Integrator,"RungeKuttaCashKarp54Integrator engine.",
35
((Real,abs_err,1e-6,,"Relative integration tolerance"))
36
((Real,rel_err,1e-6,,"Absolute integration tolerance"))
38
((Real,a_dxdt,1.0,,""))
39
((Real,stepsize,1e-6,,"It is not important for an adaptive integration but important for the observer for setting the found states after integration"))
44
.def("__init__",boost::python::make_constructor(RungeKuttaCashKarp54Integrator_ctor_list),"Construct from (possibly nested) list of slaves.")
48
REGISTER_SERIALIZABLE(RungeKuttaCashKarp54Integrator);