rk_schemes Module

A small helper module for storing and providing RK schemes


Contents


Variables

Type Visibility Attributes Name Initial
type(rk_scheme_id_type), public, parameter :: rk_dopri = rk_scheme_id_type(id=1, name='dopri')

Dormand-Prince 45 method

type(rk_scheme_id_type), public, parameter :: rk_f45 = rk_scheme_id_type(id=2, name='rkf45')

Runge-Kutta-Fehlberg 45 method

type(rk_scheme_id_type), public, parameter :: rk_cashkarp = rk_scheme_id_type(id=3, name='cashkarp')

Cash-Karp 45 method

type(rk_scheme_id_type), public, parameter :: rk_heun = rk_scheme_id_type(id=4, name='heun')

Heun-Euler 12 method

type(rk_scheme_id_type), public, parameter :: rk_ralston = rk_scheme_id_type(id=5, name='ralston')

Ralston-Euler 12 method

type(rk_scheme_id_type), public, parameter :: rk_midpoint = rk_scheme_id_type(id=6, name='midpoint')

Midpoint-Euler 12 method

type(rk_scheme_id_type), public, parameter :: rk_bs23 = rk_scheme_id_type(id=7, name='bs23')

Bogacki-Shampine 23 method

type(rk_scheme_id_type), public, parameter :: rk_bs45 = rk_scheme_id_type(id=8, name='bs45')

Bogacki-Shampine 45 method

type(rk_scheme_id_type), public, parameter :: rk_euler = rk_scheme_id_type(id=9, name='euler')

Single step Euler


Derived Types

type, private ::  rk_scheme_id_type

Internal named type to represent scheme ids

Components

Type Visibility Attributes Name Initial
integer, private :: id
character(len=30), private :: name

type, public ::  rk_scheme_type

Public type storing the data for a particular RK scheme

Components

Type Visibility Attributes Name Initial
integer, public :: number_of_stages
integer, public :: order
character(len=30), public :: name
real, public, dimension(:), allocatable :: lower_order_coeffs
real, public, dimension(:), allocatable :: high_order_coeffs
real, public, dimension(:), allocatable :: time_points
real, public, dimension(:, :), allocatable :: coeffs
logical, public :: follow_high_order

Type-Bound Procedures

procedure , public , :: validate => rk_scheme_validate Function

Functions

public pure function get_rk_schemes_as_text_options() result(options)

Returns an array of text_option values representing the known rk schemes, mapping names to integer ids

Arguments

None

Return Value type(text_option), dimension(:), allocatable

public function get_rk_scheme_by_id(id) result(scheme)

Returns an rk_scheme instance describing the scheme with id matching the passed id value.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: id

Return Value type(rk_scheme_type)

public function get_rk_scheme(variant) result(scheme)

Returns an rk_scheme instance describing the scheme represented by the passed variant type.

Arguments

Type IntentOptional Attributes Name
type(rk_scheme_id_type), intent(in) :: variant

Return Value type(rk_scheme_type)

private pure function rk_scheme_validate(self) result(valid)

Perform a small check of the consistency. Returns an error code built from bitwise flags to give information about which checks, if any, failed. Success is repesented by zero.

Arguments

Type IntentOptional Attributes Name
class(rk_scheme_type), intent(in) :: self

Return Value integer