diff --git a/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst index c5669a6880..4a8da0e5a5 100644 --- a/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst @@ -21,10 +21,19 @@ This section describes the ARKStep-specific functions that may be called by the user to setup and then solve an IVP using the ARKStep time-stepping module. The large majority of these routines merely wrap :ref:`underlying ARKODE functions `, and will be deprecated in an -upcoming release -- each of these are clearly marked below. However, some -of these user-callable functions are specific to ARKStep, and are explained +upcoming release -- each of these are clearly marked. However, some +of these user-callable functions are specific to ARKStep, as explained below. +As discussed in the main :ref:`ARKODE user-callable function introduction +`, each of ARKODE's time-stepping modules +clarifies the categories of user-callable functions that it supports. +ARKStep supports *all categories*: + +* temporal adaptivity +* implicit nonlinear and/or linear solvers +* non-identity mass matrices +* relaxation Runge--Kutta methods .. _ARKODE.Usage.ARKStep.Initialization: diff --git a/doc/arkode/guide/source/Usage/ERKStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/ERKStep_c_interface/User_callable.rst index a0728f1ada..c60c511373 100644 --- a/doc/arkode/guide/source/Usage/ERKStep_c_interface/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ERKStep_c_interface/User_callable.rst @@ -21,10 +21,18 @@ This section describes the ERKStep-specific functions that may be called by the user to setup and then solve an IVP using the ERKStep time-stepping module. The large majority of these routines merely wrap :ref:`underlying ARKODE functions `, and will be deprecated in an -upcoming release -- each of these are clearly marked below. However, some -of these user-callable functions are specific to ERKStep, and are explained +upcoming release -- each of these are clearly marked. However, some +of these user-callable functions are specific to ERKStep, as explained below. +As discussed in the main :ref:`ARKODE user-callable function introduction +`, each of ARKODE's time-stepping modules +clarifies the categories of user-callable functions that it supports. +ERKStep supports the following categories: + +* temporal adaptivity +* relaxation Runge--Kutta methods + .. _ARKODE.Usage.ERKStep.Initialization: diff --git a/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst index 58ceaa1bf9..230eb30113 100644 --- a/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst +++ b/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst @@ -22,10 +22,17 @@ This section describes the MRIStep-specific functions that may be called by the user to setup and then solve an IVP using the MRIStep time-stepping module. The large majority of these routines merely wrap :ref:`underlying ARKODE functions `, and will be deprecated in an -upcoming release -- each of these are clearly marked below. However, some -of these user-callable functions are specific to MRIStep, and are explained +upcoming release -- each of these are clearly marked. However, some +of these user-callable functions are specific to ERKStep, as explained below. +As discussed in the main :ref:`ARKODE user-callable function introduction +`, each of ARKODE's time-stepping modules +clarifies the categories of user-callable functions that it supports. +MRIStep supports the following categories: + +* implicit nonlinear and/or linear solvers + .. _ARKODE.Usage.MRIStep.Initialization: diff --git a/doc/arkode/guide/source/Usage/SPRKStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/SPRKStep_c_interface/User_callable.rst index 35180cb6da..eef8e78ef4 100644 --- a/doc/arkode/guide/source/Usage/SPRKStep_c_interface/User_callable.rst +++ b/doc/arkode/guide/source/Usage/SPRKStep_c_interface/User_callable.rst @@ -19,10 +19,17 @@ This section describes the SPRKStep-specific functions that may be called by the user to setup and then solve an IVP using the SPRKStep time-stepping module. The large majority of these routines merely wrap :ref:`underlying ARKODE functions `, and will be deprecated in an -upcoming release -- each of these are clearly marked below. However, some -of these user-callable functions are specific to SPRKStep, and are explained +upcoming release -- each of these are clearly marked. However, some +of these user-callable functions are specific to ERKStep, as explained below. +As discussed in the main :ref:`ARKODE user-callable function introduction +`, each of ARKODE's time-stepping modules +clarifies the categories of user-callable functions that it supports. +SPRKStep supports only the basic set of user-callable functions, and +does not support any of the restricted groups (time adaptivity, implicit +solvers, etc.). + .. _ARKODE.Usage.SPRKStep.Initialization: diff --git a/doc/arkode/guide/source/Usage/User_callable.rst b/doc/arkode/guide/source/Usage/User_callable.rst index 41bd723bf9..6f4a4f2c49 100644 --- a/doc/arkode/guide/source/Usage/User_callable.rst +++ b/doc/arkode/guide/source/Usage/User_callable.rst @@ -31,6 +31,22 @@ to the error handler, which prints the message to ``stderr`` by default. However, the user can set a file as error output or can provide their own error handler (see :numref:`SUNDIALS.Errors` for details). +We note that depending on the choice of time-stepping module, only a +subset of ARKODE's user-callable functions will be applicable/supported. +We thus categorize the functions below into five groups: + +A. functions that apply for all time-stepping modules, + +B. functions that apply for time-stepping modules that allow temporal adaptivity, + +C. functions that apply for time-stepping modules that utilize implicit solvers (nonlinear or linear), + +D. functions that apply for time-stepping modules that support non-identity mass matrices, and + +E. functions that apply for time-stepping modules that support relaxation Runge--Kutta methods. + +In the function descriptions below, we identify those that have any of the restrictions B-E above. Then in the introduction for each of the stepper-specific documentation sections (:numref:`ARKODE.Usage.ARKStep.UserCallable`, :numref:`ARKODE.Usage.ERKStep.UserCallable`, :numref:`ARKODE.Usage.MRIStep.UserCallable`, and :numref:`ARKODE.Usage.SPRKStep.UserCallable`) we clarify the categories of these functions that are supported. + .. _ARKODE.Usage.Tolerances: @@ -417,6 +433,8 @@ pertinent to their choice of linear solver. .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + If *LS* is a matrix-free linear solver, then the *J* argument should be ``NULL``. @@ -526,6 +544,8 @@ Newton and mass matrix systems, these must have the same type: .. note:: + This is only compatible with time-stepping modules that support non-identity mass matrices. + If *LS* is a matrix-free linear solver, then the *M* argument should be ``NULL``. @@ -597,6 +617,8 @@ function attaches the nonlinear solver to the main ARKODE integrator. .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + ARKODE will use the Newton ``SUNNonlinearSolver`` module by default; a call to this routine replaces that module with the supplied *NLS* object. @@ -877,6 +899,7 @@ Use compensated summation :c:func:`ARKodeSetUseCompensat :retval ARK_SUCCESS: the function exited successfully. :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: this option is not supported by the time-stepping module. .. note:: @@ -979,7 +1002,8 @@ Use compensated summation :c:func:`ARKodeSetUseCompensat .. note:: - Pass 0.0 to return ARKODE to the default (adaptive-step) mode. + Pass 0.0 to return ARKODE to the default (adaptive-step) mode -- this is only + allowed when using a time-stepping module that supports temporal adaptivity. Use of this function is not generally recommended, since it gives no assurance of the validity of the computed solutions. It is @@ -1035,7 +1059,8 @@ Use compensated summation :c:func:`ARKodeSetUseCompensat .. note:: - Pass 0.0 to use the default value. + Pass 0.0 to use the default value -- this is only + allowed when using a time-stepping module that supports temporal adaptivity. By default, ARKODE estimates the initial step size to be :math:`h = \sqrt{\dfrac{2}{\left\| \ddot{y}\right\|}}`, where @@ -1065,6 +1090,8 @@ Use compensated summation :c:func:`ARKodeSetUseCompensat .. note:: + This is only compatible with time-stepping modules that support temporal adaptivity. + The default value is 10; set *mxhnil* to zero to specify this default. @@ -1112,6 +1139,8 @@ Use compensated summation :c:func:`ARKodeSetUseCompensat .. note:: + This is only compatible with time-stepping modules that support temporal adaptivity. + Pass *hmax* :math:`\le 0.0` to set the default value of :math:`\infty`. .. versionadded:: x.y.z @@ -1132,6 +1161,8 @@ Use compensated summation :c:func:`ARKodeSetUseCompensat .. note:: + This is only compatible with time-stepping modules that support temporal adaptivity. + Pass *hmin* :math:`\le 0.0` to set the default value of 0. .. versionadded:: x.y.z @@ -1237,6 +1268,8 @@ Use compensated summation :c:func:`ARKodeSetUseCompensat .. note:: + This is only compatible with time-stepping modules that support temporal adaptivity. + The default value is 7; set *maxnef* :math:`\le 0` to specify this default. @@ -1270,6 +1303,8 @@ Use compensated summation :c:func:`ARKodeSetUseCompensat .. note:: + This is only compatible with time-stepping modules that support temporal adaptivity. + The presence of a non-``NULL`` constraints vector that is not 0.0 in all components will cause constraint checking to be performed. However, a call with 0.0 in all components of ``constraints`` will result in an illegal @@ -1304,6 +1339,8 @@ Use compensated summation :c:func:`ARKodeSetUseCompensat .. note:: + This is only compatible with time-stepping modules that support temporal adaptivity. + Passing *maxfails* <= 0 results in ARKODE using the default value (10). @@ -1377,7 +1414,11 @@ Explicit stability function :c:func:`ARKodeSetSt :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported by the current time-stepping module. - .. versionadded:: x.y.z + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + .. versionadded:: x.y.z .. c:function:: int ARKodeSetAdaptivityAdjustment(void* arkode_mem, int adjust) @@ -1398,6 +1439,8 @@ Explicit stability function :c:func:`ARKodeSetSt .. note:: + This is only compatible with time-stepping modules that support temporal adaptivity. + This should be called prior to calling :c:func:`ARKodeEvolve`, and can only be reset following a call to ``*StepReInit``. @@ -1419,6 +1462,8 @@ Explicit stability function :c:func:`ARKodeSetSt .. note:: + This is only compatible with time-stepping modules that support temporal adaptivity. + Any non-positive parameter will imply a reset to the default value. @@ -1442,6 +1487,8 @@ Explicit stability function :c:func:`ARKodeSetSt .. note:: + This is only compatible with time-stepping modules that support temporal adaptivity. + Any value below 1.0 will imply a reset to the default value. If both this and one of :c:func:`ARKodeSetAdaptivityMethod` or @@ -1467,6 +1514,8 @@ Explicit stability function :c:func:`ARKodeSetSt .. note:: + This is only compatible with time-stepping modules that support temporal adaptivity. + Any interval *not* containing 1.0 will imply a reset to the default values. .. versionadded:: x.y.z @@ -1490,6 +1539,8 @@ Explicit stability function :c:func:`ARKodeSetSt .. note:: + This is only compatible with time-stepping modules that support temporal adaptivity. + Any value outside the interval :math:`(0,1]` will imply a reset to the default value. .. versionadded:: x.y.z @@ -1511,6 +1562,8 @@ Explicit stability function :c:func:`ARKodeSetSt .. note:: + This is only compatible with time-stepping modules that support temporal adaptivity. + Any value outside the interval :math:`(0,1]` will imply a reset to the default value. .. versionadded:: x.y.z @@ -1533,6 +1586,8 @@ Explicit stability function :c:func:`ARKodeSetSt .. note:: + This is only compatible with time-stepping modules that support temporal adaptivity. + Any value :math:`\le 1.0` will imply a reset to the default value. .. versionadded:: x.y.z @@ -1554,6 +1609,8 @@ Explicit stability function :c:func:`ARKodeSetSt .. note:: + This is only compatible with time-stepping modules that support temporal adaptivity. + Any value :math:`\le 1.0` will imply a reset to the default value. @@ -1578,6 +1635,8 @@ Explicit stability function :c:func:`ARKodeSetSt .. note:: + This is only compatible with time-stepping modules that support temporal adaptivity. + Any value outside the interval :math:`(0,1)` will imply a reset to the default value. @@ -1600,6 +1659,8 @@ Explicit stability function :c:func:`ARKodeSetSt .. note:: + This is only compatible with time-stepping modules that support temporal adaptivity. + Any value :math:`\le 0` will imply a reset to the default value. @@ -1623,6 +1684,8 @@ Explicit stability function :c:func:`ARKodeSetSt .. note:: + This is only compatible with time-stepping modules that support temporal adaptivity. + Any value :math:`\le 0` will imply a reset to the default value. .. versionadded:: x.y.z @@ -1646,6 +1709,8 @@ Explicit stability function :c:func:`ARKodeSetSt .. note:: + This is only compatible with time-stepping modules that support temporal adaptivity. + This function should return an estimate of the absolute value of the maximum stable time step for the explicit portion of the ODE system. It is not required, since accuracy-based @@ -1705,6 +1770,8 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + Tightens the linear solver tolerances and takes only a single Newton iteration. Calls :c:func:`ARKodeSetDeltaGammaMax` to enforce Jacobian recomputation when the step size ratio changes @@ -1735,6 +1802,8 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + This is the default behavior of ARKODE, so the function is primarily useful to undo a previous call to :c:func:`ARKodeSetLinear`. Calls @@ -1771,6 +1840,8 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + The default value is 0. If *method* is set to an undefined value, this default predictor will be used. @@ -1793,6 +1864,8 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + See :numref:`ARKODE.Usage.StagePredictFn` for more information on this user-supplied routine. @@ -1816,6 +1889,8 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + The default is to use the implicit right-hand side function provided to :c:func:`ARKodeCreate` in nonlinear system functions. If the input implicit right-hand side function is ``NULL``, the default is used. @@ -1843,6 +1918,8 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + The default value is 3; set *maxcor* :math:`\le 0` to specify this default. @@ -1865,6 +1942,8 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + The default value is 0.1; set *nlscoef* :math:`\le 0` to specify this default. @@ -1886,6 +1965,8 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + Any non-positive parameter will imply a reset to the default value. .. versionadded:: x.y.z @@ -1908,6 +1989,8 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + Any non-positive parameter will imply a reset to the default value. .. versionadded:: x.y.z @@ -1932,6 +2015,8 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + The default value is 10; set *maxncf* :math:`\le 0` to specify this default. @@ -1959,6 +2044,10 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the current time-stepping module. + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + .. versionadded:: x.y.z @@ -2062,6 +2151,8 @@ is recomputed using the current :math:`\gamma` value. .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + Any non-positive parameter will imply a reset to the default value. .. versionadded:: x.y.z @@ -2084,6 +2175,8 @@ is recomputed using the current :math:`\gamma` value. .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + Positive values of **msbp** specify the linear solver setup frequency. For example, an input of 1 means the setup function will be called every time step while an input of 2 means it will be called called every other time @@ -2113,6 +2206,8 @@ is recomputed using the current :math:`\gamma` value. .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + If ``nstlj`` is the step number at which the Jacobian information was lasted updated and ``nst`` is the current step number, ``nst - nstlj >= msbj`` indicates that the Jacobian information will be updated @@ -2212,6 +2307,8 @@ data in the program. The user data pointer may be specified through .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + This routine must be called after the ARKLS linear solver interface has been initialized through a call to :c:func:`ARKodeSetLinearSolver`. @@ -2244,6 +2341,8 @@ data in the program. The user data pointer may be specified through .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + This routine must be called after the ARKLS linear solver interface has been initialized through a call to :c:func:`ARKodeSetLinearSolver`. @@ -2275,6 +2374,8 @@ data in the program. The user data pointer may be specified through .. note:: + This is only compatible with time-stepping modules that support non-identity mass matrices. + This routine must be called after the ARKLS mass matrix solver interface has been initialized through a call to :c:func:`ARKodeSetMassLinearSolver`. @@ -2306,6 +2407,8 @@ data in the program. The user data pointer may be specified through .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + Linear solution scaling is enabled by default when a matrix-based linear solver is attached. @@ -2374,6 +2477,8 @@ time they are called. .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + The default is to use an internal finite difference quotient for *jtimes* and to leave out *jtsetup*. If ``NULL`` is passed to *jtimes*, these defaults are used. A user may @@ -2422,6 +2527,8 @@ this through calls to *both* :c:func:`ARKodeSetJacTimesRhsFn` and .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + The default is to use the implicit right-hand side function provided to ``*StepCreate`` in the internal difference quotient. If the input implicit right-hand side function is ``NULL``, the default is used. @@ -2470,6 +2577,8 @@ function of type :c:type:`ARKLsMassTimesSetupFn` (see .. note:: + This is only compatible with time-stepping modules that support non-identity mass matrices. + There is no default finite difference quotient for *mtimes*, so if using the ARKLS mass matrix solver interface with NULL-valued SUNMATRIX input :math:`M`, and this routine is called @@ -2560,6 +2669,8 @@ the user through the :c:func:`ARKodeSetEpsLin` function. .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + The default is ``NULL`` for both arguments (i.e., no preconditioning). @@ -2595,6 +2706,8 @@ the user through the :c:func:`ARKodeSetEpsLin` function. .. note:: + This is only compatible with time-stepping modules that support non-identity mass matrices. + This function must be called *after* the ARKLS mass matrix solver interface has been initialized through a call to :c:func:`ARKodeSetMassLinearSolver`. @@ -2627,6 +2740,8 @@ the user through the :c:func:`ARKodeSetEpsLin` function. .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + Passing a value *eplifac* :math:`\le 0` indicates to use the default value of 0.05. @@ -2655,6 +2770,8 @@ the user through the :c:func:`ARKodeSetEpsLin` function. .. note:: + This is only compatible with time-stepping modules that support non-identity mass matrices. + This function must be called *after* the ARKLS mass matrix solver interface has been initialized through a call to :c:func:`ARKodeSetMassLinearSolver`. @@ -2705,6 +2822,8 @@ allow for additional user control over these conversion factors. .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + This function must be called *after* the ARKLS system solver interface has been initialized through a call to :c:func:`ARKodeSetLinearSolver`. @@ -2736,6 +2855,8 @@ allow for additional user control over these conversion factors. .. note:: + This is only compatible with time-stepping modules that support non-identity mass matrices. + This function must be called *after* the ARKLS mass matrix solver interface has been initialized through a call to :c:func:`ARKodeSetMassLinearSolver`. @@ -3094,6 +3215,10 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the current time-stepping module. + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + .. versionadded:: x.y.z @@ -3144,6 +3269,8 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat .. note:: + This is only compatible with time-stepping modules that support non-identity mass matrices. + The user must allocate space for *rweight*, that will be filled in by this function. @@ -3220,6 +3347,10 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported by the current time-stepping module. + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + .. versionadded:: x.y.z @@ -3236,6 +3367,10 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported by the current time-stepping module. + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + .. versionadded:: x.y.z @@ -3263,6 +3398,10 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat :retval ARK_SUCCESS: the function exited successfully. :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + .. versionadded:: x.y.z @@ -3278,6 +3417,10 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the current time-stepping module. + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + .. versionadded:: x.y.z @@ -3324,6 +3467,10 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported by the current time-stepping module. + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + .. versionadded:: x.y.z @@ -3351,8 +3498,11 @@ Implicit solver optional output functions =================================================== ============================================ Optional output Function name =================================================== ============================================ +Computes state given a correction :c:func:`ARKodeComputeState` +Access data to compute the nonlin. sys. function :c:func:`ARKodeGetNonlinearSystemData` No. of calls to linear solver setup function :c:func:`ARKodeGetNumLinSolvSetups` No. of nonlinear solver iterations :c:func:`ARKodeGetNumNonlinSolvIters` +No. of nonlinear solver iterations :c:func:`ARKodeGetNumNonlinSolvIters` No. of nonlinear solver convergence failures :c:func:`ARKodeGetNumNonlinSolvConvFails` Single accessor to all nonlinear solver statistics :c:func:`ARKodeGetNonlinSolvStats` =================================================== ============================================ @@ -3375,6 +3525,8 @@ Single accessor to all nonlinear solver statistics :c:func:`ARKodeGetNonlinSol .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + This is only accumulated for the "life" of the nonlinear solver object; the counter is reset whenever a new nonlinear solver module is "attached" to ARKODE, or when ARKODE is resized. @@ -3398,6 +3550,8 @@ Single accessor to all nonlinear solver statistics :c:func:`ARKodeGetNonlinSol .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + This is only accumulated for the "life" of the nonlinear solver object; the counter is reset whenever a new nonlinear solver module is "attached" to ARKODE, or when ARKODE is resized. @@ -3420,6 +3574,8 @@ Single accessor to all nonlinear solver statistics :c:func:`ARKodeGetNonlinSol .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + This is only accumulated for the "life" of the nonlinear solver object; the counter is reset whenever a new nonlinear solver module is "attached" to ARKODE, or when ARKODE is resized. @@ -3443,6 +3599,8 @@ Single accessor to all nonlinear solver statistics :c:func:`ARKodeGetNonlinSol .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + This is only accumulated for the "life" of the nonlinear solver object; the counters are reset whenever a new nonlinear solver module is "attached" to ARKODE, or when ARKODE is resized. @@ -3570,6 +3728,10 @@ Last return from a mass matrix solver function :c:func:`ARKo :retval ARK_STEPPER_UNSUPPORTED: linear solvers are not supported by the current time-stepping module. + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + .. warning:: This function is provided for debugging purposes and the values in the @@ -3592,6 +3754,11 @@ Last return from a mass matrix solver function :c:func:`ARKo :retval ARK_STEPPER_UNSUPPORTED: linear solvers are not supported by the current time-stepping module. + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + .. c:function:: int ARKodeGetJacNumSteps(void* arkode_mem, long int* nst_J) Returns the value of the internal step counter at which the internally stored copy of the @@ -3606,6 +3773,10 @@ Last return from a mass matrix solver function :c:func:`ARKo :retval ARK_STEPPER_UNSUPPORTED: linear solvers are not supported by the current time-stepping module. + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + .. versionadded:: x.y.z @@ -3625,6 +3796,8 @@ Last return from a mass matrix solver function :c:func:`ARKo .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + The workspace requirements reported by this routine correspond only to memory allocated within this interface and to memory allocated by the ``SUNLinearSolver`` object attached @@ -3652,6 +3825,8 @@ Last return from a mass matrix solver function :c:func:`ARKo .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + This is only accumulated for the "life" of the linear solver object; the counter is reset whenever a new linear solver module is "attached" to ARKODE, or when ARKODE is resized. @@ -3676,6 +3851,8 @@ Last return from a mass matrix solver function :c:func:`ARKo .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + This is only accumulated for the "life" of the linear solver object; the counter is reset whenever a new linear solver module is "attached" to ARKODE, or when ARKODE is resized. @@ -3699,6 +3876,8 @@ Last return from a mass matrix solver function :c:func:`ARKo .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + This is only accumulated for the "life" of the linear solver object; the counter is reset whenever a new linear solver module is "attached" to ARKODE, or when ARKODE is resized. @@ -3721,6 +3900,8 @@ Last return from a mass matrix solver function :c:func:`ARKo .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + This is only accumulated for the "life" of the linear solver object; the counter is reset whenever a new linear solver module is "attached" to ARKODE, or when ARKODE is resized. @@ -3743,6 +3924,8 @@ Last return from a mass matrix solver function :c:func:`ARKo .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + This is only accumulated for the "life" of the linear solver object; the counter is reset whenever a new linear solver module is "attached" to ARKODE, or when ARKODE is resized. @@ -3766,6 +3949,8 @@ Last return from a mass matrix solver function :c:func:`ARKo .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + This is only accumulated for the "life" of the linear solver object; the counter is reset whenever a new linear solver module is "attached" to ARKODE, or when ARKODE is resized. @@ -3789,6 +3974,8 @@ Last return from a mass matrix solver function :c:func:`ARKo .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + This is only accumulated for the "life" of the linear solver object; the counter is reset whenever a new linear solver module is "attached" to ARKODE, or when ARKODE is resized. @@ -3814,6 +4001,8 @@ Last return from a mass matrix solver function :c:func:`ARKo .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + The value *nfevalsLS* is incremented only if the default internal difference quotient function is used. @@ -3840,6 +4029,8 @@ Last return from a mass matrix solver function :c:func:`ARKo .. note:: + This is only compatible with time-stepping modules that support implicit algebraic solvers. + If the ARKLS setup function failed when using the ``SUNLINSOL_DENSE`` or ``SUNLINSOL_BAND`` modules, then the value of *lsflag* is equal to the column index (numbered from one) at @@ -3889,6 +4080,11 @@ Last return from a mass matrix solver function :c:func:`ARKo ``SUNLINSOL_BAND`` modules, then if 1 :math:`\le` `lsflag` :math:`\le n` (LU factorization failed), this routine returns "NONE". + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + .. versionadded:: x.y.z @@ -3908,6 +4104,8 @@ Last return from a mass matrix solver function :c:func:`ARKo .. note:: + This is only compatible with time-stepping modules that support non-identity mass matrices. + The workspace requirements reported by this routine correspond only to memory allocated within this interface and to memory allocated by the ``SUNLinearSolver`` object attached @@ -3937,6 +4135,8 @@ Last return from a mass matrix solver function :c:func:`ARKo .. note:: + This is only compatible with time-stepping modules that support non-identity mass matrices. + This is only accumulated for the "life" of the linear solver object; the counter is reset whenever a new mass-matrix linear solver module is "attached" to ARKODE, or when ARKODE is @@ -3961,6 +4161,8 @@ Last return from a mass matrix solver function :c:func:`ARKo .. note:: + This is only compatible with time-stepping modules that support non-identity mass matrices. + This is only accumulated for the "life" of the linear solver object; the counter is reset whenever a new mass-matrix linear solver module is "attached" to ARKODE, or when ARKODE is @@ -3986,6 +4188,8 @@ Last return from a mass matrix solver function :c:func:`ARKo .. note:: + This is only compatible with time-stepping modules that support non-identity mass matrices. + This is only accumulated for the "life" of the linear solver object; the counter is reset whenever a new mass-matrix linear solver module is "attached" to ARKODE, or when ARKODE is @@ -4009,6 +4213,8 @@ Last return from a mass matrix solver function :c:func:`ARKo .. note:: + This is only compatible with time-stepping modules that support non-identity mass matrices. + This is only accumulated for the "life" of the linear solver object; the counter is reset whenever a new mass-matrix linear solver module is "attached" to ARKODE, or when ARKODE is @@ -4033,6 +4239,8 @@ Last return from a mass matrix solver function :c:func:`ARKo .. note:: + This is only compatible with time-stepping modules that support non-identity mass matrices. + This is only accumulated for the "life" of the linear solver object; the counter is reset whenever a new mass-matrix linear solver module is "attached" to ARKODE, or when ARKODE is @@ -4057,6 +4265,8 @@ Last return from a mass matrix solver function :c:func:`ARKo .. note:: + This is only compatible with time-stepping modules that support non-identity mass matrices. + This is only accumulated for the "life" of the linear solver object; the counter is reset whenever a new mass-matrix linear solver module is "attached" to ARKODE, or when ARKODE is @@ -4080,6 +4290,8 @@ Last return from a mass matrix solver function :c:func:`ARKo .. note:: + This is only compatible with time-stepping modules that support non-identity mass matrices. + This is only accumulated for the "life" of the linear solver object; the counter is reset whenever a new mass-matrix linear solver module is "attached" to ARKODE, or when ARKODE is @@ -4103,6 +4315,8 @@ Last return from a mass matrix solver function :c:func:`ARKo .. note:: + This is only compatible with time-stepping modules that support non-identity mass matrices. + This is only accumulated for the "life" of the linear solver object; the counter is reset whenever a new mass-matrix linear solver module is "attached" to ARKODE, or when ARKODE is @@ -4127,6 +4341,8 @@ Last return from a mass matrix solver function :c:func:`ARKo .. note:: + This is only compatible with time-stepping modules that support non-identity mass matrices. + This is only accumulated for the "life" of the linear solver object; the counter is reset whenever a new mass-matrix linear solver module is "attached" to ARKODE, or when ARKODE is @@ -4151,6 +4367,8 @@ Last return from a mass matrix solver function :c:func:`ARKo .. note:: + This is only compatible with time-stepping modules that support non-identity mass matrices. + The values of *msflag* for each of the various solvers will match those described above for the function :c:func:`ARKodeGetLastLinFlag`. diff --git a/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst b/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst index 5607ca9084..fe7f768419 100644 --- a/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst +++ b/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst @@ -74,8 +74,128 @@ access to the internal integrator data required to evaluate :eq:`ARKODE_Residual_corrector` or :eq:`ARKODE_FixedPt_corrector`. -ARKStep advanced output functions -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +ARKODE advanced output functions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Two notable functions were already listed in :numref:`ARKODE.Usage.ARKodeMainOutputs`: + +* :c:func:`ARKodeGetCurrentState` -- returns the current state vector. + When called within the computation of a step (i.e., during a nonlinear solve) + this is the current stage state vector :math:`z_i = z_{pred} + z_{cor}`. + Otherwise this is the current internal solution state vector :math:`y(t)`. In + either case the corresponding stage or solution time can be obtained from + :c:func:`ARKodeGetCurrentTime`. + +* :c:func:`ARKodeGetCurrentGamma` -- returns the current value of the scalar :math:`\gamma`. + + +Additional advanced output functions that are provided to aid in the construction +of user-supplied SUNNonlinSol modules are as follows. + +.. c:function:: int ARKodeGetCurrentMassMatrix(void* arkode_mem, SUNMatrix* M) + + Returns the current mass matrix. For a time dependent mass matrix the + corresponding time can be obtained from :c:func:`ARKodeGetCurrentTime`. + + **Arguments:** + * *arkode_mem* -- pointer to the ARKODE memory block. + * *M* -- SUNMatrix pointer that will get set to the current mass matrix + :math:`M(t)`. If a matrix-free method is used the output is ``NULL``. + + **Return value:** + * ``ARK_SUCCESS`` if successful. + * ``ARK_MEM_NULL`` if the ARKStep memory was ``NULL``. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + +.. c:function:: int ARKodeGetNonlinearSystemData(void* arkode_mem, sunrealtype *tcur, N_Vector *zpred, N_Vector *z, N_Vector *Fi, sunrealtype *gamma, N_Vector *sdata, void **user_data) + + Returns all internal data required to construct the current nonlinear + implicit system :eq:`ARKODE_Residual_corrector` or :eq:`ARKODE_FixedPt_corrector`: + + **Arguments:** + * *arkode_mem* -- pointer to the ARKODE memory block. + * *tcur* -- value of the independent variable corresponding to implicit + stage, :math:`t^I_{n,i}`. + * *zpred* -- the predicted stage vector :math:`z_{pred}` at + :math:`t^I_{n,i}`. This vector must not be changed. + * *z* -- the stage vector :math:`z_{i}` above. This vector may be not + current and may need to be filled (see the note below). + * *Fi* -- the implicit function evaluated at the current time and state, + :math:`f^I(t^I_{n,i}, z_{i})`. This vector may be not current and may + need to be filled (see the note below). + * *gamma* -- current :math:`\gamma` for implicit stage calculation. + * *sdata* -- accumulated data from previous solution and stages, + :math:`\tilde{a}_i`. This vector must not be changed. + * *user_data* -- pointer to the user-defined data structure (as specified + through :c:func:`ARKodeSetUserData`, or ``NULL`` otherwise) + + **Return value:** + * ``ARK_SUCCESS`` if successful. + * ``ARK_MEM_NULL`` if the ARKODE memory was ``NULL``. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + This routine is intended for users who whish to attach a custom + :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object + (through a call to :c:func:`SUNNonlinSolSetSysFn`) or who need access to + nonlinear system data to compute the nonlinear system function as part of + a custom ``SUNNonlinearSolver`` object. + + When supplying a custom :c:type:`SUNNonlinSolSysFn` to an existing + ``SUNNonlinearSolver`` object, the user should call + :c:func:`ARKodeGetNonlinearSystemData()` **inside** the nonlinear system + function to access the requisite data for evaluting the nonlinear systen + function of their choosing. Additionlly, if the ``SUNNonlinearSolver`` object + (existing or custom) leverages the :c:type:`SUNNonlinSolLSetupFn` and/or + :c:type:`SUNNonlinSolLSolveFn` functions supplied by ARKODE (through + calls to :c:func:`SUNNonlinSolSetLSetupFn()` and + :c:func:`SUNNonlinSolSetLSolveFn()` respectively) the vectors *z* and *Fi* + **must be filled** in by the user's :c:type:`SUNNonlinSolSysFn` with the + current state and corresponding evaluation of the right-hand side function + respectively i.e., + + .. math:: + z &= z_{pred} + z_{cor}, \\ + Fi &= f^I\left(t^I_{n,i}, z_i\right), + + where :math:`z_{cor}` was the first argument supplied to the + :c:type:`SUNNonlinSolSysFn`. + + If this function is called as part of a custom linear solver (i.e., the + default :c:type:`SUNNonlinSolSysFn` is used) then the vectors *z* and + *Fi* are only current when :c:func:`ARKodeGetNonlinearSystemData()` is + called after an evaluation of the nonlinear system function. + + +.. c:function:: int ARKodeComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) + + Computes the current stage state vector using the stored prediction and the + supplied correction from the nonlinear solver i.e., + :math:`z_i(t) = z_{pred} + z_{cor}`. + + **Arguments:** + * *arkode_mem* -- pointer to the ARKODE memory block. + * *zcor* -- the correction from the nonlinear solver. + * *z* -- on output, the current stage state vector :math:`z_i`. + + **Return value:** + * ``ARK_SUCCESS`` if successful. + * ``ARK_MEM_NULL`` if the ARKODE memory was ``NULL``. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + + +ARKStep advanced output functions (deprecated) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Two notable functions were already listed in :numref:`ARKODE.Usage.ARKStep.ARKStepMainOutputs`: @@ -106,6 +226,10 @@ of user-supplied SUNNonlinSol modules are as follows. * ``ARK_SUCCESS`` if successful. * ``ARK_MEM_NULL`` if the ARKStep memory was ``NULL``. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetCurrentMassMatrix` instead. + .. c:function:: int ARKStepGetNonlinearSystemData(void* arkode_mem, sunrealtype *tcur, N_Vector *zpred, N_Vector *z, N_Vector *Fi, sunrealtype *gamma, N_Vector *sdata, void **user_data) @@ -166,6 +290,10 @@ of user-supplied SUNNonlinSol modules are as follows. *Fi* are only current when :c:func:`ARKStepGetNonlinearSystemData()` is called after an evaluation of the nonlinear system function. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNonlinearSystemData` instead. + .. c:function:: int ARKStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) @@ -182,10 +310,13 @@ of user-supplied SUNNonlinSol modules are as follows. * ``ARK_SUCCESS`` if successful. * ``ARK_MEM_NULL`` if the ARKStep memory was ``NULL``. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeComputeState` instead. -MRIStep advanced output functions -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +MRIStep advanced output functions (deprecated) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Two notable functions were already listed in :numref:`ARKODE.Usage.MRIStep.MRIStepMainOutputs`: @@ -262,6 +393,10 @@ of user-supplied SUNNonlinSol modules are as follows. *Fi* are only current when :c:func:`MRIStepGetNonlinearSystemData()` is called after an evaluation of the nonlinear system function. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNonlinearSystemData` instead. + .. c:function:: int MRIStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) @@ -277,3 +412,7 @@ of user-supplied SUNNonlinSol modules are as follows. **Return value:** * ``ARK_SUCCESS`` if successful. * ``ARK_MEM_NULL`` if the MRIStep memory was ``NULL``. + + .. deprecated:: x.y.z + + Use :c:func:`ARKodeComputeState` instead. diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index ec8f98e555..55e380a2b7 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -131,7 +131,7 @@ int ARKodeSetOrder(void* arkode_mem, int ord) } else { - arkProcessError(NULL, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, "time-stepping module does not support this function"); return (ARK_STEPPER_UNSUPPORTED); } @@ -275,6 +275,14 @@ int ARKodeSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_algebraic) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Call stepper routine (if provided) */ if (ark_mem->step_setnonlinearsolver) { @@ -282,7 +290,7 @@ int ARKodeSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) } else { - arkProcessError(NULL, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, "time-stepping module does not support this function"); return (ARK_STEPPER_UNSUPPORTED); } @@ -314,6 +322,14 @@ int ARKodeSetLinear(void* arkode_mem, int timedepend) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_algebraic) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Call stepper routine (if provided) */ if (ark_mem->step_setlinear) { @@ -321,7 +337,7 @@ int ARKodeSetLinear(void* arkode_mem, int timedepend) } else { - arkProcessError(NULL, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, "time-stepping module does not support this function"); return (ARK_STEPPER_UNSUPPORTED); } @@ -344,6 +360,14 @@ int ARKodeSetNonlinear(void* arkode_mem) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_algebraic) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Call stepper routine (if provided) */ if (ark_mem->step_setnonlinear) { @@ -351,7 +375,7 @@ int ARKodeSetNonlinear(void* arkode_mem) } else { - arkProcessError(NULL, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, "time-stepping module does not support this function"); return (ARK_STEPPER_UNSUPPORTED); } @@ -375,6 +399,14 @@ int ARKodeSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_algebraic) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Call stepper routine (if provided) */ if (ark_mem->step_setnlsrhsfn) { @@ -382,7 +414,7 @@ int ARKodeSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi) } else { - arkProcessError(NULL, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, "time-stepping module does not support this function"); return (ARK_STEPPER_UNSUPPORTED); } @@ -411,6 +443,14 @@ int ARKodeSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_algebraic) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Call stepper routine (if provided) */ if (ark_mem->step_setdeduceimplicitrhs) { @@ -418,7 +458,7 @@ int ARKodeSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce) } else { - arkProcessError(NULL, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, "time-stepping module does not support this function"); return (ARK_STEPPER_UNSUPPORTED); } @@ -442,6 +482,14 @@ int ARKodeSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_algebraic) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Call stepper routine (if provided) */ if (ark_mem->step_setnonlincrdown) { @@ -449,7 +497,7 @@ int ARKodeSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) } else { - arkProcessError(NULL, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, "time-stepping module does not support this function"); return (ARK_STEPPER_UNSUPPORTED); } @@ -473,6 +521,14 @@ int ARKodeSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_algebraic) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Call stepper routine (if provided) */ if (ark_mem->step_setnonlinrdiv) { @@ -480,7 +536,7 @@ int ARKodeSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) } else { - arkProcessError(NULL, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, "time-stepping module does not support this function"); return (ARK_STEPPER_UNSUPPORTED); } @@ -504,6 +560,14 @@ int ARKodeSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_algebraic) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Call stepper routine (if provided) */ if (ark_mem->step_setdeltagammamax) { @@ -511,7 +575,7 @@ int ARKodeSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax) } else { - arkProcessError(NULL, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, "time-stepping module does not support this function"); return (ARK_STEPPER_UNSUPPORTED); } @@ -536,6 +600,14 @@ int ARKodeSetLSetupFrequency(void* arkode_mem, int msbp) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_algebraic) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Call stepper routine (if provided) */ if (ark_mem->step_setlsetupfrequency) { @@ -543,7 +615,7 @@ int ARKodeSetLSetupFrequency(void* arkode_mem, int msbp) } else { - arkProcessError(NULL, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, "time-stepping module does not support this function"); return (ARK_STEPPER_UNSUPPORTED); } @@ -565,6 +637,14 @@ int ARKodeSetPredictorMethod(void* arkode_mem, int pred_method) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_algebraic) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Call stepper routine (if provided) */ if (ark_mem->step_setpredictormethod) { @@ -572,7 +652,7 @@ int ARKodeSetPredictorMethod(void* arkode_mem, int pred_method) } else { - arkProcessError(NULL, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, "time-stepping module does not support this function"); return (ARK_STEPPER_UNSUPPORTED); } @@ -596,6 +676,14 @@ int ARKodeSetMaxNonlinIters(void* arkode_mem, int maxcor) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_algebraic) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Call stepper routine (if provided) */ if (ark_mem->step_setmaxnonliniters) { @@ -603,7 +691,7 @@ int ARKodeSetMaxNonlinIters(void* arkode_mem, int maxcor) } else { - arkProcessError(NULL, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, "time-stepping module does not support this function"); return (ARK_STEPPER_UNSUPPORTED); } @@ -626,6 +714,14 @@ int ARKodeSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_algebraic) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Call stepper routine (if provided) */ if (ark_mem->step_setnonlinconvcoef) { @@ -633,7 +729,7 @@ int ARKodeSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) } else { - arkProcessError(NULL, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, "time-stepping module does not support this function"); return (ARK_STEPPER_UNSUPPORTED); } @@ -655,6 +751,14 @@ int ARKodeSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_algebraic) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Call stepper routine (if provided) */ if (ark_mem->step_setstagepredictfn) { @@ -662,7 +766,7 @@ int ARKodeSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) } else { - arkProcessError(NULL, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, "time-stepping module does not support this function"); return (ARK_STEPPER_UNSUPPORTED); } @@ -729,9 +833,9 @@ int ARKodeSetAdaptController(void* arkode_mem, SUNAdaptController C) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } /* Remove current SUNAdaptController object @@ -824,9 +928,9 @@ int ARKodeSetMaxHnilWarns(void* arkode_mem, int mxhnil) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } /* Passing mxhnil=0 sets the default, otherwise use input. */ @@ -853,6 +957,14 @@ int ARKodeSetInitStep(void* arkode_mem, sunrealtype hin) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against hin==0 for non-adaptive time stepper modules */ + if ((!ark_mem->step_supports_adaptive) && (hin == ZERO)) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Passing hin=0 sets the default, otherwise use input. */ if (hin == ZERO) { ark_mem->hin = ZERO; } else { ark_mem->hin = hin; } @@ -886,9 +998,9 @@ int ARKodeSetMinStep(void* arkode_mem, sunrealtype hmin) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } /* Passing a value <= 0 sets hmin = 0 */ @@ -932,9 +1044,9 @@ int ARKodeSetMaxStep(void* arkode_mem, sunrealtype hmax) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } /* Passing a value <= 0 sets hmax = infinity */ @@ -1250,9 +1362,9 @@ int ARKodeSetConstraints(void* arkode_mem, N_Vector constraints) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive && (constraints != NULL)) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } /* If there are no constraints, destroy data structures */ @@ -1316,9 +1428,9 @@ int ARKodeSetMaxNumConstrFails(void* arkode_mem, int maxfails) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } /* Passing maxfails = 0 sets the default, otherwise set to input */ @@ -1641,9 +1753,9 @@ int ARKodeSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } /* check for allowable parameters */ @@ -1681,9 +1793,9 @@ int ARKodeSetAdaptivityAdjustment(void* arkode_mem, int adjust) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } /* store requested adjustment */ @@ -1710,9 +1822,9 @@ int ARKodeSetSafetyFactor(void* arkode_mem, sunrealtype safety) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } /* check for allowable parameters */ @@ -1748,9 +1860,9 @@ int ARKodeSetErrorBias(void* arkode_mem, sunrealtype bias) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } /* set allowed value, otherwise set default */ @@ -1790,9 +1902,9 @@ int ARKodeSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } /* set allowed value, otherwise set default */ @@ -1821,9 +1933,9 @@ int ARKodeSetMinReduction(void* arkode_mem, sunrealtype eta_min) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } /* set allowed value, otherwise set default */ @@ -1851,9 +1963,9 @@ int ARKodeSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } /* set allowable interval, otherwise set defaults */ @@ -1889,9 +2001,9 @@ int ARKodeSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } /* if argument legal set it, otherwise set default */ @@ -1919,9 +2031,9 @@ int ARKodeSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } /* if argument legal set it, otherwise set default */ @@ -1949,9 +2061,9 @@ int ARKodeSetSmallNumEFails(void* arkode_mem, int small_nef) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } /* if argument legal set it, otherwise set default */ @@ -1979,9 +2091,9 @@ int ARKodeSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } /* if argument legal set it, otherwise set default */ @@ -2009,9 +2121,9 @@ int ARKodeSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } /* NULL argument sets default, otherwise set inputs */ @@ -2050,9 +2162,9 @@ int ARKodeSetMaxErrTestFails(void* arkode_mem, int maxnef) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } /* argument <= 0 sets default, otherwise set input */ @@ -2082,9 +2194,9 @@ int ARKodeSetMaxConvFails(void* arkode_mem, int maxncf) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* argument <= 0 sets default, otherwise set input */ @@ -2296,6 +2408,14 @@ int ARKodeGetCurrentGamma(void* arkode_mem, sunrealtype* gamma) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_algebraic) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Call stepper routine to compute the state (if provided) */ if (ark_mem->step_getcurrentgamma) { @@ -2303,7 +2423,7 @@ int ARKodeGetCurrentGamma(void* arkode_mem, sunrealtype* gamma) } else { - arkProcessError(NULL, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, "time-stepping module does not support this function"); return (ARK_STEPPER_UNSUPPORTED); } @@ -2368,9 +2488,9 @@ int ARKodeGetResWeights(void* arkode_mem, N_Vector rweight) /* Guard against use for time steppers that do not support mass matrices */ if (!ark_mem->step_supports_massmatrix) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support non-identity mass matrices"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support non-identity mass matrices"); + return (ARK_STEPPER_UNSUPPORTED); } N_VScale(ONE, ark_mem->rwt, rweight); @@ -2500,9 +2620,9 @@ int ARKodeGetNumConstrFails(void* arkode_mem, long int* nconstrfails) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } *nconstrfails = ark_mem->nconstrfails; @@ -2528,9 +2648,9 @@ int ARKodeGetNumExpSteps(void* arkode_mem, long int* nsteps) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } *nsteps = ark_mem->hadapt_mem->nst_exp; @@ -2556,9 +2676,9 @@ int ARKodeGetNumAccSteps(void* arkode_mem, long int* nsteps) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } *nsteps = ark_mem->hadapt_mem->nst_acc; @@ -2584,9 +2704,9 @@ int ARKodeGetNumErrTestFails(void* arkode_mem, long int* netfails) /* Guard against use for non-adaptive time stepper modules */ if (!ark_mem->step_supports_adaptive) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not support temporal adaptivity"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); } *netfails = ark_mem->netf; @@ -2610,6 +2730,14 @@ int ARKodeComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for incompatible time stepper modules */ + if (!ark_mem->step_supports_algebraic) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support algebraic solvers"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Call stepper routine to compute the state (if provided) */ if (ark_mem->step_computestate) { @@ -2617,7 +2745,7 @@ int ARKodeComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) } else { - arkProcessError(NULL, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, "time-stepping module does not support this function"); return (ARK_STEPPER_UNSUPPORTED); } @@ -2643,6 +2771,14 @@ int ARKodeGetNonlinearSystemData(void* arkode_mem, sunrealtype* tcur, } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for incompatible time stepper modules */ + if (!ark_mem->step_supports_algebraic) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support algebraic solvers"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Call stepper routine to compute the state (if provided) */ if (ark_mem->step_getnonlinearsystemdata) { @@ -2651,7 +2787,7 @@ int ARKodeGetNonlinearSystemData(void* arkode_mem, sunrealtype* tcur, } else { - arkProcessError(NULL, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, "time-stepping module does not support this function"); return (ARK_STEPPER_UNSUPPORTED); } @@ -2673,6 +2809,14 @@ int ARKodeGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for incompatible time stepper modules */ + if (!ark_mem->step_supports_algebraic) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not support algebraic solvers"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Call stepper routine to compute the state (if provided) */ if (ark_mem->step_getnumnonlinsolviters) { @@ -2680,7 +2824,7 @@ int ARKodeGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) } else { - arkProcessError(NULL, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, "time-stepping module does not support this function"); return (ARK_STEPPER_UNSUPPORTED); } @@ -2702,6 +2846,14 @@ int ARKodeGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_algebraic) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Call stepper routine to compute the state (if provided) */ if (ark_mem->step_getnumnonlinsolvconvfails) { @@ -2709,7 +2861,7 @@ int ARKodeGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails) } else { - arkProcessError(NULL, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, "time-stepping module does not support this function"); return (ARK_STEPPER_UNSUPPORTED); } @@ -2732,6 +2884,14 @@ int ARKodeGetNonlinSolvStats(void* arkode_mem, long int* nniters, } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_algebraic) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Call stepper routine to compute the state (if provided) */ if (ark_mem->step_getnonlinsolvstats) { @@ -2739,7 +2899,7 @@ int ARKodeGetNonlinSolvStats(void* arkode_mem, long int* nniters, } else { - arkProcessError(NULL, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, "time-stepping module does not support this function"); return (ARK_STEPPER_UNSUPPORTED); } @@ -2765,9 +2925,9 @@ int ARKodeGetNumStepSolveFails(void* arkode_mem, long int* nncfails) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } *nncfails = ark_mem->ncfn; @@ -2790,6 +2950,14 @@ int ARKodeGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_algebraic) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Call stepper routine to compute the state (if provided) */ if (ark_mem->step_getnumlinsolvsetups) { @@ -2797,7 +2965,7 @@ int ARKodeGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) } else { - arkProcessError(NULL, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, "time-stepping module does not support this function"); return (ARK_STEPPER_UNSUPPORTED); } diff --git a/src/arkode/arkode_ls.c b/src/arkode/arkode_ls.c index b3c2c90c60..63ab562f66 100644 --- a/src/arkode/arkode_ls.c +++ b/src/arkode/arkode_ls.c @@ -66,9 +66,9 @@ int ARKodeSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } if (LS == NULL) @@ -556,9 +556,9 @@ int ARKodeSetJacFn(void* arkode_mem, ARKLsJacFn jac) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* return with failure if jac cannot be used */ @@ -650,9 +650,9 @@ int ARKodeSetEpsLin(void* arkode_mem, sunrealtype eplifac) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* store input and return */ @@ -679,9 +679,9 @@ int ARKodeSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* store input and return */ @@ -722,9 +722,9 @@ int ARKodeSetJacEvalFrequency(void* arkode_mem, long int msbj) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* store input and return */ @@ -750,9 +750,9 @@ int ARKodeSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* check for valid solver type */ @@ -784,9 +784,9 @@ int ARKodeSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* issue error if LS object does not allow user-supplied preconditioning */ @@ -835,9 +835,9 @@ int ARKodeSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* issue error if LS object does not allow user-supplied ATimes */ @@ -894,9 +894,9 @@ int ARKodeSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* check if using internal finite difference approximation */ @@ -938,9 +938,9 @@ int ARKodeSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* return with failure if linsys cannot be used */ @@ -1011,9 +1011,9 @@ int ARKodeGetJac(void* arkode_mem, SUNMatrix* J) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* set output and return */ @@ -1034,9 +1034,9 @@ int ARKodeGetJacTime(void* arkode_mem, sunrealtype* t_J) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* set output and return */ @@ -1057,9 +1057,9 @@ int ARKodeGetJacNumSteps(void* arkode_mem, long int* nst_J) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* set output and return */ @@ -1086,9 +1086,9 @@ int ARKodeGetLinWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* start with fixed sizes plus vector/matrix pointers */ @@ -1147,9 +1147,9 @@ int ARKodeGetNumJacEvals(void* arkode_mem, long int* njevals) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* set output and return */ @@ -1175,9 +1175,9 @@ int ARKodeGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* set output and return */ @@ -1202,9 +1202,9 @@ int ARKodeGetNumPrecEvals(void* arkode_mem, long int* npevals) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* set output and return */ @@ -1229,9 +1229,9 @@ int ARKodeGetNumPrecSolves(void* arkode_mem, long int* npsolves) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* set output and return */ @@ -1256,9 +1256,9 @@ int ARKodeGetNumLinIters(void* arkode_mem, long int* nliters) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* set output and return */ @@ -1283,9 +1283,9 @@ int ARKodeGetNumLinConvFails(void* arkode_mem, long int* nlcfails) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* set output and return */ @@ -1310,9 +1310,9 @@ int ARKodeGetNumJTSetupEvals(void* arkode_mem, long int* njtsetups) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* set output and return */ @@ -1337,9 +1337,9 @@ int ARKodeGetNumJtimesEvals(void* arkode_mem, long int* njvevals) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* set output and return */ @@ -1391,9 +1391,9 @@ int ARKodeGetLastLinFlag(void* arkode_mem, long int* flag) /* Guard against use for time steppers that do not need an algebraic solver */ if (!ark_mem->step_supports_algebraic) { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "time-stepping module does not require an algebraic solver"); - return (ARK_ILL_INPUT); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, __FILE__, + "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } /* set output and return */