VPTissue Reference Manual
OdeintFactory2.h
Go to the documentation of this file.
1 #ifndef ODEINT_FACTORY2_H_INCLUDED
2 #define ODEINT_FACTORY2_H_INCLUDED
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
22 #include "OdeintFactories2Map.h"
23 #include "OdeintTraits.h"
24 
25 #include <list>
26 #include <string>
27 #include <vector>
28 
29 namespace SimPT_Sim {
30 
35 {
36 public:
37  using State = OdeintTraits<>::State;
38  using System = OdeintTraits<State>::System;
39  using Solver = OdeintTraits<State>::Solver;
40 
41 public:
42  Solver Create(const std::string& name, double eps_abs, double eps_rel)
43  {
44  return m_f2_map.Get(name)(eps_abs, eps_rel);
45  }
46 
50  bool ProvidesSolver(const std::string& name) const
51  {
52  return m_f2_map.IsValid(name);
53  }
54 
55  std::list<std::string> List() const
56  {
57  return m_f2_map.List();
58  }
59 
60 private:
61  OdeintFactories2Map m_f2_map;
62 };
63 
64 } // VLEaf2_Sim
65 
66 #endif // end_of_include_guard
Produces factory function for odeint integrator algorithm.
Odeint traits header file.
Namespace for the core simulator.
bool IsValid(const std::string &name) const
Check whether function name is present.
Definition: FunctionMap.h:63
Interface for OdeintFactories2Map.
std::list< std::string > List() const
List the names.
Definition: FunctionMap.h:80
FunctionType Get(const std::string &name) const
Return function for given name.
Definition: FunctionMap.h:57
bool ProvidesSolver(const std::string &name) const
Returns true iff this factory can provide the requested solver.