Feature/stageprocessing #813
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds step preprocessing, failed-step postprocessing, and stage RHS preprocessing to ARKODE.
While existing support for stage and step postprocessing has been useful for some advanced collaborator codes, the lack of symmetry increases challenges when applications must compute auxiliary data (e.g., solving Poisson equations for a potential field) but want do not wish to do this more than absolutely necessary. Additionally, when a step fails our existing step postprocessing is not called, eliminating the possibility for applications to rewind auxiliary data to the previous "accepted" step values.
As with previous postprocessing support, these should be considered advanced/experimental features. As such, they are not advertised in the SUNDIALS documentation
Step preprocessing vs postprocessing
The fundamental difference between these is when the processing routine is called inside the ARKODE time-stepping loop. It is unlikely that a user would use both, but this allows them to more precisely place their processing function.
Stage RHS preprocessing vs stage postprocessing
Stage RHS preprocessing occurs just prior to any set of RHS calls that would use an identical state (e.g., if both explicit and implicit RHS functions would be called on the same input), allowing auxiliary data (e.g., MPI exchange buffers) to be reused in both calls.
On the other hand, stage postprocessing is called just after updating the current stage solution.
Again, it is unlikely that a user would leverage both in the same application, but this allows increased precision over the timings when they are performed.