modeller_class Module

Houses modeller class responsible for controlling data manipulation and integration


Used by


Interfaces

interface

  • private pure module function isAssembled(this) result(assembled)

    Return true if modeller is assembled and ready to evolve variables

    Arguments

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

    Return Value logical

interface

  • private pure module function evaluateModelTermGroup(this, modelIndex, groupIndex, varCont) result(res)

    Call the evaluateTermGroup routine on model with given index and for given term group - optionally use variable container other than the one stored in the modeller

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(in) :: this
    integer(kind=ik), intent(in) :: modelIndex
    integer(kind=ik), intent(in) :: groupIndex
    type(VariableContainer), intent(in), optional :: varCont

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

interface

  • private pure module function evaluateModelTermByName(this, modelIndex, name, varCont) result(res)

    Call the evaluateTermByName routine on model with given index and for given term name - optionally use variable container other than the one stored in the modeller

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(in) :: this
    integer(kind=ik), intent(in) :: modelIndex
    character(len=*), intent(in) :: name
    type(VariableContainer), intent(in), optional :: varCont

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

interface

  • private pure module function isModelTermGroupMixed(this, groupIndex, modelIndex) result(mixed)

    Return true if group with given index is mixed in model with given index

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(in) :: this
    integer(kind=ik), intent(in) :: groupIndex
    integer(kind=ik), intent(in) :: modelIndex

    Return Value logical

interface

  • private pure module function getEvolvedVarInTermGroup(this, groupIndex, modelIndex) result(name)

    Return variable name for given group index and model index

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(in) :: this
    integer(kind=ik), intent(in) :: groupIndex
    integer(kind=ik), intent(in) :: modelIndex

    Return Value character(len=:), allocatable

interface

  • private pure module function getCurrentTime(this) result(time)

    Return current value of the integrator time variable if the integrator object is a composite integrator or the value of the "time" variable if it isn't

    Arguments

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

    Return Value real(kind=rk)

interface

  • private module function isTrueEverywhere(this, input) result(isTrue)

    Return true if input is true on every processor using the MPI controller of the modeller

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(inout) :: this
    logical, intent(inout) :: input

    Return Value logical

interface

  • private module function getGlobalMin(this, input) result(min)

    Return minimum value of real input computed on all processes using the MPI controller of the modeller

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(inout) :: this
    real(kind=rk), intent(inout) :: input

    Return Value real(kind=rk)

interface

  • private module function getGlobalMax(this, input) result(max)

    Return maximum value of real input computed on all processes using the MPI controller of the modeller

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(inout) :: this
    real(kind=rk), intent(inout) :: input

    Return Value real(kind=rk)

interface

  • private module subroutine initModeller(this, numModels, initVars, mpiCont, petscCont, commData)

    Modeller initialization routine

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(inout) :: this
    integer(kind=ik), intent(in) :: numModels

    Number of models this modeller expects to be added

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

    Initial variable container

    type(MPIController), intent(in) :: mpiCont

    Main MPIController

    type(PETScController), intent(in), optional :: petscCont

    Optional PETSc controller - should be supplied if any integration/manipulation routine uses PETSc

    type(CommunicationData), intent(in), optional :: commData

    Default MPI communication data

interface

  • private pure module subroutine addModel(this, newModel)

    Add a Model to this modeller

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(inout) :: this
    class(Model), intent(inout), allocatable :: newModel

interface

  • private pure module subroutine copyVarValuesFrom(this, varCont)

    Copy values of variables from outside variable container into this modeller's container

    Arguments

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

interface

  • private pure module subroutine copyVarValuesTo(this, varCont)

    Copy values of variables to outside variable container from this modeller's container

    Arguments

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

interface

  • private pure module subroutine setIntegrator(this, integ)

    Setter for integrator object

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(inout) :: this
    class(Manipulator), intent(in) :: integ

interface

  • private pure module subroutine setManipulator(this, manip)

    Setter for manipulator object

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(inout) :: this
    class(CompositeManipulator), intent(in) :: manip

interface

  • private module subroutine updateModelTermGroup(this, modelIndex, groupIndex, varCont)

    Call the update routine of model with given index for the given term group - optionally use variable container other than the one stored in the modeller

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(inout) :: this
    integer(kind=ik), intent(in) :: modelIndex
    integer(kind=ik), intent(in) :: groupIndex
    type(VariableContainer), intent(in), optional :: varCont

interface

  • private pure module subroutine calculateMatGroupValsInModel(this, modelIndex, groupIndex, varCont)

    Calculate matrix value in implicit term group given by groupIndex in model given by modelIndex, and optionally using variable container other than the one stored in the modeller

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(inout) :: this
    integer(kind=ik), intent(in) :: modelIndex
    integer(kind=ik), intent(in) :: groupIndex
    type(VariableContainer), intent(in), optional :: varCont

interface

  • private module subroutine addModelMatGroupToPETSc(this, modelIndex, groupIndex, mult, petscGroup)

    Send off matrix values of given term group and model to the PETSc controller, multiplied by mult

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(inout) :: this
    integer(kind=ik), intent(in) :: modelIndex
    integer(kind=ik), intent(in) :: groupIndex
    real(kind=rk), intent(in) :: mult
    integer(kind=ik), intent(in), optional :: petscGroup

interface

  • private module subroutine assemble(this, withIdentityMat)

    Assemble all of the matrix terms, preallocate PETScController objects and make sure modeller is ready for use. If withIdentityMat is true preallocates diagonal elements for the identity matrix.

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(inout) :: this
    logical, intent(in), optional :: withIdentityMat

interface

  • private module subroutine performComm(this, commData, varCont, onlyDepth)

    Perform communications using the modeller's MPI controller - optionally uses external CommunicationData instructions or exchanges data in external variable container

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(inout) :: this
    type(CommunicationData), intent(in), optional :: commData

    Optional non-default communication data

    type(VariableContainer), intent(inout), optional :: varCont

    Optional variable container to perform communications on instead of the modeller's

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

    Only communicate variables at given derivation depth

interface

  • private module subroutine safeCommAndDeriv(this, commData, varCont, derivPriority)

    Perform communications interlaced with derivation calls of increasing derivation depth

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(inout) :: this
    type(CommunicationData), intent(in), optional :: commData

    Optional non-default communication data

    type(VariableContainer), intent(inout), optional :: varCont

    Optional variable container to perform communications on instead of the modeller's

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

    Derivation priority for interlaced calls

interface

  • private module subroutine callManipulator(this, priority, inVars, outVars)

    Call optional CompositeManipulator manipulate routine with inVars and outVars - the default for the optional VariableContainers is the modeller's VariableContainer

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(inout) :: this
    integer(kind=ik), intent(in) :: priority
    type(VariableContainer), intent(in), optional :: inVars
    type(VariableContainer), intent(inout), optional :: outVars

interface

  • private module subroutine integrate(this, inVars, outVars)

    Call ianipulator affect routine with inVars and outVars - the default for the optional VariableContainers is the modeller's VariableContainer

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(inout) :: this
    type(VariableContainer), intent(in), optional :: inVars
    type(VariableContainer), intent(inout), optional :: outVars

interface

  • private module subroutine linearSolvePETSc(this, knownVec, unknownVec, addIdentityMat, convReason, petscGroup)

    Call linearSolve routine on PETScController of this modeller. Creates PETSc objects if they've not yet been created. If addIdentityMat is true adds an identity matrix to the PETSc matrix.

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(inout) :: this
    real(kind=rk), intent(in), dimension(:) :: knownVec
    real(kind=rk), intent(out), dimension(:) :: unknownVec
    logical, intent(in) :: addIdentityMat
    integer(kind=ik), intent(inout) :: convReason
    integer(kind=ik), intent(in), optional :: petscGroup

interface

  • private module subroutine calculateIdentityMat(this, indexingObj)

    Initializes the identity matrix of this modeller based on Indexing object

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(inout) :: this
    type(Indexing), intent(in) :: indexingObj

interface

  • private module subroutine updateModelData(this, modelIndex, varCont, updatePriority)

    Update modelbound data of model with given index if that data is allocated

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(inout) :: this
    integer(kind=ik), intent(in) :: modelIndex

    Model index for model whose data is to be update

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

    Variable container to be used in update

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

    Priority for this update call

interface

  • private module subroutine copyDataFromModel(this, modelIndex, varName, container)

    Copy modelbound variable data with given name from model with given index.

    Arguments

    Type IntentOptional Attributes Name
    class(Modeller), intent(in) :: this
    integer(kind=ik), intent(in) :: modelIndex
    character(len=*), intent(in) :: varName

    Name of data

    real(kind=rk), intent(inout), allocatable, dimension(..) :: container

    Container to copy into


Derived Types

type, public ::  ModelContainer

Container for Model objects allowing heterogeneous arrays

Components

Type Visibility Attributes Name Initial
class(Model), public, allocatable :: entry

type, public, extends(ModellerSurrogate) ::  Modeller

Central object responsible for storing variables and models, as well as doing integration and data manipulation

Components

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

True only if user explicitly sets it to true

type(VariableContainer), private :: vars

Main variable container

type(ModelContainer), private, allocatable, dimension(:) :: models

Array holding all models this modeller has access to

type(PETScController), private, allocatable :: petscCont

PETScController object used for solving linear systems

type(MPIController), private :: MPICont

MPIController used for all communication

type(CommunicationData), private, allocatable :: commData

Default communication data containing MPI communication instruction

type(SparseRowData), private, allocatable :: identityMat

Sparse identity matrix used for PETSc calls

class(Manipulator), private, allocatable :: integ

Main integrator object

class(CompositeManipulator), private, allocatable :: manip

Secondary manipulator object for optional data manipulation

integer(kind=ik), private :: numModelsAdded

Tracked of number of models allocated

logical(kind=ik), private :: assembled

True if modeller has been assembled and is ready for use

Type-Bound Procedures

procedure, public :: isDefined => isDefinedObject
procedure, public :: makeDefined => makeDefinedObject
procedure, public :: makeUndefined => makeUndefinedObject
procedure, public :: isAssembled
procedure, public :: addModel
procedure, public :: copyVarValuesTo
procedure, public :: copyVarValuesFrom
procedure, public :: callManipulator
procedure, public :: integrate
procedure, public :: setIntegrator
procedure, public :: setManipulator
procedure, public :: calculateIdentityMat
procedure, public :: updateModelTermGroup
procedure, public :: updateModelData
procedure, public :: calculateMatGroupValsInModel
procedure, public :: addModelMatGroupToPETSc
procedure, public :: linearSolvePETSc
procedure, public :: evaluateModelTermGroup
procedure, public :: evaluateModelTermByName
procedure, public :: copyDataFromModel
procedure, public :: getEvolvedVarInTermGroup
procedure, public :: isModelTermGroupMixed
procedure, public :: getCurrentTime
procedure, public :: performComm
procedure, public :: safeCommAndDeriv
procedure, public :: isTrueEverywhere
procedure, public :: assemble
procedure, public :: init => initModeller