Cantera  2.0
DAE_solvers.cpp
Go to the documentation of this file.
1 /**
2  * @file DAE_solvers.cpp
3  * Factory routine for picking the DAE solver package
4  */
5 
6 /*
7  * Copyright 2004 Sandia Corporation. Under the terms of Contract
8  * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
9  * retains certain rights in this software.
10  * See file License.txt for licensing information.
11  */
12 
13 #include "cantera/base/ct_defs.h"
16 
17 // DAE_DEVEL is turned off at the current time
18 #define DAE_DEVEL
19 #ifdef DAE_DEVEL
20 
21 namespace Cantera {
22  DAE_Solver* newDAE_Solver(std::string itype, ResidJacEval& f) {
23  if (itype == "IDA") {
24 #ifdef HAS_SUNDIALS
25  return new IDA_Solver(f);
26 #else
27  throw CanteraError("newDAE_Solver","IDA solver requires sundials"
28  " package, but Cantera was not built with sundials.");
29 #endif
30  }
31  else {
32  throw CanteraError("newDAE_Solver",
33  "unknown DAE solver: "+itype);
34  }
35  }
36 }
37 
38 #
39 #endif