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 i
th implicit equation with respect to the j
th 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.
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
a
, storage for the computed linear system matrix,m
, the current mass matrix if $M \neq I$ ,jok
, indicates whether the Jacobian-related data needs to be
updated, andgamma
, the scalar in the formula above.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.
a
and m
should be accessed after the function has
returned.