Contains module procedures associated with the model class
Check if model is assembled and ready to use
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(in) | :: | this |
Evaluate a term group, returning the sum of all explicit results from the term group - if groupIndex > size(implicitGroup) it is taken to be in the general group
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(in) | :: | this | |||
integer(kind=ik), | intent(in) | :: | groupIndex |
Group index to evaluate |
||
type(VariableContainer), | intent(in) | :: | varCont |
Variable container used to evaluate this group |
Return true if group with given index is mixed
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(in) | :: | this | |||
integer(kind=ik), | intent(in) | :: | groupIndex |
Return evolved variable name for given group index - works only for groups that are not mixed
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(in) | :: | this | |||
integer(kind=ik), | intent(in) | :: | groupIndex |
Return row data of implicit term with given term index
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(in) | :: | this | |||
integer(kind=ik), | intent(in) | :: | termIndex |
Return indexing data of implicit term with given term index
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(in) | :: | this | |||
integer(kind=ik), | intent(in) | :: | termIndex |
Check whether term with given name is registered
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(in) | :: | this | |||
character(len=*), | intent(in) | :: | name |
Check whether term with given name is implicit
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(in) | :: | this | |||
character(len=*), | intent(in) | :: | name |
Get index of implicit term with given name
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(in) | :: | this | |||
character(len=*), | intent(in) | :: | name |
Get index of general term with given name
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(in) | :: | this | |||
character(len=*), | intent(in) | :: | name |
Evaluate a term by name
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(in) | :: | this | |||
character(len=*), | intent(in) | :: | name | |||
type(VariableContainer), | intent(in) | :: | varCont |
Variable container used to evaluate this term |
Model initialization routine
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(inout) | :: | this | |||
integer(kind=ik), | intent(in), | optional | :: | numImplicitTerms |
Number of MatrixTerm objects this model expects to be added |
|
integer(kind=ik), | intent(in), | optional | :: | numGeneralTerms |
Number of general Term objects this model expects to be added |
|
integer(kind=ik), | intent(in), | optional | :: | numImplicitGroups |
Number of implicit/matrix term groups registered with this model |
|
integer(kind=ik), | intent(in), | optional | :: | numGeneralGroups |
Number of general term groups registered with this model |
Set number of implicit terms and perform allocation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(inout) | :: | this | |||
integer(kind=ik), | intent(in) | :: | numImplicitTerms |
Number of MatrixTerm objects this model expects to be added |
Set number of general terms and perform allocation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(inout) | :: | this | |||
integer(kind=ik), | intent(in) | :: | numGeneralTerms |
Number of general Term objects this model expects to be |
Set number of implicit groups and perform allocation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(inout) | :: | this | |||
integer(kind=ik), | intent(in) | :: | numImplicitGroups |
Number of implicit/matrix term groups registered with this model |
Set number of general groups and perform allocation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(inout) | :: | this | |||
integer(kind=ik), | intent(in) | :: | numGeneralGroups |
Number of general term groups registered with this model |
Add a MatrixTerm object to the model (deallocating the source!), and specify which implicit and general groups it belongs to
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(inout) | :: | this | |||
class(MatrixTerm), | intent(inout), | allocatable | :: | impTerm |
MatrixTerm object to be reallocated to this model |
|
integer(kind=ik), | intent(in), | dimension(:) | :: | implicitGroups |
Implicit groups the added term should belong to |
|
integer(kind=ik), | intent(in), | dimension(:) | :: | generalGroups |
General groups the added term should belong to |
|
character(len=*), | intent(in) | :: | termName |
Name of added term for indexing purposes |
||
logical, | intent(in), | optional | :: | skipPattern |
True if the matrix term pattern should not be added to PETSc preallocation |
Add a Term object to the model (deallocating the source!), and specify which general groups it belongs to
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(inout) | :: | this | |||
class(Term), | intent(inout), | allocatable | :: | genTerm |
General Term object to be reallocated to this model |
|
integer(kind=ik), | intent(in), | dimension(:) | :: | generalGroups |
General groups the added term should belong to |
|
character(len=*), | intent(in) | :: | termName |
Name of added term for indexing purposes |
Update a term group - if groupIndex > size(implicitGroup) it is taken to be in the general group
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(inout) | :: | this | |||
integer(kind=ik), | intent(in) | :: | groupIndex |
Group index to be updated |
||
type(VariableContainer), | intent(in) | :: | varCont |
Variable container used to update this group |
Calculate matrix value in implicit term group given by groupIndex
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(inout) | :: | this | |||
integer(kind=ik), | intent(in) | :: | groupIndex |
Group index of terms whose matrices should be calculated |
||
type(VariableContainer), | intent(in) | :: | varCont |
Variable container used for the calculation |
Send off matrix values of given term group to the PETSc controller, multiplied by mult
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(in) | :: | this | |||
integer(kind=ik), | intent(in) | :: | groupIndex |
Group index of terms whose matrices should be sent to PETSc |
||
type(PETScController), | intent(inout) | :: | petscCont |
PETScController object housing PETSc matrices |
||
real(kind=rk), | intent(in) | :: | mult |
Multiplier used when adding matrices to PETSc - usually -dt |
||
integer(kind=ik), | intent(in), | optional | :: | petscGroup |
Assemble all of the matrix terms, preallocate PETScController objects and make sure model is ready for use
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(inout) | :: | this | |||
type(PETScController), | intent(inout), | optional | :: | petscCont |
Optional PETScController - should be present if the model has any implicitly evaluated terms |
Update this model's modelbound data if allocated
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(inout) | :: | this | |||
type(VariableContainer), | intent(in) | :: | varCont |
Variable container used in the update |
||
integer(kind=ik), | intent(in), | optional | :: | updatePriority |
Priority for this update call |
Setter for modelData
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(inout) | :: | this | |||
class(ModelboundData), | intent(in) | :: | modelData |
Copy model data from this model into modelData
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(in) | :: | this | |||
class(ModelboundData), | intent(inout), | allocatable | :: | modelData |
Copy modelbound variable data with given name. Will throw error if no modelbound data is found
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(in) | :: | this | |||
character(len=*), | intent(in) | :: | varName |
Name of data |
||
real(kind=rk), | intent(inout), | allocatable, dimension(..) | :: | container |
Container to copy into |
Calculate matrix values of a term by name
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(inout) | :: | this | |||
character(len=*), | intent(in) | :: | name | |||
type(VariableContainer), | intent(in) | :: | varCont |
Update a term by name
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(inout) | :: | this | |||
character(len=*), | intent(in) | :: | name | |||
type(VariableContainer), | intent(in) | :: | varCont |