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