General matrix term with the capability to take in various stencils, time and spaticoordinate profiles, and evaluate other term groups in the host model. Required row and column variables passed through the VarData object are raised to corresponding powers.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
logical, | public | :: | userDefined | = | .false. |
True only if user explicitly sets it to true |
|
type(VarData), | private | :: | vData |
Common variable data |
|||
type(CoordProfiles), | private | :: | coordProfile |
Optional multiplicative constants giving x-dependence if size 1 or x,h,v dependence if size 3 |
|||
type(TimeSignalData), | private, | allocatable | :: | tData |
Optional time signal data |
||
real(kind=rk), | private | :: | timeSignalMult |
Multiplier containing tSignal result. Defaults to 1 |
|||
integer(kind=ik), | private, | allocatable | :: | targetTermGroup |
Term group to evaluate and use as a row function |
||
real(kind=rk), | private, | allocatable, dimension(:) | :: | evalBuffer |
Buffer for evaluating target term group |
||
class(JaggedArrayGenerator), | private, | allocatable | :: | stencilGen |
Optional stencil value generator used to update this term's multConst |
||
type(RealArray), | private, | allocatable, dimension(:) | :: | stencilVals |
Current values of stencil variables, used as this term's multConst |
||
type(SparseRowData), | private | :: | copyTermVals |
Matrix values of the optional copy term |
|||
character(len=:), | private, | allocatable | :: | copyTermName |
Name of the term whose values should be copied and multiplied with this term's stencil |
||
real(kind=rk), | private, | allocatable, dimension(:) | :: | modelboundRowVarBuffer |
Buffer holding the product of modelbound row variables raised to their corresponding powers |
||
real(kind=rk), | private, | allocatable, dimension(:) | :: | modelboundColVarBuffer |
Buffer holding the product of modelbound col variables raised to their corresponding powers |
||
logical, | private | :: | xPeriodic |
True if term treats x grid as periodic |
|||
logical, | private | :: | isActive | ||||
logical, | private | :: | kineticRow |
True if row variable is a distribution |
|||
logical, | private | :: | kineticCol |
True if col variable is a distribution |
|||
logical, | private, | allocatable, dimension(:) | :: | reqRowVarIsDist |
True for all required row variables that are distributions |
||
logical, | private, | allocatable, dimension(:) | :: | reqColVarIsDist |
True for all required column variables that are distributions |
||
integer(kind=ik), | private | :: | locNumX |
Local number of spatial cells - used when handling modelbound data |
|||
integer(kind=ik), | private | :: | numH |
Local number of harmonics - used when handling modelbound data |
|||
integer(kind=ik), | private | :: | numV |
Local number of velocity cells - used when handling modelbound data |
|||
integer(kind=ik), | private, | allocatable, dimension(:) | :: | rowCoordsX | |||
integer(kind=ik), | private, | allocatable, dimension(:) | :: | rowCoordsH | |||
integer(kind=ik), | private, | allocatable, dimension(:) | :: | rowCoordsV |
Getter for userDefined
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Object), | intent(in) | :: | this |
Set userDefined to .true.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Object), | intent(inout) | :: | this |
Set userDefined to .false.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Object), | intent(inout) | :: | this |
Default matrix entry calculation routine - loops over each row and applies rowFun and colFun to variables in provided container
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(MatrixTerm), | intent(inout) | :: | this | |||
type(VariableContainer), | intent(in) | :: | varCont |
Setter for normalizationConst
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(MatrixTerm), | intent(inout) | :: | this | |||
real(kind=rk), | intent(in) | :: | norm |
Getter for normalizationConst
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(MatrixTerm), | intent(in) | :: | this |
Set variable names required by the row and column functions and find their indices in variable container
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(MatrixTerm), | intent(inout) | :: | this | |||
type(StringArray), | intent(in), | dimension(:) | :: | rowReqVars | ||
type(StringArray), | intent(in), | dimension(:) | :: | colReqVars | ||
type(VariableContainer), | intent(in) | :: | varCont |
Set evolved (row) and implicit (column) variable names, and check if evolved variable is stationary using varCont
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(MatrixTerm), | intent(inout) | :: | this | |||
character(len=*), | intent(in) | :: | rowVarName | |||
character(len=*), | intent(in) | :: | colVarName | |||
type(VariableContainer), | intent(in) | :: | varCont |
Initialize row data objects based on a set of evolved global coordinates, the row/col var name, and a function that returns column coordinates given a row coordinate input. Requires a reference Indexing object.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(MatrixTerm), | intent(inout) | :: | this | |||
integer(kind=ik), | intent(in), | dimension(:,:) | :: | rowCoords | ||
procedure(coordMapping) | :: | rowToColMapping | ||||
type(Indexing), | intent(in) | :: | indexingObj |
Get explicit value for the term by crudely dotting each sparse row with the locally stored implicit variable vector in varCont
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(MatrixTerm), | intent(in) | :: | this | |||
type(VariableContainer), | intent(in) | :: | varCont |
Getter for multConst
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(MatrixTerm), | intent(in) | :: | this |
Setter for multConst
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(MatrixTerm), | intent(inout) | :: | this | |||
type(RealArray), | intent(in), | dimension(:) | :: | multConst |
Getter for indexingData
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(MatrixTerm), | intent(in) | :: | this |
Set whether the matrix is fixed -> only calculated once
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(MatrixTerm), | intent(inout) | :: | this | |||
logical, | intent(in) | :: | isFixed |
Set whether the matrix has a non-trivial row function
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(MatrixTerm), | intent(inout) | :: | this | |||
logical, | intent(in) | :: | nontriv |
Set whether the matrix has a non-trivial col function
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(MatrixTerm), | intent(inout) | :: | this | |||
logical, | intent(in) | :: | nontriv |
Add this term's row data to a PETSc preallocation object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(MatrixTerm), | intent(inout) | :: | this | |||
type(PETScPreallocationData), | intent(inout) | :: | petscPreallocData |
Add this term's row data to a petsc preallocation object in PETSc controller
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(MatrixTerm), | intent(in) | :: | this | |||
type(PETScController), | intent(inout) | :: | petscCont |
Add this term's row values to a petsc matrix object in PETSc controller, multiplied by mult. If evolved variable is stationary mult is ignored and set to -1
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(MatrixTerm), | intent(in) | :: | this | |||
type(PETScController), | intent(inout) | :: | petscCont | |||
real(kind=rk), | intent(in) | :: | mult | |||
integer(kind=ik), | intent(in), | optional | :: | petscGroup |
Get name of the evolved variable of this term
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(MatrixTerm), | intent(in) | :: | this |
Getter for rowData
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(MatrixTerm), | intent(in) | :: | this |
Default matrix term update, call matrixTermUpdate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(MatrixTerm), | intent(inout) | :: | this | |||
type(VariableContainer), | intent(in) | :: | varCont | |||
class(ModelboundData), | intent(in), | optional | :: | modelData | ||
class(ModelSurrogate), | intent(in), | optional | :: | hostModel |
Update general term if using any modelbound data, updating stencil values, evaluating other terms, or if there is any explicit time dependence
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(GeneralMatrixTerm), | intent(inout) | :: | this | |||
type(VariableContainer), | intent(in) | :: | varCont |
Variable container - used to update stencil values and signal |
||
type(MatrixTermIndexingData), | intent(in) | :: | indexingData | |||
class(ModelboundData), | intent(in), | optional | :: | modelData |
Model data used to retrieve modelbound variable |
|
class(ModelSurrogate), | intent(in), | optional | :: | hostModel |
Host model - used to evaluate term group |
Multiplies all required variables and raises them to their corresponding power,using modelbound row variable buffer if allocated, and adding spatial and time profiles
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(GeneralMatrixTerm), | intent(inout) | :: | this | |||
type(VariableContainer), | intent(in) | :: | varCont | |||
real(kind=rk), | intent(inout), | dimension(:) | :: | rowVals | ||
type(MatrixTermIndexingData), | intent(in) | :: | indexingData |
Multiplies all required variables and raises them to their corresponding power,using modelbound row variable buffer if allocated
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(GeneralMatrixTerm), | intent(inout) | :: | this | |||
type(VariableContainer), | intent(in) | :: | varCont | |||
type(RealArray), | intent(inout), | dimension(:) | :: | colVals | ||
type(MatrixTermIndexingData), | intent(in) | :: | indexingData |
General matrix term initialization routine
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(GeneralMatrixTerm), | intent(inout) | :: | this | |||
type(Grid), | intent(in) | :: | gridObj |
Grid object used to initialize stencil |
||
type(Partition), | intent(in) | :: | partitionObj |
Parition object used to determine local number of DoF |
||
type(Indexing), | intent(in) | :: | indexingObj |
Indexing object used to initialize matrix row data |
||
integer(kind=ik), | intent(in) | :: | procRank |
Current processor rank |
||
character(len=*), | intent(in) | :: | evolvedVar |
Name of evolved variable |
||
character(len=*), | intent(in) | :: | implicitVar |
Name of implicit variable |
||
type(VariableContainer), | intent(in) | :: | varCont |
Reference variable container |
||
type(StencilTemplate), | intent(inout) | :: | sTemplate |
StencilTemplate used |
||
type(VarData), | intent(in), | optional | :: | vData |
Required variable names and powers |
|
real(kind=rk), | intent(in), | optional | :: | normConst |
Normalization constant |
|
type(CoordProfiles), | intent(in), | optional | :: | coordProfile |
Multiplicative coordinate profiles (globally indexed) |
|
type(TimeSignalData), | intent(in), | optional | :: | tData |
Explicit time dependence |
|
integer(kind=ik), | intent(in), | optional | :: | evalTermGroup |
Optional term group of host model to evaluate and use as additional row variable |
|
class(ModelboundData), | intent(in), | optional | :: | mbData |
Optional modelbound data object used when initializing fixed stancil generators which might require it |
|
character(len=*), | intent(in), | optional | :: | copyTermName |
Name of the term whose values should be copied and multiplied with this term's stencil |