Skip to content

Commit

Permalink
Update docs for full RHS mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven-Roberts committed Oct 29, 2024
1 parent ad41aa0 commit 76e4537
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
28 changes: 26 additions & 2 deletions doc/shared/sunstepper/SUNStepper_Description.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`.
Expand Down
4 changes: 0 additions & 4 deletions include/sundials/sundials_stepper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/arkode/arkode_mristep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 76e4537

Please sign in to comment.