Cantera  2.0
ODE_integrators.cpp
1 #include "cantera/base/ct_defs.h"
3 
4 
5 #ifdef HAS_SUNDIALS
6 #include "CVodesIntegrator.h"
7 #else
8 #include "CVodeInt.h"
9 #endif
10 
11 namespace Cantera
12 {
13 
14 Integrator* newIntegrator(std::string itype)
15 {
16  if (itype == "CVODE") {
17 #ifdef HAS_SUNDIALS
18  return new CVodesIntegrator();
19 #else
20  return new CVodeInt();
21 #endif
22  } else {
23  throw CanteraError("newIntegrator",
24  "unknown ODE integrator: "+itype);
25  }
26  return 0;
27 }
28 
29 void deleteIntegrator(Integrator* cv)
30 {
31  delete cv;
32 }
33 }