explicit_rk_integrator_class Module

Contains an explicit Runge-Kutta integrator class with the option to supply user Butcher tableaus


Used by


Interfaces

interface

  • private module subroutine integrateRK(this, manipulatedModeller, outputVars, inputVars)

    Implementation of abstract manipulate routine for the case of Runge-Kutta integrator

    Arguments

    Type IntentOptional Attributes Name
    class(ExplicitRKIntegrator), intent(inout) :: this
    class(ModellerSurrogate), intent(inout) :: manipulatedModeller

    Modeller to be used in callbacks during integration

    class(VariableContainer), intent(inout) :: outputVars

    VariableContainer object to store the integration output

    class(VariableContainer), intent(in) :: inputVars

    VariableContainer object housing input data for the integration routine

interface

  • private module subroutine initRKIntegrator(this, modelList, termGroups, order, tableau, evolvesTimeVar, dtController, initialTimestep)

    Constructs an RK integrator with initial evaluated model indices and correspoding term groups if those are present. If neither order or tableau are provided defaults to forward Euler time-stepping. Possible order values are 1,2,3,4 where 2 is the midpoint method, 3 is SSPRK3, and 4 is the standard RK4 method.

    Arguments

    Type IntentOptional Attributes Name
    class(ExplicitRKIntegrator), intent(inout) :: this
    integer(kind=ik), intent(in), optional, dimension(:) :: modelList

    List of models this integrator will be responsible for

    type(IntArray), intent(in), optional, dimension(:) :: termGroups

    Term groups this integrator is responsible for - should conform with modelList

    integer(kind=ik), intent(in), optional :: order

    Runge-Kutta order

    type(BTableau), intent(in), optional :: tableau

    User-defined Butcher tableau

    logical, intent(in), optional :: evolvesTimeVar

    Set to true if this integrator is allowed to change the "time" varible (if present in passed variable container)

    class(TimestepController), intent(in), optional :: dtController

    User-supplied timestep controller object

    real(kind=rk), intent(in), optional :: initialTimestep

    Default timestep


Derived Types

type, public ::  BTableau

Butcher tableau derived type

Components

Type Visibility Attributes Name Initial
type(RealArray), public, allocatable, dimension(:) :: a

Lower triangular matrix of coefficients

real(kind=rk), public, allocatable, dimension(:) :: b

Coefficients for summing over intermediate values

real(kind=rk), public, allocatable, dimension(:) :: c

Time coefficients

type, public, extends(Integrator) ::  ExplicitRKIntegrator

Explicit Runge-Kutta integrator

Components

Type Visibility Attributes Name Initial
logical, public :: userDefined = .false.

True only if user explicitly sets it to true

logical, public :: communicationNeeded

True if this Integrator requires MPI communication during evolution

type(CommunicationData), public :: commData

Communication data object for this Integrator

logical, public :: nonTrivialUpdate

True if this integrator should perform non-trivial updates of terms

logical, public :: nonTrivialModelDataUpdate

True if this integrator should perform non-trivial updates of model data

type(BTableau), private :: tableau

Butcher tableau used by the integrator

type(IntArray), private, allocatable, dimension(:) :: tableauANonzeros

Locations of non-zeros in the a_ij tableau matrix

type(RealArray), private, allocatable, dimension(:,:) :: intermediateValues

Buffer for intermediate RK values for various variables

type(VariableContainer), private, allocatable :: buffer

VariableContainer buffer for passing to Modeller routines

Type-Bound Procedures

procedure, public :: isDefined => isDefinedObject
procedure, public :: makeDefined => makeDefinedObject
procedure, public :: makeUndefined => makeUndefinedObject
procedure, public :: setTimestep
procedure, public :: getTimestep
procedure, public :: setTermGroups
procedure, public :: getTermGroups
procedure, public :: setModelIndices
procedure, public :: getModelIndices
procedure, public :: setTimeEvolving
procedure, public :: isTimeEvolving
procedure, public :: setTimestepController
procedure, public :: hasTimestepController
procedure, public :: getTimestepFromController
procedure, public :: isCommunicationNeeded
procedure, public :: setCommunicationNeeded
procedure, public :: getCommunicationData
procedure, public :: setCommunicationData
procedure, public :: getUpdateRules
procedure, public :: setUpdateRules
procedure, public :: getModelDataUpdateRules
procedure, public :: setModelDataUpdateRules
procedure, public :: hasNonTrivialUpdate
procedure, public :: setNonTrivialUpdate
procedure, public :: hasNonTrivialModelDataUpdate
procedure, public :: setNonTrivialModelDataUpdate
procedure, public :: affect => integrateRK
procedure, public :: init => initRKIntegrator