9 #ifndef CT_IDA_SOLVER_H 10 #define CT_IDA_SOLVER_H 14 #include "sundials/sundials_nvector.h" 22 #define REAL_WORKSPACE_SIZE 0 70 virtual void setTolerances(doublereal reltol, doublereal abstol);
72 virtual void setLinearSolverType(
int solverType);
84 virtual void setMaxOrder(
int n);
120 virtual void setMaxErrTestFailures(
int n);
135 virtual void inclAlgebraicInErrorTest(
bool yesno);
218 virtual int solve(doublereal tout);
220 virtual doublereal
step(doublereal tout);
222 virtual void init(doublereal t0);
224 virtual doublereal
solution(
int k)
const;
226 virtual const doublereal* solutionVector()
const;
230 virtual const doublereal* derivativeVector()
const;
249 N_Vector m_constraints;
256 doublereal m_abstols;
313 std::unique_ptr<ResidData> m_fdata;
virtual void setStopTime(doublereal tstop)
Set the stop time.
A simple class to hold an array of parameter values and a pointer to an instance of a subclass of Res...
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
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
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.
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.
Base class for exceptions thrown by Cantera classes.
CanteraError()
Protected default constructor discourages throwing errors containing no information.
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.
Exception thrown when a IDA error is encountered.
int m_formJac
Form of the Jacobian.
int m_setSuppressAlg
If true, the algebraic variables don't contribute to error tolerances.