OGS
ODESolverBuilder.h
Go to the documentation of this file.
1 
11 #pragma once
12 
13 
14 #include "BaseLib/Error.h"
15 #include "ODESolver.h"
16 #include "ConcreteODESolver.h"
17 
18 #ifdef CVODE_FOUND
19 #include "CVodeSolver.h"
20 #endif
21 
22 namespace BaseLib
23 {
24 class ConfigTree;
25 }
26 
27 namespace MathLib
28 {
29 namespace ODE
30 {
33 
38 template <unsigned NumEquations>
39 std::unique_ptr<ODESolver<NumEquations>> createODESolver(
40  BaseLib::ConfigTree const& config)
41 {
42 #ifdef CVODE_FOUND
43  return std::unique_ptr<ODESolver<NumEquations>>(
45 #endif
46  (void)config; // Unused parameter warning if no library is available.
47 
48  OGS_FATAL(
49  "No ODE solver could be created. Maybe it is because you did not build"
50  " OGS6 with support for any external ODE solver library.");
51 }
52 
54 
55 } // namespace ODE
56 } // namespace MathLib
#define OGS_FATAL(...)
Definition: Error.h:26
std::unique_ptr< ODESolver< NumEquations > > createODESolver(BaseLib::ConfigTree const &config)