SKopecz / PositiveIntegrators.jl

A Julia library of positivity-preserving time integration methods
https://skopecz.github.io/PositiveIntegrators.jl/
MIT License
13 stars 4 forks source link

Choice of interpolations #52

Closed ranocha closed 1 month ago

ranocha commented 5 months ago

We should discuss the choice of interpolations used for continuous output. Right now, we evaluate the classical ODE RHS at the end of a step to get a third-order Hermite interpolation, e.g.,

https://github.com/SKopecz/PositiveIntegrators.jl/blob/2aff3427935d7141dae66d452919f61fdc62e291/src/mprk.jl#L159

https://github.com/SKopecz/PositiveIntegrators.jl/blob/2aff3427935d7141dae66d452919f61fdc62e291/src/mprk.jl#L202

https://github.com/SKopecz/PositiveIntegrators.jl/blob/2aff3427935d7141dae66d452919f61fdc62e291/src/mprk.jl#L370

https://github.com/SKopecz/PositiveIntegrators.jl/blob/2aff3427935d7141dae66d452919f61fdc62e291/src/mprk.jl#L444

This is inefficient (since we don't need this value for anything else). Moreover, it does not guarantee positivity of the interpolation.

ranocha commented 5 months ago

For now, I changed the code to linear interpolations in #62. That's fine for now since we only have MPE and MPRK22, i.e., a first- and a second-order method. Linear interpolations do not degrade the accuracy order of the dense output in this case. This also improves the performance of the methods. However, we should revisit this issue when we implement third-order methods.