Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
f4ca753
Added ARKODE user-callable routine to retrieve the current stage inde…
drreynolds Jan 16, 2026
a01ba9f
Merge ../fespr5-preallocate into feature/fes-get-stage-index
drreynolds Jan 16, 2026
2465664
Merge ../fespr5-preallocate into feature/fes-get-stage-index
drreynolds Jan 16, 2026
d3bc50b
Merge ../fespr5-preallocate into feature/fes-get-stage-index
drreynolds Jan 17, 2026
a45e676
Merge ../fespr5-preallocate into feature/fes-get-stage-index
drreynolds Jan 17, 2026
cfd35c7
Formatting
drreynolds Jan 17, 2026
967294a
Merge ../fespr5-preallocate into feature/fes-get-stage-index
drreynolds Jan 18, 2026
aabce66
Merge ../fespr5-preallocate into feature/fes-get-stage-index
drreynolds Jan 18, 2026
f546d8f
Merge ../fespr5-preallocate into feature/fes-get-stage-index
drreynolds Jan 18, 2026
425a2e1
Merge ../fespr5-preallocate into feature/fes-get-stage-index
drreynolds Jan 18, 2026
c786851
Merge ../fespr5-preallocate into feature/fes-get-stage-index
drreynolds Jan 18, 2026
580a07d
Merge ../fespr5-preallocate into feature/fes-get-stage-index
drreynolds Jan 18, 2026
8fa87c4
Merge ../fespr5-preallocate into feature/fes-get-stage-index
drreynolds Jan 19, 2026
f11fc2d
Swig
drreynolds Jan 20, 2026
8932ad2
Updated logging output files to account for fixes from PR
drreynolds Jan 20, 2026
5894f8c
Updated answers submodule commit
drreynolds Jan 20, 2026
b1be627
Added missing 'static'
drreynolds Jan 20, 2026
1fe5e36
Formatting
drreynolds Jan 20, 2026
a8554e4
Fixed answer files branch (the one I created did not include changes …
drreynolds Jan 20, 2026
4434747
Updated answers submodule commit
drreynolds Jan 20, 2026
187c03e
Updated answers submodule commit
drreynolds Jan 20, 2026
8fe1311
Merged from feature/fes-preallocate
drreynolds Jan 26, 2026
9b9218c
Merged with feature/fes-preallocate
drreynolds Jan 27, 2026
2eff56a
Added Get routines to return the last saved time and state, (tn,yn), …
drreynolds Jan 27, 2026
872b50a
Formatting
drreynolds Jan 27, 2026
583ed2f
Merged with feature/fes-preallocate
drreynolds Jan 28, 2026
685afc1
Merge branch 'feature/fes-preallocate' into feature/fes-get-stage-index
drreynolds Jan 28, 2026
bbbc42e
Merge branch 'feature/fes-preallocate' into feature/fes-get-stage-index
drreynolds Jan 28, 2026
050272f
Added unit tests for ARKodeGetLastTime, ARKodeGetCurrentTime, ARKodeG…
drreynolds Jan 28, 2026
f43fffc
Formatting
drreynolds Jan 29, 2026
70b832a
Merge branch 'feature/fes-preallocate' into feature/fes-get-stage-index
drreynolds Jan 29, 2026
a2a40ab
Merge branch 'feature/fes-preallocate' into feature/fes-get-stage-index
drreynolds Jan 29, 2026
86d5eaf
Fixed floating-point differences in .out files for Jenkins; added mis…
drreynolds Jan 29, 2026
e5fc63b
Updated answers submodule commit
drreynolds Jan 29, 2026
e796d99
Updated answers submodule commit
drreynolds Jan 30, 2026
a4d6557
Formatting
drreynolds Jan 30, 2026
78bba68
Added selected LSRK method to output
drreynolds Jan 30, 2026
a291b4d
Added selected LSRK method to output
drreynolds Jan 30, 2026
3a17b8d
Merge branch 'feature/fes-preallocate' into feature/fes-get-stage-index
drreynolds Jan 30, 2026
16fb324
Python bindings
drreynolds Jan 30, 2026
aadbd25
Merge branch 'feature/fes-preallocate' into feature/fes-get-stage-index
drreynolds Jan 30, 2026
29c3bea
Fixed approach for various 'stageinfo' unit tests to share the stagei…
drreynolds Jan 30, 2026
81c3da9
Updated answers submodule commit
drreynolds Jan 30, 2026
7f75283
Formatting
drreynolds Jan 30, 2026
75df6a6
Moved callback functions back into each 'stageinfo' test code file
drreynolds Jan 30, 2026
71b7a22
Adjusted declaration of callback functions to [hopefully] fix single …
drreynolds Jan 30, 2026
385dba9
Formatting
drreynolds Jan 30, 2026
42b9705
Updated answers submodule commit
drreynolds Jan 31, 2026
f4c679d
Updated ark_test_stageinfo_mristep.cpp to use fixed step sizes, since…
drreynolds Feb 3, 2026
19c521d
Updated .out files for Jenkins
drreynolds Feb 3, 2026
d3a001f
Merge branch 'feature/fes-preallocate' into feature/fes-get-stage-index
drreynolds Feb 3, 2026
be07fce
Merge branch 'feature/fes-preallocate' into feature/fes-get-stage-index
drreynolds Feb 3, 2026
c54305d
Merged with feature/fes-preallocate
drreynolds Feb 3, 2026
1c1d31c
Updated stageinfo output files due to the new default numbers of stag…
drreynolds Feb 3, 2026
398bb51
Merge branch 'feature/fes-preallocate' into feature/fes-get-stage-index
drreynolds Feb 3, 2026
be71924
Updated stageinfo output files due to the addition of preprocess-rhs …
drreynolds Feb 3, 2026
00f5c8e
Merged with feature/fes-preallocate
drreynolds Feb 4, 2026
105c791
Merge branch 'feature/fes-preallocate' into feature/fes-get-stage-index
drreynolds Feb 4, 2026
3db727e
Ensured that we separately test stageinfo output for SSP(s,3) with s=…
drreynolds Feb 4, 2026
6c3e883
Merge branch 'feature/fes-preallocate' into feature/fes-get-stage-index
drreynolds Feb 4, 2026
51074ac
Merge branch 'feature/fes-preallocate' into feature/fes-get-stage-index
drreynolds Feb 4, 2026
e80d380
Merge branch 'feature/fes-preallocate' into feature/fes-get-stage-index
drreynolds Feb 4, 2026
cdb40b6
Merge branch 'feature/fes-preallocate' into feature/fes-get-stage-index
drreynolds Feb 4, 2026
4173e5a
Merge branch 'feature/fes-preallocate' into feature/fes-get-stage-index
drreynolds Feb 10, 2026
18fba67
Merge branch 'feature/fes-preallocate' into feature/fes-get-stage-index
drreynolds Feb 10, 2026
e52eda4
Fixed locations for stage index updates in SSP(4,3)
drreynolds Feb 11, 2026
c476279
Merge branch 'feature/fes-preallocate' into feature/fes-get-stage-index
drreynolds Feb 11, 2026
22c6db0
Merge branch 'feature/fes-preallocate' into feature/fes-get-stage-index
drreynolds Feb 11, 2026
806a86a
Standardized when the stage index is incremented
drreynolds Feb 11, 2026
01b6769
Merge branch 'feature/fes-preallocate' into feature/fes-get-stage-index
drreynolds Feb 11, 2026
6bb0f61
Merge branch 'feature/fes-preallocate' into feature/fes-get-stage-index
drreynolds Feb 12, 2026
b4eda02
Merge branch 'feature/fes-preallocate' into feature/fes-get-stage-index
drreynolds Feb 12, 2026
750deb4
Merged with feature/fes-preallocate
drreynolds Feb 12, 2026
545a29f
Merged with feature/fes-preallocate
drreynolds Feb 12, 2026
657e712
Added algorithm flow for step and stage processing functions
drreynolds Feb 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

Multiple minor updates were made to the ARKODE package. We removed an extraneous
copy of the output vector when using ARKODE in `ARK_ONE_STEP` mode. We added the
function `ARKodeGetStageIndex` that returns the index of the stage currently
being processed, and the total number of stages in the method, for users who must
compute auxiliary quantities in their IVP right-hand side functions during some
stages and not others (e.g., in all but the first or last stage). We added the
function `ARKodeAllocateInternalData` to ARKODE to enable stage-related
data allocation before the first call to `ARKodeEvolve` (but after all other
optional input routines have been called), to support users who measure memory
Expand Down
54 changes: 54 additions & 0 deletions bindings/sundials4py/arkode/arkode_generated.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,26 @@ m.def("ARKodeGetReturnFlagName", ARKodeGetReturnFlagName, nb::arg("flag"));
m.def("ARKodeWriteParameters", ARKodeWriteParameters, nb::arg("arkode_mem"),
nb::arg("fp"));

m.def(
"ARKodeGetStageIndex",
[](void* arkode_mem) -> std::tuple<int, int, int>
{
auto ARKodeGetStageIndex_adapt_modifiable_immutable_to_return =
[](void* arkode_mem) -> std::tuple<int, int, int>
{
int stage_adapt_modifiable;
int max_stages_adapt_modifiable;

int r = ARKodeGetStageIndex(arkode_mem, &stage_adapt_modifiable,
&max_stages_adapt_modifiable);
return std::make_tuple(r, stage_adapt_modifiable,
max_stages_adapt_modifiable);
};

return ARKodeGetStageIndex_adapt_modifiable_immutable_to_return(arkode_mem);
},
nb::arg("arkode_mem"));

m.def(
"ARKodeGetNumExpSteps",
[](void* arkode_mem) -> std::tuple<int, long>
Expand Down Expand Up @@ -674,6 +694,40 @@ m.def(
},
nb::arg("arkode_mem"));

m.def(
"ARKodeGetLastTime",
[](void* arkode_mem) -> std::tuple<int, sunrealtype>
{
auto ARKodeGetLastTime_adapt_modifiable_immutable_to_return =
[](void* arkode_mem) -> std::tuple<int, sunrealtype>
{
sunrealtype tn_adapt_modifiable;

int r = ARKodeGetLastTime(arkode_mem, &tn_adapt_modifiable);
return std::make_tuple(r, tn_adapt_modifiable);
};

return ARKodeGetLastTime_adapt_modifiable_immutable_to_return(arkode_mem);
},
nb::arg("arkode_mem"));

m.def(
"ARKodeGetLastState",
[](void* arkode_mem) -> std::tuple<int, N_Vector>
{
auto ARKodeGetLastState_adapt_modifiable_immutable_to_return =
[](void* arkode_mem) -> std::tuple<int, N_Vector>
{
N_Vector state_adapt_modifiable;

int r = ARKodeGetLastState(arkode_mem, &state_adapt_modifiable);
return std::make_tuple(r, state_adapt_modifiable);
};

return ARKodeGetLastState_adapt_modifiable_immutable_to_return(arkode_mem);
},
nb::arg("arkode_mem"), "nb::rv_policy::reference", nb::rv_policy::reference);

m.def(
"ARKodeGetCurrentTime",
[](void* arkode_mem) -> std::tuple<int, sunrealtype>
Expand Down
394 changes: 277 additions & 117 deletions doc/arkode/guide/source/Usage/User_callable.rst

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions doc/shared/RecentChanges.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

Multiple minor updates were made to the ARKODE package. We removed an extraneous
copy of the output vector when using ARKODE in ``ARK_ONE_STEP`` mode. We added the
function :c:func:`ARKodeGetStageIndex` that returns the index of the stage currently
being processed, and the total number of stages in the method, for users who must
compute auxiliary quantities in their IVP right-hand side functions during some
stages and not others (e.g., in all but the first or last stage). We added the
function :c:func:`ARKodeAllocateInternalData` to ARKODE to enable stage-related
data allocation before the first call to :c:func:`ARKodeEvolve` (but after all other
optional input routines have been called), to support users who measure memory
Expand Down
5 changes: 5 additions & 0 deletions include/arkode/arkode.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ SUNDIALS_EXPORT int ARKodePrintAllStats(void* arkode_mem, FILE* outfile,
SUNOutputFormat fmt);
SUNDIALS_EXPORT char* ARKodeGetReturnFlagName(long int flag);
SUNDIALS_EXPORT int ARKodeWriteParameters(void* arkode_mem, FILE* fp);
SUNDIALS_EXPORT int ARKodeGetStageIndex(void* arkode_mem, int* stage,
int* max_stages);

/* Optional output functions (temporal adaptivity) */
SUNDIALS_EXPORT int ARKodeGetNumExpSteps(void* arkode_mem, long int* expsteps);
Expand All @@ -407,6 +409,9 @@ SUNDIALS_EXPORT int ARKodeGetAccumulatedError(void* arkode_mem,
/* Optional output functions (implicit solver) */
SUNDIALS_EXPORT int ARKodeGetNumLinSolvSetups(void* arkode_mem,
long int* nlinsetups);
SUNDIALS_EXPORT int ARKodeGetLastTime(void* arkode_mem, sunrealtype* tn);
SUNDIALS_EXPORT int ARKodeGetLastState(void* arkode_mem,
N_Vector* state); // nb::rv_policy::reference
SUNDIALS_EXPORT int ARKodeGetCurrentTime(void* arkode_mem, sunrealtype* tcur);
SUNDIALS_EXPORT int ARKodeGetCurrentState(void* arkode_mem,
N_Vector* state); // nb::rv_policy::reference
Expand Down
1 change: 1 addition & 0 deletions src/arkode/arkode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1585,6 +1585,7 @@ ARKodeMem arkCreate(SUNContext sunctx)
ark_mem->step_getnumnonlinsolviters = NULL;
ark_mem->step_getnumnonlinsolvconvfails = NULL;
ark_mem->step_getnonlinsolvstats = NULL;
ark_mem->step_getstageindex = NULL;
ark_mem->step_setforcing = NULL;
ark_mem->step_mem = NULL;
ark_mem->step_supports_adaptive = SUNFALSE;
Expand Down
4 changes: 4 additions & 0 deletions src/arkode/arkode_arkstep.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0,
ark_mem->step_getnumnonlinsolvconvfails = arkStep_GetNumNonlinSolvConvFails;
ark_mem->step_getnonlinsolvstats = arkStep_GetNonlinSolvStats;
ark_mem->step_setforcing = arkStep_SetInnerForcing;
ark_mem->step_getstageindex = arkStep_GetStageIndex;
ark_mem->step_supports_adaptive = SUNTRUE;
ark_mem->step_supports_implicit = SUNTRUE;
ark_mem->step_supports_massmatrix = SUNTRUE;
Expand Down Expand Up @@ -1711,6 +1712,9 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr)
*nflagPtr = ARK_SUCCESS;
}

/* initialize the current stage index */
step_mem->istage = 0;

/* call nonlinear solver setup if it exists */
if (step_mem->NLS)
{
Expand Down
1 change: 1 addition & 0 deletions src/arkode/arkode_arkstep_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ void arkStep_Free(ARKodeMem ark_mem);
void arkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile);
int arkStep_SetInnerForcing(ARKodeMem ark_mem, sunrealtype tshift,
sunrealtype tscale, N_Vector* f, int nvecs);
int arkStep_GetStageIndex(ARKodeMem ark_mem, int* stage, int* max_stages);

/* Internal utility routines */
int arkStep_AccessARKODEStepMem(void* arkode_mem, const char* fname,
Expand Down
20 changes: 20 additions & 0 deletions src/arkode/arkode_arkstep_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,26 @@ int arkStep_GetNonlinSolvStats(ARKodeMem ark_mem, long int* nniters,
return (ARK_SUCCESS);
}

/*---------------------------------------------------------------
arkStep_GetStageIndex:

Returns the current stage index and number of stages
---------------------------------------------------------------*/
int arkStep_GetStageIndex(ARKodeMem ark_mem, int* stage, int* max_stages)
{
ARKodeARKStepMem step_mem;
int retval;

/* access ARKodeARKStepMem structure */
retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem);
if (retval != ARK_SUCCESS) { return (retval); }

*stage = step_mem->istage;
*max_stages = step_mem->stages;

return (ARK_SUCCESS);
}

/*---------------------------------------------------------------
arkStep_PrintAllStats:

Expand Down
8 changes: 8 additions & 0 deletions src/arkode/arkode_erkstep.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx)
ark_mem->step_getnumrhsevals = erkStep_GetNumRhsEvals;
ark_mem->step_getestlocalerrors = erkStep_GetEstLocalErrors;
ark_mem->step_setforcing = erkStep_SetInnerForcing;
ark_mem->step_getstageindex = erkStep_GetStageIndex;
ark_mem->step_supports_adaptive = SUNTRUE;
ark_mem->step_supports_relaxation = SUNTRUE;
ark_mem->step_mem = (void*)step_mem;
Expand Down Expand Up @@ -364,6 +365,7 @@ void erkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile)
/* output integer quantities */
fprintf(outfile, "ERKStep: q = %i\n", step_mem->q);
fprintf(outfile, "ERKStep: p = %i\n", step_mem->p);
fprintf(outfile, "ERKStep: istage = %i\n", step_mem->istage);
fprintf(outfile, "ERKStep: stages = %i\n", step_mem->stages);

/* output long integer quantities */
Expand Down Expand Up @@ -770,6 +772,9 @@ int erkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr)
cvals = step_mem->cvals;
Xvecs = step_mem->Xvecs;

/* initialize the current stage index */
step_mem->istage = 0;

SUNLogInfo(ARK_LOGGER, "begin-stages-list", "stage = 0, tcur = " SUN_FORMAT_G,
ark_mem->tcur);
SUNLogExtraDebugVec(ARK_LOGGER, "stage", ark_mem->yn, "z_0(:) =");
Expand Down Expand Up @@ -888,6 +893,9 @@ int erkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr)
}
}

/* update current stage index */
step_mem->istage = is;

/* apply user-supplied stage preprocessing function (if supplied) */
if (ark_mem->PreProcessRHS != NULL)
{
Expand Down
2 changes: 2 additions & 0 deletions src/arkode/arkode_erkstep_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ typedef struct ARKodeERKStepMemRec
N_Vector* F; /* explicit RHS at each stage */
int q; /* method order */
int p; /* embedding order */
int istage; /* current stage */
int stages; /* number of stages */
ARKodeButcherTable B; /* ERK Butcher table */

Expand Down Expand Up @@ -106,6 +107,7 @@ int erkStep_GetNumRhsEvals(ARKodeMem ark_mem, int partition_index,
int erkStep_GetEstLocalErrors(ARKodeMem ark_mem, N_Vector ele);
int erkStep_SetInnerForcing(ARKodeMem ark_mem, sunrealtype tshift,
sunrealtype tscale, N_Vector* f, int nvecs);
int erkStep_GetStageIndex(ARKodeMem ark_mem, int* stage, int* max_stages);

/* Internal utility routines */
int erkStep_AccessARKODEStepMem(void* arkode_mem, const char* fname,
Expand Down
20 changes: 20 additions & 0 deletions src/arkode/arkode_erkstep_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,26 @@ int erkStep_GetEstLocalErrors(ARKodeMem ark_mem, N_Vector ele)
return (ARK_SUCCESS);
}

/*---------------------------------------------------------------
erkStep_GetStageIndex:

Returns the current stage index and number of stages
---------------------------------------------------------------*/
int erkStep_GetStageIndex(ARKodeMem ark_mem, int* stage, int* max_stages)
{
ARKodeERKStepMem step_mem;
int retval;

/* access ARKodeARKStepMem structure */
retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem);
if (retval != ARK_SUCCESS) { return (retval); }

*stage = step_mem->istage;
*max_stages = step_mem->stages;

return (ARK_SUCCESS);
}

/*---------------------------------------------------------------
erkStep_PrintAllStats:

Expand Down
3 changes: 3 additions & 0 deletions src/arkode/arkode_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ typedef int (*ARKTimestepSetUseCompensatedSums)(ARKodeMem ark_mem,
sunbooleantype onoff);
typedef int (*ARKTimestepSetOptions)(ARKodeMem ark_mem, int* argidx, char* argv[],
size_t offset, sunbooleantype* arg_used);
typedef int (*ARKTimestepGetStageIndex)(ARKodeMem ark_mem, int* stage,
int* max_stages);

/* time stepper interface functions -- temporal adaptivity */
typedef int (*ARKTimestepGetEstLocalErrors)(ARKodeMem ark_mem, N_Vector ele);
Expand Down Expand Up @@ -423,6 +425,7 @@ struct ARKodeMemRec
ARKTimestepSetStepDirection step_setstepdirection;
ARKTimestepSetUseCompensatedSums step_setusecompensatedsums;
ARKTimestepSetOptions step_setoptions;
ARKTimestepGetStageIndex step_getstageindex;

/* Time stepper module -- temporal adaptivity */
sunbooleantype step_supports_adaptive;
Expand Down
72 changes: 72 additions & 0 deletions src/arkode/arkode_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2569,6 +2569,46 @@ int ARKodeGetEstLocalErrors(void* arkode_mem, N_Vector ele)
}
}

/*---------------------------------------------------------------
ARKodeGetLastTime:

Returns the last saved value of the independent variable
---------------------------------------------------------------*/
int ARKodeGetLastTime(void* arkode_mem, sunrealtype* tn)
{
ARKodeMem ark_mem;
if (arkode_mem == NULL)
{
arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__,
MSG_ARK_NO_MEM);
return (ARK_MEM_NULL);
}
ark_mem = (ARKodeMem)arkode_mem;

*tn = ark_mem->tn;
return (ARK_SUCCESS);
}

/*---------------------------------------------------------------
ARKodeGetLastState:

Returns the last saved time step solution.
---------------------------------------------------------------*/
int ARKodeGetLastState(void* arkode_mem, N_Vector* yn)
{
ARKodeMem ark_mem;
if (arkode_mem == NULL)
{
arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__,
MSG_ARK_NO_MEM);
return (ARK_MEM_NULL);
}
ark_mem = (ARKodeMem)arkode_mem;

*yn = ark_mem->yn;
return (ARK_SUCCESS);
}

/*---------------------------------------------------------------
ARKodeGetCurrentTime:

Expand Down Expand Up @@ -3184,6 +3224,38 @@ int ARKodeGetUserData(void* arkode_mem, void** user_data)
return (ARK_SUCCESS);
}

/*---------------------------------------------------------------
ARKodeGetStageIndex:

Returns the index of the current stage and the total number of
stages. If this is not supplied by the time-stepping module
then it returns (0,1), indicating that it is currently in the
first of only a single stage.
---------------------------------------------------------------*/
int ARKodeGetStageIndex(void* arkode_mem, int* stage, int* max_stages)
{
ARKodeMem ark_mem;
if (arkode_mem == NULL)
{
arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__,
MSG_ARK_NO_MEM);
return (ARK_MEM_NULL);
}
ark_mem = (ARKodeMem)arkode_mem;

/* Call stepper routine to compute the state (if provided) */
if (ark_mem->step_getstageindex)
{
return (ark_mem->step_getstageindex(ark_mem, stage, max_stages));
}
else
{
*stage = 0;
*max_stages = 1;
return (ARK_SUCCESS);
}
}

/*-----------------------------------------------------------------
ARKodePrintAllStats

Expand Down
Loading
Loading