Module Arkode.Dls

module Dls: sig .. end

Common definitions for Direct Linear Solvers operating on dense, banded, and sparse matrices.


type 'm jac_fn = (Sundials.RealArray.t Arkode.Common.triple, Sundials.RealArray.t)
Arkode.Common.jacobian_arg -> 'm -> unit

Callback functions that compute dense approximations to a Jacobian matrix. In the call jac arg jm, arg is a Arkode.Common.jacobian_arg with three work vectors and the computed Jacobian must be stored in jm.

The callback should load the (i,j)th entry of jm with $\partial (f_I)_i/\partial y_j$, i.e., the partial derivative of the ith implicit equation with respect to the jth variable, evaluated at the values of t and y obtained from arg. Only nonzero elements need be loaded into jm.

Raising Sundials.RecoverableFailure indicates a recoverable error. Any other exception is treated as an unrecoverable error.

Neither the elements of arg nor the matrix jm should be accessed after the function has returned.

type 'm linsys_fn = (Sundials.RealArray.t Arkode.Common.triple, Sundials.RealArray.t)
Arkode.Common.jacobian_arg -> 'm -> 'm option -> bool -> float -> bool

Function to compute the linear system matrix $A = M - \gamma J$ or an approximation of it. Offers an alternative to evaluating the Jacobian of the right-hand-side function.

In addition to those shared with the Jacobian function, the arguments of this function are

The function should return true only if the Jacobian data was recomputed.

Raising Sundials.RecoverableFailure indicates a recoverable error. Any other exception is treated as an unrecoverable error.

Neither the Jacobian argument elements nor the matrices a and m should be accessed after the function has returned.