Skip to content

Adams Bashforth Schemes

Stefano Zaghi edited this page Oct 21, 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.

Available Adams-Bashforth schemes

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, dt=0.01)
  ...
enddo

In the above pseudo code example each time the call integrator%integrate(field=field...) statement is executed the field is integrated one time step over (of value dt=0.01) using the previous 3 time steps that must be stored (and handled) by the my_field type.

As for all FOODIE solvers, the key-point is the concrete extension of the abstract type type_integrand: once the user have properly defined his/her own extension the Adams-Bashforth class of solvers is ready to be used as above. For detailed examples of type_integrand concrete extensions see the wiki examples

For practical usage examples see the tests suite sources.

Clone this wiki locally