xcompact3d / x3d2

https://xcompact3d.github.io/x3d2
BSD 3-Clause "New" or "Revised" License
3 stars 4 forks source link

Create a general interface for the time integrator #92

Open CFD-Xing opened 3 months ago

CFD-Xing commented 3 months ago

Currently, the time integrator takes seven arguments as follow

time_integrator%step(u, v, w, du, dv, dw, dt)

We should consider instead to create a general interface taking flist_t as arguments such that the time integrator can be used for an arbitrary number of variables

time_integrator%step(sol, deriv, dt)

This will also simply the addition of unit test for the time integrator

EDIT:

We should also consider to generalize the method member variable to consider various type of integration techniques (AB, RK, IMEX, etc.)

semi-h commented 3 months ago

I think it sounds good, we can also do a sanity check to make sure nvars of time_integrator matches with the list sizes.

It would be great if we could do

call time_integrator%step([u, v, w], [du, dv, dw], dt)

But I guess Fortran won't allow this, right? Array of pointer stuff in Fortran is a bit weird.

Then we'll have to dynamically assign them to lists in run and pass the lists, but I think it is okay.