SUNDIALS constants

The SUNDIALS solvers use many named constants for communication with a user program.

CVODE

Input Constants

Name Value description
CV_ADAMS 1 Adams-Moulton linear multistep method
CV_BDF 2 BDF linear multistep method
CV_FUNCTIONAL 1 Nonlinear system solution through functional iterations
CV_NEWTON 2 Nonlinear system solution through Newton iterations
CV_SS 1 Scalar relative tolerance, scalar absolute tolerance
CV_SV 2 Scalar relative tolerance, vector absolute tolerance
CV_EE 2 Estimated relative tolerance and absolute tolerance for sensitivity variables
CV_NORMAL 1 Solver returns at specified output time
CV_ONE STEP 2 Solver returns after each successful step
CV_NORMAL_TSTOP 3 Solver returns at specified output time, but does not proceed past the specified stopping time
CV_ONE STEP_TSTOP 4 Solver returns after each successful step, but does not proceed past the specified stopping time

Output Constants

Name Value description
Main integrator
CV_SUCCESS 0 Successful function return
CV_TSTOP_RETURN 1 CVode succeeded by reaching the specified stopping point
CV_ROOT_RETURN 2 CVode succeeded and found one or more roots
CV_TOO_MUCH_WORK -1 The solver took mxstep internal steps but could not reach tout
CV_TOO_MUCH_ACC -2 The solver could not satisfy the accuracy demanded by the user for some internal step
CV_ERR_FAILURE -3 Error test failures occurred too many times during one internal time step or minimum step size was reached
CV_CONV_FAILURE -4 Convergence test failures occurred too many times during one internal time step or minimum step size was reached
CV_LINIT_FAIL -5 The linear solver's initialization function failed
CV_LSETUP_FAIL -6 The linear solver's setup function failed in an unrecoverable manner
CV_LSOLVE_FAIL -7 The linear solver's solve function failed in an unrecoverable manner
CV_RHSFUNC_FAIL -8 The right-hand side function failed in an unrecoverable manner
CV_FIRST_RHSFUNC_ERR -9 The right-hand side function failed at the first call
CV_REPTD_RHSFUNC_ERR -10 The right-hand side function had repetead recoverable errors
CV_UNREC_RHSFUNC_ERR -11 The right-hand side function had a recoverable error, but no recovery is possible
CV_RTFUNC_FAIL -12 The rootfinding function failed in an unrecoverable manner
CV_MEM_FAIL -20 A memory allocation failed
CV_MEM_NULL -21 The cvode_mem argument was NULL
CV_ILL_INPUT -22 One of the function inputs is illegal
CV_NO_MALLOC -23 The CVODE memory block was not allocated by a call to CVodeMalloc
CV_BAD_K -24 The derivative order k is larger than the order used
CV_BAD_T -25 The time t s outside the last step taken
CV_BAD_DKY -26 The output derivative vector is NULL
CV_TOO_CLOSE -27 The output and initial times are too close to each other
Dense linear solver interface module (CVDENSE)
CVDENSE_SUCCESS 0 Successful function return
CVDENSE_MEM_NULL -1 The cvode_mem argument was NULL
CVDENSE_LMEM_NULL -2 The CVDENSE linear solver has not been initialized
CVDENSE_ILL_INPUT -3 The CVDENSE solver is not compatible with the current NVECTOR module
CVDENSE_MEM_FAIL -4 A memory allocation request failed
CVDENSE_JACFUNC_UNRECVR -5 The Jacobian function failed in an unrecoverable manner
CVDENSE_JACFUNC_RECVR -6 The Jacobian function had a recoverable error
Band linear solver interface module (CVBAND)
CVBAND_SUCCESS 0 Successful function return
CVBAND_MEM_NULL -1 The cvode_mem argument was NULL
CVBAND_LMEM_NULL -2 The CVBAND linear solver has not been initialized
CVBAND_ILL_INPUT -3 The CVBAND solver is not compatible with the current NVECTOR module, or an input value was illegal
CVBAND_MEM_FAIL -4 A memory allocation request failed
CVBAND_JACFUNC_UNRECVR -5 The Jacobian function failed in an unrecoverable manner
CVBAND_JACFUNC_RECVR -6 The Jacobian function had a recoverable error
Diagonal linear solver interface module (CVDIAG)
CVDIAG_SUCCESS 0 Successful function return
CVDIAG_MEM_NULL -1 The cvode_mem argument was NULL
CVDIAG_LMEM_NULL -2 The CVDIAG linear solver has not been initialized
CVDIAG_ILL_INPUT -3 The CVDIAG solver is not compatible with the current NVECTOR module
Scaled preconditioned linear solver interface module (CVSPILS)
CVSPILS_SUCCESS 0 Successful function return
CVSPILS_MEM_NULL -1 The cvode_mem argument was NULL
CVSPILS_LMEM_NULL -2 The linear solver has not been initialized
CVSPILS_ILL_INPUT -3 The solver is not compatible with the current NVECTOR module, or an input value was illegal
CVSPILS_MEM_FAIL -4 A memory allocation request failed
Band preconditioner module (CVBANDPRE)
CVBANDPRE_SUCCESS 0 Successful function return
CVBANDPRE_PDATA_NULL -11 The preconditioner module has not been initialized
CVBANDPRE_RHSFUNC_UNRECVR -12 The right-hand side function failed unrecoverably
Band block diagonal preconditioner module (CVBBDPRE)
CVBBDPRE_SUCCESS 0 Successful function return
CVBBDPRE_PDATA_NULL -11 The preconditioner module has not been initialized
CVBBDPRE_FUNC_UNRECVR -12 A user supplied function failed unrecoverably

CVODES

Input Constants

Name Value description
CV_ADAMS 1 Adams-Moulton linear multistep method
CV_BDF 2 BDF linear multistep method
CV_FUNCTIONAL 1 Nonlinear system solution through functional iterations
CV_NEWTON 2 Nonlinear system solution through Newton iterations
CV_SS 1 Scalar relative tolerance, scalar absolute tolerance
CV_SV 2 Scalar relative tolerance, vector absolute tolerance
CV_EE 2 Estimated relative tolerance and absolute tolerance for sensitivity variables
CV_NORMAL 1 Solver returns at specified output time
CV_ONE STEP 2 Solver returns after each successful step
CV_NORMAL_TSTOP 3 Solver returns at specified output time, but does not proceed past the specified stopping time
CV_ONE STEP_TSTOP 4 Solver returns after each successful step, but does not proceed past the specified stopping time
CV_SIMULTANEOUS 1 Simultaneous corrector forward sensitivity method
CV_STAGGERED 2 Staggered corrector forward sensitivity method
CV_STAGGERED_1 3 Staggered (variant) corrector forward sensitivity method
CV_CENTERED 1 Central difference quotient approximation (2nd order) of the sensitivity RHS
CV_FORWARD 2 Forward difference quotient approximation (1st order) of the sensitivity RHS
CV_HERMITE 1 Use cubic Hermite interpolation
CV_POLYNOMIAL 2 Use variable-degree polynomial interpolation

Output Constants

Name Value Description
Main integrator
CV_SUCCESS 0 Successful function return
CV_TSTOP_RETURN 1 CVode succeeded by reaching the specified stopping point
CV_ROOT_RETURN 2 CVode succeeded and found one or more roots
CV_TOO_MUCH_WORK -1 The solver took mxstep internal steps but could not reach tout
CV_TOO_MUCH_ACC -2 The solver could not satisfy the accuracy demanded by the user for some internal step
CV_ERR_FAILURE -3 Error test failures occurred too many times during one internal time step or minimum step size was reached
CV_CONV_FAILURE -4 Convergence test failures occurred too many times during one internal time step or minimum step size was reached
CV_LINIT_FAIL -5 The linear solver's initialization function failed
CV_LSETUP_FAIL -6 The linear solver's setup function failed in an unrecoverable manner
CV_LSOLVE_FAIL -7 The linear solver's solve function failed in an unrecoverable manner
CV_RHSFUNC_FAIL -8 The right-hand side function failed in an unrecoverable manner
CV_FIRST_RHSFUNC_ERR -9 The right-hand side function failed at the first call
CV_REPTD_RHSFUNC_ERR -10 The right-hand side function had repetead recoverable errors
CV_UNREC_RHSFUNC_ERR -11 The right-hand side function had a recoverable error, but no recovery is possible
CV_RTFUNC_FAIL -12 The rootfinding function failed in an unrecoverable manner
CV_MEM_FAIL -20 A memory allocation failed
CV_MEM_NULL -21 The cvode_mem argument was NULL
CV_ILL_INPUT -22 One of the function inputs is illegal
CV_NO_MALLOC -23 The CVODE memory block was not allocated by a call to CVodeMalloc
CV_BAD_K -24 The derivative order k is larger than the order used
CV_BAD_T -25 The time t s outside the last step taken
CV_BAD_DKY -26 The output derivative vector is NULL
CV_TOO_CLOSE -27 The output and initial times are too close to each other
CV_NO_QUAD -30 Quadrature integration was not activated
CV_QRHSFUNC_FAIL -31 The quadrature right-hand side function failed in an unrecoverable manner
CV_FIRST_QRHSFUNC_ERR -32 The quadrature right-hand side function failed at the first call
CV_REPTD_QRHSFUNC_ERR -33 The quadrature ight-hand side function had repetead recoverable errors
CV_UNREC_QRHSFUNC_ERR -34 The quadrature right-hand side function had a recoverable error, but no recovery is possible
CV_BAD_IS -40 The sensitivity index is larger than the number of sensitivities computed
CV_NO_SENS -41 Forward sensitivity integration was not activated
CV_SRHSFUNC_FAIL -42 The sensitivity right-hand side function failed in an unrecoverable manner
CV_FIRST_SRHSFUNC_ERR -43 The sensitivity right-hand side function failed at the first call
CV_REPTD_SRHSFUNC_ERR -44 The sensitivity ight-hand side function had repetead recoverable errors
CV_UNREC_SRHSFUNC_ERR -45 The sensitivity right-hand side function had a recoverable error, but no recovery is possible
Adjoint solver module
CV_ADJMEM_NULL -101 The cvadj_mem argument was NULL
CV_BAD_TB0 -103 The final time for the adjoint problem is outside the interval over which the forward problem was solved
CV_BCKMEM_NULL -104 The cvodes memory for the backward problem was not created
CV_REIFWD_FAIL -105 Reinitialization of the forward problem failed at the first checkpoint
CV_FWD_FAIL -106 An error occured during the integration of the forward problem
CV_BAD_ITASK -107 Wrong task for backward integration
CV_BAD_TBOUT -108 The desired output time is outside the interval over which the forward problem was solved
CV_GETY_BADT -109 Wrong time in interpolation function
Dense linear solver interface module (CVDENSE)
CVDENSE_SUCCESS 0 Successful function return
CVDENSE_MEM_NULL -1 The cvode_mem argument was NULL
CVDENSE_LMEM_NULL -2 The CVDENSE linear solver has not been initialized
CVDENSE_ILL_INPUT -3 The CVDENSE solver is not compatible with the current NVECTOR module
CVDENSE_MEM_FAIL -4 A memory allocation request failed
CVDENSE_JACFUNC_UNRECVR -5 The Jacobian function failed in an unrecoverable manner
CVDENSE_JACFUNC_RECVR -6 The Jacobian function had a recoverable error
CVDENSE_ADJMEM_NULL -101 The cvadj_mem argument was NULL
CVDENSE_LMEMB_NULL -102 The CVDENSE linear solver has not been initialized for the backward integration
Band linear solver interface module (CVBAND)
CVBAND_SUCCESS 0 Successful function return
CVBAND_MEM_NULL -1 The cvode_mem argument was NULL
CVBAND_LMEM_NULL -2 The CVBAND linear solver has not been initialized
CVBAND_ILL_INPUT -3 The CVBAND solver is not compatible with the current NVECTOR module, or an input value was illegal
CVBAND_MEM_FAIL -4 A memory allocation request failed
CVBAND_JACFUNC_UNRECVR -5 The Jacobian function failed in an unrecoverable manner
CVBAND_JACFUNC_RECVR -6 The Jacobian function had a recoverable error
CVBAND_ADJMEM_NULL -101 The cvadj_mem argument was NULL
CVBAND_LMEMB_NULL -102 The CVBAND linear solver has not been initialized for the backward integration
Diagonal linear solver interface module (CVDIAG)
CVDIAG_SUCCESS 0 Successful function return
CVDIAG_MEM_NULL -1 The cvode_mem argument was NULL
CVDIAG_LMEM_NULL -2 The CVDIAG linear solver has not been initialized
CVDIAG_ILL_INPUT -3 The CVDIAG solver is not compatible with the current NVECTOR module
CVDIAG_MEM_FAIL -4 A memory allocation request failed
CVDIAG_ADJMEM_NULL -101 The cvadj_mem argument was NULL
Scaled preconditioned linear solver interface module (CVSPILS)
CVSPILS_SUCCESS 0 Successful function return
CVSPILS_MEM_NULL -1 The cvode_mem argument was NULL
CVSPILS_LMEM_NULL -2 The linear solver has not been initialized
CVSPILS_ILL_INPUT -3 The solver is not compatible with the current NVECTOR module, or an input value was illegal
CVSPILS_MEM_FAIL -4 A memory allocation request failed
CVSPILS_ADJMEM_NULL -101 The cvadj_mem argument was NULL
CVSPILS_LMEMB_NULL -102 The linear solver has not been initialized for the backward integration
Band preconditioner module (CVBANDPRE)
CVBANDPRE_SUCCESS 0 Successful function return
CVBANDPRE_PDATA_NULL -11 The preconditioner module has not been initialized
CVBANDPRE_RHSFUNC_UNRECVR -12 The right-hand side function failed unrecoverably
CVBANDPRE_ADJMEM_NULL -111 The cvadj_mem argument was NULL
CVBANDPRE_MEM_FAIL -112 A memory allocation failed
Band block diagonal preconditioner module (CVBBDPRE)
CVBBDPRE_SUCCESS 0 Successful function return
CVBBDPRE_PDATA_NULL -11 The preconditioner module has not been initialized
CVBBDPRE_FUNC_UNRECVR -12 A user supplied function failed unrecoverably
CVBBDPRE_ADJMEM_NULL -111 The cvadj_mem argument was NULL
CVBBDPRE_PDATAB_NULL -112 The CVBBDPRE preconditionr module has not been initialized for the backward integration
CVBBDPRE_MEM_FAIL -113 A memory allocation failed

IDA

Input Constants

Name Value description
IDA_SS 1 Scalar relative tolerance, scalar absolute tolerance
IDA_SV 2 Scalar relative tolerance, vector absolute tolerance
IDA_NORMAL 1 Solver returns at specified output time
IDA_ONE_STEP 2 Solver returns after each successful step
IDA_NORMAL_TSTOP 3 Solver returns at specified output time, but does not proceed past the specified stopping time
IDA_ONE_STEP_TSTOP 4 Solver returns after each successful step, but does not proceed past the specified stopping time
IDA_YA_YDP_INIT 1 Compute y_a and y^\prime_d, given y_d
IDA_Y_INIT 2 Compute y, given y^\prime

Output Constants

Name Value Description
Main integrator
IDA_SUCCESS 0 Successful function return
IDA_TSTOP_RETURN 1 IDASolve succeeded by reaching the specified stopping point
IDA_ROOT_RETURN 2 IDASolve succeeded and found one or more roots
IDA_MEM_NULL -1 The solver memory argument was NULL
IDA_ILL_INPUT -2 One of the function inputs is illegal
IDA_NO_MALLOC -3 The solver memory was not allocated by a call to IDAMalloc
IDA_TOO_MUCH_WORK -4 The solver took mxstep internal steps but could not reach tout
IDA_TOO_MUCH_ACC -5 The solver could not satisfy the accuracy demanded by the user for some internal step
IDA_ERR_FAIL -6 Error test failures occurred too many times during one internal time step or minimum step size was reached
IDA_CONV_FAIL -7 Convergence test failures occurred too many times during one internal time step or minimum step size was reached
IDA_LINIT_FAIL -8 The linear solver's initialization function failed
IDA_LSETUP_FAIL -9 The linear solver's setup function failed in an unrecoverable manner
IDA_LSOLVE_FAIL -10 The linear solver's solve function failed in an unrecoverable manner
IDA_RES_FAIL -11 The user-provided residual function failed in an unrecoverable manner
IDA_CONSTR_FAIL -12 The inequality constraints were violated and the solver was unable to recover
IDA_REP_RES_FAIL -13 The user-provided residual function repeatedly returned a recoverable error flag, but the solver was unable to recover
IDA_MEM_FAIL -14 A memory allocation failed
IDA_BAD_T -15 The time t is outside the last step taken
IDA_BAD_EWT -16 Zero value of some error weight component
IDA_FIRST_RES_FAIL -17 The user-provided residual function failed recoverably on the first call
IDA_LINESEARCH_FAIL -18 The line search failed
IDA_NO_RECOVERY -19 The residual function, linear solver setup function, or linear solver solve function had a recoverable failure, but IDACalcIC could not recover
IDA_RTFUNC_FAIL -20 The rootfinding function failed in an unrecoverable manner
Dense linear solver interface module (IDADENSE)
IDADENSE_SUCCESS 0 Successful function return
IDADENSE_MEM_NULL -1 The solver memory argument was NULL
IDADENSE_LMEM_NULL -2 The IDADENSE linear solver has not been initialized
IDADENSE_ILL_INPUT -3 The IDADENSE solver is not compatible with the current NVECTOR module
IDADENSE_MEM_FAIL -4 A memory allocation request failed
IDADENSE_JACFUNC_UNRECVR -5 The Jacobian function failed in an unrecoverable manner
IDADENSE_JACFUNC_RECVR -6 The Jacobian function had a recoverable error
Band linear solver interface module (IDABAND)
IDABAND_SUCCESS 0 Successful function return
IDABAND_MEM_NULL -1 The solver memory argument was NULL
IDABAND_LMEM_NULL -2 The IDABAND linear solver has not been initialized
IDABAND_ILL_INPUT -3 The IDABAND solver is not compatible with the current NVECTOR module
IDABAND_MEM_FAIL -4 A memory allocation request failed
IDABAND_JACFUNC_UNRECVR -5 The Jacobian function failed in an unrecoverable manner
IDABAND_JACFUNC_RECVR -6 The Jacobian function had a recoverable error
Scaled preconditioned linear solver interface module (IDASPILS)
IDASPILS_SUCCESS 0 Successful function return
IDASPILS_MEM_NULL -1 The solver memory argument was NULL
IDASPILS_LMEM_NULL -2 The linear solver has not been initialized
IDASPILS_ILL_INPUT -3 The solver is not compatible with the current NVECTOR module
IDASPILS_MEM_FAIL -4 A memory allocation request failed
Band block diagonal preconditioner module (IDABBDPRE)
IDABBDPRE_SUCCESS 0 Successful function return
IDABBDPRE_PDATA_NULL -11 The preconditioner module has not been initialized
IDABBDPRE_FUNC_UNRECVR -12 A user supplied function failed unrecoverably

KINSOL

Input Constants

Name Value description
KIN_ETACHOICE1 1 Use Eisenstat and Walker Choice 1 for $\eta$
KIN_ETACHOICE2 2 Use Eisenstat and Walker Choice 2 for $\eta$
KIN_ETACONSTANT 3 Use constant value for $\eta$
KIN_NONE 0 Use inexact Newton globalization
KIN_LINESEARCH 1 Use line search globalization

Output Constants

Name Value Description
Main solver
KIN_SUCCESS 0 Successful function return
KIN_INITIAL_GUESS_OK 1 The initial user-supplied guess already satisfies the stopping criterion
KIN_STEP_LT_STPTOL 2 The stopping tolerance on scaled step length was satisfied
KIN_MEM_NULL -1 The kin_mem argument was NULL
KIN_ILL_INPUT -2 One of the function inputs is illegal
KIN_NO_MALLOC -3 The kinsol memory was not allocated by a call to KINMalloc
KIN_MEM_FAIL -4 A memory allocation failed
KIN_LINESEARCH_NONCONV -5 The line search algorithm was unable to find an iterate sufficiently distinct from the current iterate
KIN_MAXITER_REACHED -6 The maximum number of nonlinear iterations has been reached
KIN_MXNEWT_5X_EXCEEDED -7 Five consecutive steps have been taken that satisfy a scaled step length test
KIN_LINESEARCH_BCFAIL -8 The line search algorithm was unable to satisfy the $\beta$-condition for nbcfails iterations
KIN_LINSOLV_NO_RECOVERY -9 The user-supplied routine preconditioner slve function failed recoverably, but the preconditioner is already current
KIN_LINIT_FAIL -10 The linear solver's initialization function failed
KIN_LSETUP_FAIL -11 The linear solver's setup function failed in an unrecoverable manner
KIN_LSOLVE_FAIL -12 The linear solver's solve function failed in an unrecoverable manner
KIN_SYSFUNC_FAIL -13 The system function failed in an unrecoverable manner
KIN_FIRST_SYSFUNC_ERR -14 The system function failed recoverably at the first call
KIN_REPTD_SYSFUNC_ERR -15 The system function had repeated recoverable errors
Dense linear solver interface module (KINDENSE)
KINDENSE_SUCCESS 0 Successful function return
KINDENSE_MEM_NULL -1 The kin_mem argument was NULL
KINDENSE_LMEM_NULL -2 The kindense linear solver has not been initialized
KINDENSE_ILL_INPUT -3 The kindense solver is not compatible with the current nvector module
KINDENSE_MEM_FAIL -4 A memory allocation request failed
Band linear solver interface module (KINBAND)
KINBAND_SUCCESS 0 Successful function return
KINBAND_MEM_NULL -1 The kin_mem argument was NULL
KINBAND_LMEM_NULL -2 The kinband linear solver has not been initialized
KINBAND_ILL_INPUT -3 The kinband solver is not compatible with the current nvector module, or an input value was illegal
KINBAND_MEM_FAIL -4 A memory allocation request failed
Scaled preconditioned linear solver interface module (KINSPILS)
KINSPILS_SUCCESS 0 Successful function return
KINSPILS_MEM_NULL -1 The kin_mem argument was NULL
KINSPILS_LMEM_NULL -2 The linear solver has not been initialized
KINSPILS_ILL_INPUT -3 The solver is not compatible with the current nvector module, or an input value was illegal
KINSPILS_MEM_FAIL -4 A memory allocation request failed
Band block diagonal preconditioner module (KINBBDPRE)
KINBBDPRE_SUCCESS 0 Successful function return
KINBBDPRE_PDATA_NULL -11 The preconditioner module has not been initialized

Shared Modules

Iterative linear solvers

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.