simple_timestep_controller_class Module

Houses simple timestep controller which uses the min (max) value of a product of variables, scaled to corresponding powers



Interfaces

interface

  • private module function evaluateTimestepSimple(this, inputVars, currentTimestep) result(timestep)

    Calculate timestep as min(max) of variable product

    Arguments

    Type IntentOptional Attributes Name
    class(SimpleTimestepController), intent(inout) :: this
    class(VariableContainer), intent(in) :: inputVars

    Variable container used to calculate timestep

    real(kind=rk), intent(in) :: currentTimestep

    Current timestep to be used if the controller rescales timesteps

    Return Value real(kind=rk)

interface

  • private module subroutine initSimpleTimestepController(this, mpiCont, varCont, reqVars, reqVarPowers, multConst, useMaxVal, rescaleTimestep)

    Simple timestep controller initialization routine

    Arguments

    Type IntentOptional Attributes Name
    class(SimpleTimestepController), intent(inout) :: this
    type(MPIController), intent(in) :: mpiCont

    Reference MPI controller

    type(VariableContainer), intent(in) :: varCont

    Reference variable container

    type(StringArray), intent(in), dimension(:) :: reqVars

    Required variable list

    real(kind=rk), intent(in), dimension(:) :: reqVarPowers

    Powers corresponding to required variables

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

    Normalization constant

    logical, intent(in), optional :: useMaxVal

    True if max value of product is used instead of min

    logical, intent(in), optional :: rescaleTimestep

    True if currentTimestep is rescaled using the calculated timestep value


Derived Types

type, public, extends(TimestepController) ::  SimpleTimestepController

Timestep controller that calculates the timestep using the min (max) value of a product of variables raised to corresponding powers. Variables are assumed fluid-like.

Components

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

True only if user explicitly sets it to true

type(MPIController), private :: mpiCont

Local copy of MPI controller used for allreduce calls

integer(kind=ik), private, allocatable, dimension(:) :: reqVarIndices

Indices of variables to be raised to a power and multiplied

real(kind=rk), private, allocatable, dimension(:) :: reqVarPowers

Powers corresponding to required variables

real(kind=rk), private :: multConst

Optional multiplicative const

logical, private :: useMaxVal

Use max value of product = false by default

logical, private :: rescaleTimestep

Multiply the calculated timestep with currentTimestep dummy argument in evaluateTimestep

Type-Bound Procedures

procedure, public :: isDefined => isDefinedObject
procedure, public :: makeDefined => makeDefinedObject
procedure, public :: makeUndefined => makeUndefinedObject
procedure, public :: init => initSimpleTimestepController
procedure, public :: evaluateTimestep => evaluateTimestepSimple