-
Notifications
You must be signed in to change notification settings - Fork 30
Adams Bashforth Schemes
Considering the following ODE system:
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:
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.
The current implementation is based on the wikipedia reference.
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:
Selecting 2 steps the AB scheme is formally 2nd order accurate. The b coefficient are
The scheme is:
Selecting 3 steps the AB scheme is formally 3rd order accurate. The b coefficient are
The scheme is:
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 atype_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.