Open fluidnumerics-joe opened 2 years ago
So far, this feature is working well for time integrators in the SELF_Model
class. Users can assign the time integrator using the model % timeIntegrator
procedure pointer attribute. I've added explicit integrators that are being verified ( AB2, AB3, AB4, RK2, RK4)
Is your feature request related to a problem? Please describe. For some models, like the shallow water equations or the compressible navier stokes, we want to have a suite of choices for the integrators, riemann solvers, or source terms.
Describe the solution you'd like To allow for dynamic selection of these methods within main programs, we can use procedure pointers as attributes in the
SELF_Model*
classes for these methods. TheSELF_Model
module can define all of the time integrators and default riemann solver methods that do nothing. The individual models (shallow water, compressible ideal gas, etc.) can define the suite of Riemann solvers that can be selected in main programs doing something likehttps://riptutorial.com/fortran/example/11869/referencing-a-procedure
Describe alternatives you've considered In the code we currently use an integer flag for the time integrator and a
SELECT CASE
block for running with the correct time integrator. As we add more integrators, we'll need to continue writing this boiler-plate code. With procedure pointers, we can write the subroutines, and simply allow for the user to assign the procedure pointer in their program.Additional context Procedure Pointers example