VPTissue Reference Manual
OdeintFactories0Map.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2016 Universiteit Antwerpen
3  *
4  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
5  * the European Commission - subsequent versions of the EUPL (the "Licence");
6  * You may not use this work except in compliance with the Licence.
7  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the Licence is distributed on an "AS IS" basis,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the Licence for the specific language governing
13  * permissions and limitations under the Licence.
14  */
20 #include "OdeintFactories0Map.h"
21 
22 #include <boost/functional/value_factory.hpp>
23 #include <boost/numeric/odeint.hpp>
24 
25 using namespace std;
26 using namespace boost::numeric::odeint;
27 using boost::value_factory;
28 
29 namespace {
30 
34 template<typename System, typename State, typename Stepper>
35 class Solver0
36 {
37 public:
38  void operator()(System system, State& start_state,
39  double start_time, double end_time, double dt)
40  {
41  Stepper stepper;
42  integrate_const(stepper,
43  system, start_state, start_time, end_time, dt);
44  }
45 };
46 
47 } // namespace
48 
49 
50 namespace SimPT_Sim {
51 
52 OdeintFactories0Map::OdeintFactories0Map()
53 : MapType({
54 
55  // the constant stepsize integrators
56  make_pair("adams_bashforth",
57  value_factory<Solver0<System, State, adams_bashforth<5, State>>>()),
58  make_pair("bulirsch_stoer",
59  value_factory<Solver0<System, State, bulirsch_stoer<State>>>()),
60  make_pair("euler",
61  value_factory<Solver0<System, State, euler<State>>>()),
62  make_pair("modified_midpoint",
63  value_factory<Solver0<System, State, modified_midpoint<State>>>()),
64  make_pair("runge_kutta4",
65  value_factory<Solver0<System, State, runge_kutta4<State>>>()),
66 })
67 {}
68 
69 } // namespace
STL namespace.
Interface for OdeintFactories0Map.
Namespace for the core simulator.