# 5.5. CVODES Constants

Below we list all input and output constants used by the main solver and linear solver modules, together with their numerical values and a short description of their meaning.

## 5.5.1. CVODES input constants

CVODES main solver module

1

CV_BDF

2

BDF linear multistep method.

CV_NORMAL

1

Solver returns at specified output time.

CV_ONE_STEP

2

Solver returns after each successful step.

CV_SIMULTANEOUS

1

Simultaneous corrector forward sensitivity method.

CV_STAGGERED

2

Staggered corrector forward sensitivity method.

CV_STAGGERED1

3

Staggered (variant) corrector forward sensitivity method.

CV_CENTERED

1

Central difference quotient approximation ($$2^{nd}$$ order) of the sensitivity RHS.

CV_FORWARD

2

Forward difference quotient approximation ($$1^{st}$$ order) of the sensitivity RHS.

CV_HERMITE

1

Use Hermite interpolation.

CV_POLYNOMIAL

2

Use variable-degree polynomial interpolation.

Iterative linear solver modules

SUN_PREC_NONE

0

No preconditioning

SUN_PREC_LEFT

1

Preconditioning on the left only.

SUN_PREC_RIGHT

2

Preconditioning on the right only.

SUN_PREC_BOTH

3

Preconditioning on both the left and the right.

SUN_MODIFIED_GS

1

Use modified Gram-Schmidt procedure.

SUN_CLASSICAL_GS

2

Use classical Gram-Schmidt procedure.

## 5.5.2. CVODES output constants

CVODES main solver module

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_WARNING

99

CVode succeeded but an unusual situation occurred.

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

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_NLS_INIT_FAIL

-13

The nonlinear solver’s init routine failed.

CV_NLS_SETUP_FAIL

-14

The nonlinear solver’s setup routine failed.

CV_CONSTR_FAIL

-15

The inequality constraints were violated and the solver was unable to recover.

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.

-24

The derivative order $$k$$ is larger than the order used.

-25

The time $$t$$ is outside the last step taken.

-26

The output derivative vector is NULL.

CV_TOO_CLOSE

-27

The output and initial times are too close to each other.

-30

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

CV_UNREC_QRHSFUNC_ERR

-34

The quadrature right-hand side function had a recoverable error, but no recovery is possible.

CV_NO_SENS

-40

Forward sensitivity integration was not activated.

CV_SRHSFUNC_FAIL

-41

The sensitivity right-hand side function failed in an unrecoverable manner.

CV_FIRST_SRHSFUNC_ERR

-42

The sensitivity right-hand side function failed at the first call.

CV_REPTD_SRHSFUNC_ERR

-43

CV_UNREC_SRHSFUNC_ERR

-44

The sensitivity right-hand side function had a recoverable error, but no recovery is possible.

-45

The sensitivity index is larger than the number of sensitivities computed.

-50

Forward sensitivity integration was not activated.

CV_QSRHSFUNC_FAIL

-51

The sensitivity right-hand side function failed in an unrecoverable manner.

CV_FIRST_QSRHSFUNC_ERR

-52

The sensitivity right-hand side function failed at the first call.

CV_REPTD_QSRHSFUNC_ERR

-53

CV_UNREC_QSRHSFUNC_ERR

-54

The sensitivity right-hand side function had a recoverable error, but no recovery is possible.

CV_CONTEXT_ERR

-55

The SUNContext object is NULL

CV_PROJ_MEM_NULL

-56

The projection memory was NULL.

CV_PROJFUNC_FAIL

-57

The projection function failed in an unrecoverable manner.

CV_REPTD_PROJFUNC_ERR

-58

The projection function had repeated recoverable errors.

-101

CV_NO_FWD

-102

The forward integration was not yet performed.

CV_NO_BCK

-103

No backward problem was specified.

-104

The final time for the adjoint problem is outside the interval over which the forward problem was solved.

CV_REIFWD_FAIL

-105

Reinitialization of the forward problem failed at the first checkpoint.

CV_FWD_FAIL

-106

An error occurred during the integration of the forward problem.

-107

Wrong time in interpolation function.

CVLS linear solver interface

CVLS_SUCCESS

0

Successful function return.

CVLS_MEM_NULL

-1

The cvode_mem argument was NULL.

CVLS_LMEM_NULL

-2

The CVLS linear solver has not been initialized.

CVLS_ILL_INPUT

-3

The CVLS solver is not compatible with the current N_Vector module, or an input value was illegal.

CVLS_MEM_FAIL

-4

A memory allocation request failed.

CVLS_PMEM_NULL

-5

The preconditioner module has not been initialized.

CVLS_JACFUNC_UNRECVR

-6

The Jacobian function failed in an unrecoverable manner.

CVLS_JACFUNC_RECVR

-7

The Jacobian function had a recoverable error.

CVLS_SUNMAT_FAIL

-8

An error occurred with the current SUNMatrix module.

CVLS_SUNLS_FAIL

-9

An error occurred with the current SUNLinearSolver module.

-101

The combined forward-backward problem has not been initialized.

CVLS_LMEMB_NULL

-102

The linear solver was not initialized for the backward phase.

CVDIAG linear solver module

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 N_Vector module.

CVDIAG_MEM_FAIL

-4

A memory allocation request failed.

CVDIAG_INV_FAIL

-5

A diagonal element of the Jacobian was 0.

CVDIAG_RHSFUNC_UNRECVR

-6

The right-hand side function failed in an unrecoverable manner.

CVDIAG_RHSFUNC_RECVR

-7

The right-hand side function had a recoverable error.