~ubuntu-branches/debian/jessie/yade/jessie

« back to all changes in this revision

Viewing changes to pkg/dem/RungeKuttaCashKarp54Integrator.hpp

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2014-06-25 20:43:49 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20140625204349-tn3dqehk352c2xv1
Tags: 1.10.0-1
* [431abb8] Imported Upstream version 1.10.0 (Closes: #750318)
* [3552a3e] Set minimal vtk6 version 6.1.0+dfsg-8.
* [cd915f6] Set minimal eigen3 version 3.2.1-2.
* [8e02049] Add autopkgtest-field to control.
* [38389f8] Remove patches aplied by upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifdef YADE_ODEINT
 
2
#pragma once
 
3
#include <yade/core/Scene.hpp>
 
4
#include<yade/pkg/dem/Integrator.hpp>
 
5
#include<boost/numeric/odeint.hpp>
 
6
 
 
7
 
 
8
typedef boost::numeric::odeint::runge_kutta_cash_karp54< stateVector > error_stepper_type; //Runge-Kutta 54 error stepper other steppers can also be used
 
9
 
 
10
typedef boost::numeric::odeint::controlled_runge_kutta< error_stepper_type > controlled_stepper_type;//Controlled Runge Kutta stepper
 
11
 
 
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
 
13
 
 
14
 
 
15
shared_ptr<Integrator> RungeKuttaCashKarp54Integrator_ctor_list(const boost::python::list& slaves);
 
16
class RungeKuttaCashKarp54Integrator: public Integrator {
 
17
        
 
18
        public:
 
19
        
 
20
                error_checker_type rungekuttaerrorcontroller;
 
21
        
 
22
                controlled_stepper_type rungekuttastepper;
 
23
 
 
24
                void init()
 
25
                {
 
26
                        rungekuttaerrorcontroller=error_checker_type(abs_err,rel_err,a_x,a_dxdt);
 
27
                        rungekuttastepper=controlled_stepper_type(rungekuttaerrorcontroller);
 
28
                }
 
29
 
 
30
 
 
31
 
 
32
                virtual void action();
 
33
 
 
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"))         
 
37
                ((Real,a_x,1.0,,""))
 
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"))
 
40
                ,
 
41
                /*ctor*/
 
42
                init();
 
43
                ,
 
44
                .def("__init__",boost::python::make_constructor(RungeKuttaCashKarp54Integrator_ctor_list),"Construct from (possibly nested) list of slaves.")
 
45
                /*py*/
 
46
        );
 
47
};
 
48
REGISTER_SERIALIZABLE(RungeKuttaCashKarp54Integrator);
 
49
#endif