9 #ifndef CT_IDA_SOLVER_H 10 #define CT_IDA_SOLVER_H 14 #include "sundials/sundials_nvector.h" 22 #define REAL_WORKSPACE_SIZE 0 57 virtual void setTolerances(doublereal reltol, doublereal abstol);
59 virtual void setLinearSolverType(
int solverType);
71 virtual void setMaxOrder(
int n);
107 virtual void setMaxErrTestFailures(
int n);
122 virtual void inclAlgebraicInErrorTest(
bool yesno);
205 virtual int solve(doublereal tout);
207 virtual doublereal
step(doublereal tout);
209 virtual void init(doublereal t0);
211 virtual doublereal
solution(
int k)
const;
213 virtual const doublereal* solutionVector()
const;
217 virtual const doublereal* derivativeVector()
const;
238 N_Vector m_constraints;
245 doublereal m_abstols;
302 std::unique_ptr<ResidData> m_fdata;
void * m_linsol
Sundials linear solver object.
virtual void setStopTime(doublereal tstop)
Set the stop time.
Wrapper for Sundials IDA solver.
int m_maxNonlinConvFails
Maximum number of nonlinear convergence failures.
virtual void setBandedLinearSolver(int m_upper, int m_lower)
Set up the problem to use a band solver.
doublereal m_told
Value of the previous time.
int m_maxsteps
Maximum number of time steps allowed.
virtual double getCurrentStepFromIDA()
Get the current step size from IDA via a call.
virtual void setInitialStepSize(doublereal h0)
Set the initial step size.
virtual void setDenseLinearSolver()
Set up the problem to use a dense linear direct solver.
int m_maxErrTestFails
maximum number of error test failures
virtual void correctInitial_YaYp_given_Yd(doublereal *y, doublereal *yp, doublereal tout)
Calculate consistent value of the algebraic constraints and derivatives at the start of the problem...
doublereal m_tstop
maximum time
doublereal m_tcurrent
Value of the current time.
virtual void setMaxNonlinConvFailures(int n)
Set the maximum number of nonlinear solver convergence failures.
doublereal m_told_old
Value of the previous, previous time.
Wrappers for the function evaluators for Nonlinear solvers and Time steppers.
Header file for class DAE_Solver.
void * m_ida_mem
Pointer to the IDA memory for the problem.
virtual void setMaxNumSteps(int n)
Set the maximum number of time steps.
void * m_linsol_matrix
matrix used by Sundials
N_Vector m_y
Current value of the solution vector.
doublereal m_h0
Value of the initial time step.
virtual int solve(doublereal tout)
Step the system to a final value of the time.
IDA_Solver(ResidJacEval &f)
Constructor.
virtual void correctInitial_Y_given_Yp(doublereal *y, doublereal *yp, doublereal tout)
Calculate consistent value of the starting solution given the starting solution derivatives.
doublereal m_deltat
Value of deltaT for the current step.
virtual doublereal solution(int k) const
the current value of solution component k.
doublereal m_hmin
Minimum value of the timestep allowed.
virtual doublereal derivative(int k) const
the current value of the derivative of solution component k.
virtual void setMaxNonlinIterations(int n)
Set the maximum number of nonlinear iterations on a timestep.
virtual void setJacobianType(int formJac)
Set the form of the Jacobian.
virtual doublereal getOutputParameter(int flag) const
Get the value of a solver-specific output parameter.
virtual void init(doublereal t0)
initialize.
int m_maxNonlinIters
Maximum number of nonlinear solver iterations at one solution.
doublereal m_t0
Initial value of the time.
N_Vector m_ydot
Current value of the derivative of the solution vector.
virtual doublereal step(doublereal tout)
Take one internal step.
Namespace for the Cantera kernel.
doublereal m_hmax
Maximum value of the timestep allowed.
int m_maxord
maximum time step order of the method
virtual void setTolerances(doublereal reltol, doublereal *abstol)
Set error tolerances.
int m_formJac
Form of the Jacobian.
int m_setSuppressAlg
If true, the algebraic variables don't contribute to error tolerances.