Skip to content

Feature: User-callable routine to retrieve the current stage index#819

Merged
gardner48 merged 141 commits intofeature/fes-stagingfrom
feature/fes-get-stage-index
Apr 2, 2026
Merged

Feature: User-callable routine to retrieve the current stage index#819
gardner48 merged 141 commits intofeature/fes-stagingfrom
feature/fes-get-stage-index

Conversation

@drreynolds
Copy link
Copy Markdown
Collaborator

@drreynolds drreynolds commented Jan 20, 2026

This PR adds 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). It also adds functions to retrieve the last saved state (yn) and the corresponding time (tn).

@drreynolds
Copy link
Copy Markdown
Collaborator Author

This is the sixth (and last) in a sequence of PRs for ARKODE to support our FES collaborators. Please review this one after #818. When the stack is complete, we'll do a final PR into develop

@gardner48 gardner48 added this to the SUNDIALS Next milestone Jan 20, 2026
@manauref
Copy link
Copy Markdown

A data point: I've tested this in combination with

ARKodeSetPreprocessRHSFn
ARKodeSetPostprocessStageFn
ARKodeSetPostprocessStepFailFn

in Gkeyll and it seems to work fine.

Copy link
Copy Markdown
Member

@gardner48 gardner48 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • A minor inconsistency between the istage value and the logging output in SSP104 (istage = 5 ends early and the logging for istage = 9 and istage = 10 is combined)
  • A minor issue in MRIStep where istage has the same value for the final stage and embedding
  • Suggestions to consistently refer to a stage by its index instead of count in LSRKStep comments
  • Small doc and other suggestions

Comment thread doc/arkode/guide/source/Mathematics.rst Outdated
Comment thread src/arkode/arkode_io.c Outdated
Comment thread src/arkode/arkode_lsrkstep.c Outdated
Comment thread src/arkode/arkode_lsrkstep.c Outdated
Comment thread src/arkode/arkode_lsrkstep.c Outdated
Comment thread src/arkode/arkode_lsrkstep.c Outdated
Comment thread src/arkode/arkode_lsrkstep.c Outdated
Comment thread src/arkode/arkode_lsrkstep.c
Comment thread src/arkode/arkode_mristep.c Outdated
Comment thread src/arkode/arkode_mristep_io.c
@drreynolds
Copy link
Copy Markdown
Collaborator Author

@gardner48: I've addressed all your PR comments, taking action on all but one, where instead I explained why I'd like to keep it as-is. If you're good with that explanation, then once this passes the CI I think it's ready to approve.

(It's possible that some of these PR revisions might adjust some of the logging output, so it could take a few commits to resolve CI testing).

Base automatically changed from feature/fes-preallocate to feature/fes-staging April 2, 2026 14:24
Copy link
Copy Markdown
Member

@gardner48 gardner48 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor logging fix and a suggestion to note that istage is slightly different in MRIStep

Comment thread src/arkode/arkode_lsrkstep.c Outdated
Comment thread src/arkode/arkode_lsrkstep.c Outdated
Comment thread src/arkode/arkode_mristep.c Outdated
Copy link
Copy Markdown
Member

@gardner48 gardner48 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just waiting on the CI now

@drreynolds
Copy link
Copy Markdown
Collaborator Author

Strangely, that previous litgen CI failure is resurfacing periodically.

@gardner48 gardner48 merged commit 950e1bc into feature/fes-staging Apr 2, 2026
61 checks passed
@gardner48 gardner48 deleted the feature/fes-get-stage-index branch April 2, 2026 22:51
gardner48 added a commit that referenced this pull request Apr 3, 2026
…ies, LSRKStep updates, Preallocate, GetStageIndex) (#897)

Combined updates from several PRs:
* #813: step pre/post functions, stage postprocessing, and pre RHS
functions
* #814: removed an extraneous copy of `yn` into `yout` when running in
ONE_STEP mode for ARKODE
* #815: various cleanup to the LSRKStep module
* #819: user-callable routine to retrieve the current stage index
* #886: user-callable `ARKodeInit` routine to finalize ARKODE and
allocate remaining memory before `ARKodeEvolve` is called

---------

Co-authored-by: David Gardner <gardner48@llnl.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants