LLNL / sundials

Official development repository for SUNDIALS - a SUite of Nonlinear and DIfferential/ALgebraic equation Solvers. Pull requests are welcome for bug fixes and minor changes.
https://computing.llnl.gov/projects/sundials
BSD 3-Clause "New" or "Revised" License
522 stars 130 forks source link

Feature/operator splitting #572

Open Steven-Roberts opened 2 months ago

Steven-Roberts commented 1 month ago

In preparation of #587 being merged, I'm wondering how to best count RHS evals. Currently, it can't be accessed through the SUNStepper API, and for some implementations, e.g., exact solution, no RHS may even be used. I see two options:

I suppose I favor the first option. Anyone else have ideas or preferences?

drreynolds commented 1 month ago

In preparation of #587 being merged, I'm wondering how to best count RHS evals. Currently, it can't be accessed through the SUNStepper API, and for some implementations, e.g., exact solution, no RHS may even be used. I see two options:

  • Add new SUNStepper_SetGetNumRhsEvalsFn and SUNStepper_GetNumRhsEvals functions and use these in ARKodeGetNumRhsEvals
  • Have ARKodeGetNumRhsEvals return an error or 0 evals.

I suppose I favor the first option. Anyone else have ideas or preferences?

I think that you could leave it out entirely, and ARKODE will then return an error that the function is unsupported. If a user creates the SUNStepper components out of SUNDIALS integrators, then they can get the number of RHS evaluations for each component through those directly, and if they provide their own SUNStepper, then they can query that if they want to know what happened internally.

Steven-Roberts commented 1 month ago

I think that you could leave it out entirely, and ARKODE will then return an error that the function is unsupported.

Ok, that sounds reasonable. On further consideration, my original idea of getting RHS evals from the SUNStepper becomes very complicated if nested partitioning is used. Probably best to avoid that.

balos1 commented 2 weeks ago

LGTM. Ill leave it to others to chime in on anything else.