Closed DanielDoehring closed 2 weeks ago
I originally implemented it like it is right now to simplify it as much as possible while keeping the option to use the same functionality we need from integrators provided by OrdinaryDiffEq.jl. I would be fine with these changes but @sloede needs to agree as well (since it makes the implementation more complex).
To be able to use custom integrators also for the cases you mentioned, we would need to specialize init
, solve!
etc. from https://github.com/SciML/CommonSolve.jl. This will be a real change since we use Trixi.solve
right now with custom time integrators instead of the common solve
version.
To be able to use custom integrators also for the cases you mentioned, we would need to specialize
init
,solve!
etc. from https://github.com/SciML/CommonSolve.jl. This will be a real change since we useTrixi.solve
right now with custom time integrators instead of the commonsolve
version.
I think if we would really want to use solve
from OrdinaryDiffEq.jl
a lot more would have to be implemented which I think is unnecessary (at least at the moment). Thus I would stick to the Trixi.solve
with the presented implementation.
But we would also need the same step!
function as OrdinaryDiffEq.jl without depending on OrdinaryDiffEq.jl - or some special handling in the functions where we use it
IIUC, you do not want to make the implementation much more complicated, but just refactor solve
and solve!
into init
and step!
, right? Thus, if you were to implement it as described above, maybe with one or two additional in-source comments that make it easier to understand for novices, I wouldn't be opposed.
To some extent, ime integration is black magic anyways, and not that many people need to deal with its nitty gritty details except when they need something special - and in that case, more modularity is probably helpful
IIUC, you do not want to make the implementation much more complicated, but just refactor
solve
andsolve!
intoinit
andstep!
, right?
Yes that is right!
Thus, if you were to implement it as described above, maybe with one or two additional in-source comments that make it easier to understand for novices, I wouldn't be opposed.
I actually think that the more explicit version could even be helpful in illustrating that not the ODE-Algorithm, but actually the ODE-Integrator actually solves the problem
While looking at the
elixir_euleracoustics_co-rotating_vortex_pair.jl
I noticed that this can only be run with the integrators fromOrdinaryDiffEq.jl
because theEulerAcousticsCouplingCallback
requires astep!
functionhttps://github.com/trixi-framework/Trixi.jl/blob/18aaae96035a995e840e4e262964e7b49fdd9325/src/callbacks_step/euler_acoustics_coupling.jl#L189 and an
init
functionhttps://github.com/trixi-framework/Trixi.jl/blob/18aaae96035a995e840e4e262964e7b49fdd9325/src/callbacks_step/euler_acoustics_coupling.jl#L129
which are not provided by the existing implementations.
We could, however, add these functions relatively easy, exemplified by
SimpleIntegrator2N
:Essentially, we would need to provide a
init
functionthat is essentially the current
solve
function with only the last line changedhttps://github.com/trixi-framework/Trixi.jl/blob/f10969548615547e520623a9fb351a41bd952065/src/time_integration/methods_2N.jl#L108-L133
Then, the
step!
function could be implemented aswhich is almost identical to the current
solve!
functionhttps://github.com/trixi-framework/Trixi.jl/blob/f10969548615547e520623a9fb351a41bd952065/src/time_integration/methods_2N.jl#L135-L193
For the version with
init
andstep
one could then implementsolve
aswhich behaves as before.