Protected against sundials not being compiled in
This commit is contained in:
parent
c58697dbd3
commit
cf730962a6
3 changed files with 9 additions and 2 deletions
|
|
@ -12,12 +12,12 @@
|
|||
|
||||
namespace Cantera {
|
||||
|
||||
DAE_Solver* newDAE_Solver(string itype, ResidJacEval& f) {
|
||||
DAE_Solver* newDAE_Solver(std::string itype, ResidJacEval& f) {
|
||||
if (itype == "IDA") {
|
||||
#ifdef HAS_SUNDIALS
|
||||
return new IDA_Solver(f);
|
||||
#else
|
||||
raise CanteraError("newDAE_Solver","IDA solver requires sundials"
|
||||
throw CanteraError("newDAE_Solver","IDA solver requires sundials"
|
||||
" package, but Cantera was not built with sundials.");
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include <iostream>
|
||||
|
||||
#ifdef HAS_SUNDIALS
|
||||
|
||||
#ifdef SUNDIALS_VERSION_22
|
||||
#include <sundials_types.h>
|
||||
#include <sundials_math.h>
|
||||
|
|
@ -30,6 +32,8 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
inline static N_Vector nv(void* x) {
|
||||
return reinterpret_cast<N_Vector>(x);
|
||||
}
|
||||
|
|
@ -645,3 +649,4 @@ namespace Cantera {
|
|||
//====================================================================================================================
|
||||
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#include "DAE_Solver.h"
|
||||
#include "ctexceptions.h"
|
||||
|
||||
#ifdef HAS_SUNDIALS
|
||||
|
||||
#ifdef SUNDIALS_VERSION_22
|
||||
#include <nvector_serial.h>
|
||||
|
|
@ -353,4 +354,5 @@ namespace Cantera {
|
|||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue