FluidNumerics / FluidNumerics/SELF
Add support for dynamic time integrators and riemann solvers
- Dominant language
- Fortran
- Stars
- 92
- Forks
- 13
- Avg merge
- 20h 38m
- Merged PRs (30d)
- 7
Description
**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. The `SELF_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 like
```
! Set the time integrator
this % TimeIntegrator => SELF_RK3()
! Set the Riemann Solver
this % RiemannSolver => SELF_LocalLaxFriedrichs_CompressibleIdealGas()
```
https://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](https://riptutorial.com/fortran/example/11869/referencing-a-procedure)
Contributor guide
Assessment
This issue has not been assessed yet.