MOOSE - Multiscale Object Oriented Simulation Environment
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
BoostSys.h
Go to the documentation of this file.
1 #ifndef BOOSTSYSTEM_H
2 #define BOOSTSYSTEM_H
3 
4 #ifdef USE_BOOST_ODE
5 
6 #include <vector>
7 #include <string>
8 #include <boost/numeric/odeint.hpp>
9 
10 typedef double value_type_;
11 typedef std::vector<value_type_> vector_type_;
12 
13 typedef boost::numeric::odeint::runge_kutta4< vector_type_ > rk4_stepper_type_;
14 typedef boost::numeric::odeint::runge_kutta_dopri5< vector_type_ > rk_dopri_stepper_type_;
15 typedef boost::numeric::odeint::modified_midpoint< vector_type_ > rk_midpoint_stepper_type_;
16 
17 /*-----------------------------------------------------------------------------
18  * This stepper type found to be most suitable for adaptive solver. The gsl
19  * implementation has runge_kutta_fehlberg78 solver.
20  *-----------------------------------------------------------------------------*/
21 typedef boost::numeric::odeint::runge_kutta_cash_karp54< vector_type_ > rk_karp_stepper_type_;
22 typedef boost::numeric::odeint::runge_kutta_fehlberg78< vector_type_ > rk_felhberg_stepper_type_;
23 
24 
25 class VoxelPools;
26 
27 /*
28  * =====================================================================================
29  * Class: BoostSys
30  * Description: The ode system of ksolve. It uses boost library to solve it.
31  * It is intended to be gsl replacement.
32  * =====================================================================================
33  */
34 class BoostSys
35 {
36 public:
37  BoostSys( );
38  ~BoostSys( );
39 
40  /* Operator is called by boost ode-solver */
41  void operator()( const vector_type_ y , vector_type_& dydt, const double t );
42 
43  /* Pointer to the arbitrary parameters of the system */
44  VoxelPools* vp;
45  void* params;
46 
47  double epsAbs;
48  double epsRel;
49  std::string method;
50 };
51 
52 #endif // USE_BOOST_ODE
53 
54 #endif /* end of include guard: BOOSTSYSTEM_H */
55