2.4.10.2. User-supplied functions

In addition to the required ARKRhsFn arguments that define the IVP, RKL and RKC methods additionally require an ARKDomEigFn function to estimate the dominant eigenvalue.

2.4.10.2.1. The dominant eigenvalue estimation

When running LSRKStep with either the RKC or RKL methods, the user must supply a dominant eigenvalue estimation function of type ARKDomEigFn:

typedef int (*ARKDomEigFn)(sunrealtype t, N_Vector y, N_Vector fn, sunrealtype *lambdaR, sunrealtype *lambdaI, void *user_data, N_Vector temp1, N_Vector temp2, N_Vector temp3);

These functions compute the dominant eigenvalue of the Jacobian of the ODE right-hand side for a given value of the independent variable \(t\) and state vector \(y\).

Param t:

the current value of the independent variable.

Param y:

the current value of the dependent variable vector.

Param fn:

the current value of the vector \(f(t,y)\).

Param lambdaR:

The real part of the dominant eigenvalue.

Param lambdaI:

The imaginary part of the dominant eigenvalue.

Param user_data:

the user_data pointer that was passed to ARKodeSetUserData().

Param tmp*:

pointers to memory allocated to variables of type N_Vector which can be used by an ARKDomEigFn as temporary storage or work space.

Return:

An ARKDomEigFn should return 0 if successful and any nonzero for a failure.