modeller_procedures Submodule

Contains module procedures associated with the modeller class


Uses


Module Functions

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

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(:)

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(:)

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

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

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)

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

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)

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)


Module Subroutines

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

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

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

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

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

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

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

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

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

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

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

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

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

module subroutine integrate(this, inVars, outVars)

Call integrator 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

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

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

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

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