Skip to content

Adams Bashforth Schemes

Stefano Zaghi edited this page Aug 31, 2015 · 3 revisions

Considering the following ODE system:

IVP

where Ut = dU/dt, U is the vector of state variables being a function of the time-like independent variable t, R is the (vectorial) residual function, the Adams-Bashforth (AB) class scheme implemented is:

Adams-Bashforth

where s is the number of time steps (levels) used for the ODEs integration. The class of schemes provided is explicit, and it is ready to be used when the number of time steps is selected.

Adams-Bashforth schemes available

The current implementation is based on the wikipedia reference.

1 step

Selecting 1 step the AB scheme reverts back to the explicit Euler one, it being 1st order accurate. The b coefficient is b=1 and the scheme is:

Euler

2 steps

Selecting 2 steps the AB scheme is formally 2nd order accurate. The b coefficient are

Adams-Bashforth 2 steps b coeffs

The scheme is:

Adams-Bashforth 2 steps

3 steps

Selecting 3 steps the AB scheme is formally 3rd order accurate. The b coefficient are

Adams-Bashforth 3 steps b coeffs

The scheme is:

Adams-Bashforth 3 steps

FOODiE API

FOODiE exposes the adams_bashforth_integrator derived type that can be applied only to a valid concrete extension of the abstract type type_integrand.

The adams_bashforth_integrator type has 3 public methods:

  • destroy that destroys a previously initialized AB integrator;
  • init that initialized an AB integrator passing the number of time steps (levels) used;
  • integrate that actually integrates a type_integrand field (concrete extension) by means of the AB scheme selected.

A typical scenario for using an AB integrator is the following pseudo-code:

type(adams_bashforth_integrator) :: integrator ! the AB integrator
type(my_field)                   :: field      ! my_field is valid concrete extension of type_integrand
...
call integrator%init(steps=3)
...
do while(.not.finished)
  ...
  call integrator%integrate(field=field, steps=3, dt=0.01)
  ...
enddo

For a more detailed example see the tests suite sources.

Clone this wiki locally