8 #ifndef CT_IDA_SOLVER_H
9 #define CT_IDA_SOLVER_H
18 #if SUNDIALS_VERSION == 22
19 #include "nvector_serial.h"
21 #include "sundials/sundials_nvector.h"
30 #if SUNDIALS_VERSION >= 24
31 #define REAL_WORKSPACE_SIZE 0
40 class IDA_Err :
public CanteraError
43 IDA_Err(std::string msg) : CanteraError(
"IDA_Solver", msg) {}
49 class IDA_Solver :
public DAE_Solver
59 IDA_Solver(ResidJacEval& f);
61 virtual ~IDA_Solver();
67 virtual void setTolerances(doublereal reltol,
74 virtual void setTolerances(doublereal reltol, doublereal abstol);
76 virtual void setLinearSolverType(
int solverType);
79 virtual void setDenseLinearSolver();
86 virtual void setBandedLinearSolver(
int m_upper,
int m_lower);
88 virtual void setMaxOrder(
int n);
94 virtual void setMaxNumSteps(
int n);
100 virtual void setInitialStepSize(doublereal h0);
106 virtual void setStopTime(doublereal tstop);
112 virtual double getCurrentStepFromIDA();
123 virtual void setJacobianType(
int formJac);
126 virtual void setMaxErrTestFailures(
int n);
132 virtual void setMaxNonlinIterations(
int n);
138 virtual void setMaxNonlinConvFailures(
int n);
141 virtual void inclAlgebraicInErrorTest(
bool yesno);
146 virtual doublereal getOutputParameter(
int flag)
const;
155 virtual void correctInitial_Y_given_Yp(doublereal* y, doublereal* yp,
166 virtual void correctInitial_YaYp_given_Yd(doublereal* y, doublereal* yp, doublereal tout);
242 virtual int solve(doublereal tout);
244 virtual doublereal step(doublereal tout);
246 virtual void init(doublereal t0);
252 virtual doublereal solution(
int k)
const;
254 virtual const doublereal* solutionVector()
const;
257 virtual doublereal derivative(
int k)
const;
259 virtual const doublereal* derivativeVector()
const;
287 doublereal m_abstols;
318 doublereal m_told_old;
324 doublereal m_tcurrent;
330 int m_maxErrTestFails;
336 int m_maxNonlinIters;
339 int m_maxNonlinConvFails;
342 int m_setSuppressAlg;