Commit df9d63c5 authored by Jannis Teunissen's avatar Jannis Teunissen

Updates for time integration documentation

parent b0398c63
......@@ -14,6 +14,10 @@ New integrators can be added relatively easily by modifying the `af_advance` rou
## How to use
Time integration can be performed with a call to `m_af_advance::af_advance`.
## User-supplied forward Euler method
To use the built-in time integration, a `forward_euler` routine has to be
provided, see `m_af_advance::subr_feuler` for details. This routine will then
be used to construct the various time integration schemes.
......
......@@ -51,14 +51,21 @@ module m_af_advance
contains
!> Compute generic finite volume flux
!> Advance solution over dt using time_integrator
!>
!> The user should supply a forward Euler method as documented in subr_feuler.
!> The indices of the cell-centered variables that will be operated on should
!> also be provided, so that higher-order schemes can be constructed
!> automatically from the forward Euler method.
subroutine af_advance(tree, dt, dt_lim, time, i_cc, time_integrator, forward_euler)
type(af_t), intent(inout) :: tree
real(dp), intent(in) :: dt !< Current time step
real(dp), intent(out) :: dt_lim !< Time step limit
real(dp), intent(inout) :: time !< Current time
integer, intent(in) :: i_cc(:) !< Index of cell-centered variables
!> One of the pre-defined time integrators (e.g. af_heuns_method)
integer, intent(in) :: time_integrator
!> Forward Euler method provided by the user
procedure(subr_feuler) :: forward_euler
integer :: n_steps
......@@ -69,6 +76,7 @@ contains
error stop "Not enough copies available"
n_steps = af_advance_num_steps(time_integrator)
dt_lim = 1e100_dp
select case (time_integrator)
case (af_forward_euler)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment