Abstract matrix term containing general matrix construction routines and interface with PETSc. The values of a matrix are by default constructed by evaluating row and column functions for each element, and multiplying with the corresponding multiplicative and normalization constants
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | public | :: | userDefined | = | .false. |
True only if user explicitly sets it to true |
|
| type(SparseRowData), | private | :: | rowData |
Matrix object in sparse row data form |
|||
| type(RealArray), | private, | allocatable, dimension(:) | :: | multConst |
Multiplicative constants for each row/column corresponding to the matrix structure |
||
| real(kind=rk), | private | :: | normalizationConst | = | real(1.0d0, kind=rk) |
Normalization constant for this term |
|
| type(MatrixTermIndexingData), | private | :: | indexingData |
Indexing data used to determing coordinates and required variables |
|||
| logical, | private | :: | fixedMatrix | = | .false. |
If true the matrix is constructed only once |
|
| logical, | private | :: | fixedMatrixCalculated | = | .false. |
True if the fixed matrix has been calculated |
|
| logical, | private | :: | stationaryEvolvedVar | = | .false. |
If true, this term is always sent to PETSc with multiplicative constant -1 |
|
| logical, | private | :: | hasNonTrivialRowFun | = | .true. |
Set to false to not call row function. Defaults to true. |
|
| logical, | private | :: | hasNonTrivialColFun | = | .true. |
Set to false to not call col function. Defaults to true. |
|
| type(RealArray), | private, | allocatable, dimension(:) | :: | colBuffer | |||
| real(kind=rk), | private, | allocatable, dimension(:) | :: | rowBuffer |
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 |
Default row function. In general should use the passed variable container, row buffer, and matrix indexing data to provide values which is only a function of the row
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MatrixTerm), | intent(inout) | :: | this | |||
| type(VariableContainer), | intent(in) | :: | varCont | |||
| real(kind=rk), | intent(inout), | dimension(:) | :: | rowVals | ||
| type(MatrixTermIndexingData), | intent(in) | :: | indexingData |
Default column function. In general should provide values for each column
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MatrixTerm), | intent(inout) | :: | this | |||
| type(VariableContainer), | intent(in) | :: | varCont | |||
| type(RealArray), | intent(inout), | dimension(:) | :: | colVals | ||
| type(MatrixTermIndexingData), | intent(in) | :: | indexingData |
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 |
Default MatrixTerm updateMatTerm function - does nothing
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MatrixTerm), | intent(inout) | :: | this | |||
| type(VariableContainer), | intent(in) | :: | varCont | |||
| type(MatrixTermIndexingData), | intent(in) | :: | indexingData | |||
| class(ModelboundData), | intent(in), | optional | :: | modelData | ||
| class(ModelSurrogate), | intent(in), | optional | :: | hostModel |