ExplicitTerm Derived Type

type, public, abstract, extends(Term) :: ExplicitTerm

Abstract term providing basic interfaces for build terms used in explicit timestepping


Components

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

True only if user explicitly sets it to true

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

Multiplicative constant with size conforming to the variable being evolved

real(kind=rk), private :: normalizationConst = real(1.0d0, kind=rk)

Normalization constant of this term

type(ExplicitTermIndexingData), private :: indexingData

Indexing data used by this term

class(Operator), private, allocatable :: termOperator

Optional operator used by this term


Type-Bound Procedures

procedure, public :: isDefined => isDefinedObject

  • interface

    private pure module function isDefinedObject(this) result(defined)

    Getter for userDefined

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(in) :: this

    Return Value logical

procedure, public :: makeDefined => makeDefinedObject

  • interface

    private pure module subroutine makeDefinedObject(this)

    Set userDefined to .true.

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(inout) :: this

procedure, public :: makeUndefined => makeUndefinedObject

  • interface

    private pure module subroutine makeUndefinedObject(this)

    Set userDefined to .false.

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(inout) :: this

procedure, public :: setOperator

  • interface

    private pure module subroutine setOperator(this, op)

    Setter for termOperator

    Arguments

    Type IntentOptional Attributes Name
    class(ExplicitTerm), intent(inout) :: this
    class(Operator), intent(in) :: op

procedure, public :: setNormalizationConst

  • interface

    private pure module subroutine setNormalizationConst(this, norm)

    Setter for normalizationConst

    Arguments

    Type IntentOptional Attributes Name
    class(ExplicitTerm), intent(inout) :: this
    real(kind=rk), intent(in) :: norm

procedure, public :: getNormalizationConst

  • interface

    private pure module function getNormalizationConst(this) result(norm)

    Getter for normalizationConst

    Arguments

    Type IntentOptional Attributes Name
    class(ExplicitTerm), intent(in) :: this

    Return Value real(kind=rk)

procedure, public :: setReqVars

  • interface

    private pure module subroutine setReqVars(this, reqVars, varCont)

    Set variable names required by the multiplicative function and find their indices in variable container

    Arguments

    Type IntentOptional Attributes Name
    class(ExplicitTerm), intent(inout) :: this
    type(StringArray), intent(in), dimension(:) :: reqVars
    type(VariableContainer), intent(in) :: varCont

procedure, public :: setEvolvedAndOperatedVar

  • interface

    private pure module subroutine setEvolvedAndOperatedVar(this, evolvedVarName, operatedVarName)

    Set evolved and operated (if applicable) variable names

    Arguments

    Type IntentOptional Attributes Name
    class(ExplicitTerm), intent(inout) :: this
    character(len=*), intent(in) :: evolvedVarName
    character(len=*), intent(in), optional :: operatedVarName

procedure, public :: evaluate => evaluateExpTerm

  • interface

    private pure module function evaluateExpTerm(this, varCont) result(res)

    Evaluates the term as multConst * multFun [* operatorTerm%actOn()] depending on whether the Operator is allocated

    Arguments

    Type IntentOptional Attributes Name
    class(ExplicitTerm), intent(in) :: this
    type(VariableContainer), intent(in) :: varCont

    Return Value real(kind=rk), allocatable, dimension(:)

procedure, public :: getMultConst

  • interface

    private pure module function getMultConst(this) result(multConst)

    Getter for multConst

    Arguments

    Type IntentOptional Attributes Name
    class(ExplicitTerm), intent(in) :: this

    Return Value real(kind=rk), allocatable, dimension(:)

procedure, public :: setMultConst

  • interface

    private pure module subroutine setMultConst(this, multConst)

    Setter for multConst

    Arguments

    Type IntentOptional Attributes Name
    class(ExplicitTerm), intent(inout) :: this
    real(kind=rk), intent(in), dimension(:) :: multConst

procedure, private :: multFun => unityFun

  • interface

    private pure module function unityFun(this, varCont, indexingData) result(res)

    Default multiplicative function - returns a real vector of ones based on evolvedVarName. In general should use passed variable container and indexing data to construct a vector conforming to the evolved variable

    Arguments

    Type IntentOptional Attributes Name
    class(ExplicitTerm), intent(in) :: this
    type(VariableContainer), intent(in) :: varCont
    type(ExplicitTermIndexingData), intent(in) :: indexingData

    Return Value real(kind=rk), allocatable, dimension(:)

procedure, public :: update => simpleUpdate

  • interface

    private module subroutine simpleUpdate(this, varCont, modelData, hostModel)

    Default update function - just calls update on Operator if allocated

    Arguments

    Type IntentOptional Attributes Name
    class(ExplicitTerm), intent(inout) :: this
    type(VariableContainer), intent(in) :: varCont

    Variable container used in update

    class(ModelboundData), intent(in), optional :: modelData

    Reference model data - unused

    class(ModelSurrogate), intent(in), optional :: hostModel

    Host model - unused

procedure, public :: getVarName => getEvolvedVarName

  • interface

    private pure module function getEvolvedVarName(this) result(name)

    Get name of the evolved variable of this term

    Arguments

    Type IntentOptional Attributes Name
    class(ExplicitTerm), intent(in) :: this

    Return Value character(len=:), allocatable