diff --git a/doc/shared/sunstepper/SUNStepper_Description.rst b/doc/shared/sunstepper/SUNStepper_Description.rst index 5cc709e4f5..c79c6206da 100644 --- a/doc/shared/sunstepper/SUNStepper_Description.rst +++ b/doc/shared/sunstepper/SUNStepper_Description.rst @@ -112,7 +112,7 @@ Stepping Functions :return: A :c:type:`SUNErrCode` indicating success or failure. -.. c:function:: SUNErrCode SUNStepper_FullRhs(SUNStepper stepper, sunrealtype t, N_Vector v, N_Vector f) +.. c:function:: SUNErrCode SUNStepper_FullRhs(SUNStepper stepper, sunrealtype t, N_Vector v, N_Vector f, SUNFullRhsMode mode) This function computes the full right-hand side function of the ODE, :math:`f(t, v) + r(t)` in :eq:`SUNStepper_IVP` for a given value of the @@ -123,6 +123,7 @@ Stepping Functions :param v: the current value of the dependent variable vector. :param f: the output vector for the ODE right-hand side, :math:`f(t, v) + r(t)`, in :eq:`SUNStepper_IVP`. + :param mode: the purpose of the right-hand side evaluation. :return: A :c:type:`SUNErrCode` indicating success or failure. @@ -172,6 +173,29 @@ Stepping Functions well as computing and applying the forcing term :eq:`SUNStepper_forcing` to obtain the full right-hand side of the ODE :eq:`SUNStepper_IVP`. + +.. _SUNStepper.Description.BaseMethods.RhsMode: + +The Right-Hand Side Evaluation Mode +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. c:enum:: SUNFullRhsMode + + A flag indicating the purpose of a right-hand side function evaluation. + + .. c:enumerator:: SUN_FULLRHS_START + + Evaluate at the beginning of the simulation. + + .. c:enumerator:: SUN_FULLRHS_END + + Evaluate at the end of a successful step. + + .. c:enumerator:: SUN_FULLRHS_OTHER + + Evaluate elsewhere, e.g., for dense output. + + .. _SUNStepper.Description.BaseMethods.Content: Attaching and Accessing the Content Pointer @@ -312,7 +336,7 @@ abstract base class. :c:func:`SUNStepper_Evolve`. -.. c:type:: SUNErrCode (*SUNStepperFullRhsFn)(SUNStepper stepper, sunrealtype t, N_Vector v, N_Vector f) +.. c:type:: SUNErrCode (*SUNStepperFullRhsFn)(SUNStepper stepper, sunrealtype t, N_Vector v, N_Vector f, SUNFullRhsMode mode) This type represents a function with the signature of :c:func:`SUNStepper_FullRhs`. diff --git a/include/sundials/sundials_stepper.h b/include/sundials/sundials_stepper.h index 6e6e9c92f3..2a9c976311 100644 --- a/include/sundials/sundials_stepper.h +++ b/include/sundials/sundials_stepper.h @@ -19,10 +19,6 @@ extern "C" { #endif -#define ARK_FULLRHS_START 0 -#define ARK_FULLRHS_END 1 -#define ARK_FULLRHS_OTHER 2 - typedef enum { SUN_FULLRHS_START, diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index 59eba311c1..fbbaf58ed1 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -2890,11 +2890,11 @@ int mriStepInnerStepper_FullRhs(MRIStepInnerStepper stepper, sunrealtype t, int mriStepInnerStepper_FullRhsSUNStepper(MRIStepInnerStepper stepper, sunrealtype t, N_Vector y, N_Vector f, - SUNDIALS_MAYBE_UNUSED int ark_mode) + int ark_mode) { SUNStepper sunstepper = (SUNStepper)stepper->content; - int mode; + SUNFullRhsMode mode; switch (ark_mode) { case ARK_FULLRHS_START: