33 #ifndef DISCRETIZATION_OPTIONS_HPP 34 #define DISCRETIZATION_OPTIONS_HPP 40 #include <boost/numeric/odeint.hpp> 41 #include <boost/array.hpp> 47 namespace odeint = boost::numeric::odeint;
49 template <
class TValue =
double>
52 static constexpr
const size_t stageNr = 4;
53 static constexpr
const boost::array<TValue, 1>
a1 = { { +1.0 / 3.0 } };
54 static constexpr
const boost::array<TValue, 2>
a2 = { { -1.0 / 3.0, +1.0 } };
55 static constexpr
const boost::array<TValue, 3>
a3 = { { +1.0, -1.0, +1.0 } };
56 static constexpr
const boost::array<TValue, stageNr>
b = { { +1.0 / 8.0, +3.0 / 8.0, +3.0 / 8.0, +1.0 / 8.0 } };
57 static constexpr
const boost::array<TValue, stageNr>
c = { { +0.0, +1.0 / 3.0, +2.0 / 3.0, +1.0 } };
60 return std::move(boost::fusion::make_vector(a1, a2, a3));
63 template <
class Value>
65 template <
class Value>
67 template <
class Value>
69 template <
class Value>
71 template <
class Value>
74 template <
class TValue =
double>
77 static constexpr
const size_t stageNr = 2;
78 static constexpr
const boost::array<TValue, 1>
a1 = { { 1.0 / 2.0 } };
79 static constexpr
const boost::array<TValue, stageNr>
b = { { 0.0, 1.0 } };
80 static constexpr
const boost::array<TValue, stageNr>
c = { { 0.0, 1.0 / 2.0 } };
83 return std::move(boost::fusion::make_vector(a1));
86 template <
class Value>
88 template <
class Value>
90 template <
class Value>
93 template <
class TValue =
double>
96 static constexpr
const size_t stageNr = 1;
97 static constexpr
const boost::array<TValue, 0>
a1 = { {} };
98 static constexpr
const boost::array<TValue, stageNr>
b = { { 1.0 } };
99 static constexpr
const boost::array<TValue, stageNr>
c = { { 1.0 } };
102 return std::move(boost::fusion::make_vector());
105 template <
class Value>
107 template <
class Value>
109 template <
class Value>
112 template <
template <
class>
class MethodType,
class State,
class Value = double,
class Deriv = State,
class Time = Value,
113 class Algebra = odeint::range_algebra,
class Operations = odeint::default_operations,
114 class Resizer = odeint::initially_resizer>
116 :
public odeint::explicit_generic_rk<MethodType<Value>::stageNr, MethodType<Value>::stageNr, State, Value, Deriv,
117 Time, Algebra, Operations, Resizer>
120 using stepper_base_type = odeint::explicit_generic_rk<MethodType<Value>::stageNr, MethodType<Value>::stageNr, State,
121 Value, Deriv, Time, Algebra, Operations, Resizer>;
127 using time_type =
typename stepper_base_type::time_type;
134 :
stepper_base_type(MethodType<Value>::
a(), MethodType<Value>::
b, MethodType<Value>::
c, algebra)
142 template <
size_t HistSize,
class TRKType>
144 odeint::adams_bashforth<HistSize,
typename TRKType::state_type,
typename TRKType::value_type,
145 typename TRKType::deriv_type,
typename TRKType::time_type,
typename TRKType::algebra_type,
146 typename TRKType::operations_type,
typename TRKType::resizer_type, TRKType>;
149 #endif // DISCRETIZATION_OPTIONS_HPP typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type
typename stepper_base_type::algebra_type algebra_type
explicit_generic_rk_impl(const algebra_type &algebra=algebra_type())
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typename stepper_base_type::value_type value_type
typename stepper_base_type::wrapped_state_type wrapped_state_type
typename stepper_base_type::resizer_type resizer_type
static constexpr const boost::array< TValue, 3 > a3
static constexpr const boost::array< TValue, stageNr > b
Generic tree-like recursive structure that allows sub-structure access as well as ordered (array-like...
typename stepper_base_type::state_type state_type
typename stepper_base_type::time_type time_type
static constexpr const boost::array< TValue, 2 > a2
static constexpr const size_t stageNr
static constexpr const boost::array< TValue, stageNr > c
typename stepper_base_type::operations_type operations_type
static constexpr const boost::array< TValue, 1 > a1
typename stepper_base_type::stepper_type stepper_type
odeint::explicit_generic_rk< MethodType< Value >::stageNr, MethodType< Value >::stageNr, State, Value, Deriv, Time, Algebra, Operations, Resizer > stepper_base_type
typename stepper_base_type::deriv_type deriv_type
odeint::adams_bashforth< HistSize, typename TRKType::state_type, typename TRKType::value_type, typename TRKType::deriv_type, typename TRKType::time_type, typename TRKType::algebra_type, typename TRKType::operations_type, typename TRKType::resizer_type, TRKType > explicit_adams_bashforth