FourierFlows / FourierFlows.jl

Tools for building fast, hackable, pseudospectral partial differential equation solvers on periodic domains
https://bit.ly/FourierFlows
MIT License
202 stars 29 forks source link

Extra substep in ETDRK4 #314

Closed cnrrobertson closed 2 years ago

cnrrobertson commented 2 years ago

Thanks for an excellent package. I've really enjoyed using it and appreciate all the work you've put into it.

I noticed while comparing the ETDRK4 implementation to my own that there is an extra substep here.

Specifically, it seems that only one of ETDRK4substep12!(ts.sol₁, ts.exp½Ldt, sol, ts.ζ, ts.N₁) or @. ts.sol₁ = ts.exp½Ldt * sol + ts.ζ * ts.N₁ is needed. Removing either passes the tests.

Happy to submit a PR if its helpful.

navidcy commented 2 years ago

Indeed, at first glance seems like https://github.com/FourierFlows/FourierFlows.jl/blob/c6c041c60ff02854d76c91880224c039b9e8e216/src/timesteppers.jl#L374 is redundant.

Open a PR -- that'd be great!

cnrrobertson commented 2 years ago

Great. See #315