Object storing, evaluating, and manipulating various term objects, with terms categorized as either implicit (MatrixTerm objects) or general (Term objects).
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
logical, | public | :: | userDefined | = | .false. |
True only if user explicitly sets it to true |
|
integer(kind=ik), | private | :: | numAddedMatrixTerms |
Tracker for number of allocated matrix terms |
|||
integer(kind=ik), | private | :: | numAddedGeneralTerms |
Tracker for number of allocated general terms |
|||
type(IntArray), | private, | allocatable, dimension(:) | :: | implicitTermGroup |
Groups of matrix terms used to identify terms for evaluation/manipulation |
||
type(IntArray), | private, | allocatable, dimension(:) | :: | generalTermGroup |
Groups of general terms used to identify terms for evaluation/manipulation |
||
logical, | private, | allocatable, dimension(:) | :: | implicitGroupMixed |
True for each implicit group that is either empty or contains terms that evolve/evaluate more than one variable - used to forbid explicit evaluation of such terms |
||
logical, | private, | allocatable, dimension(:) | :: | generalGroupMixed |
True for each general group that that is either empty or contains terms that evolve/evaluate more than one variable - used to forbid explicit evaluation of such terms |
||
type(MatTermContainer), | private, | allocatable, dimension(:) | :: | implicitTerms |
Container for MatrixTerm objects living in this model |
||
type(TermContainer), | private, | allocatable, dimension(:) | :: | generalTerms |
Container for general Term objects living in this model |
||
logical, | private | :: | assembled |
True if the model is assembled and ready for use |
|||
logical, | private, | dimension(4) | :: | setupCounter |
All true if the model is ready to accept terms |
||
class(ModelboundData), | private, | allocatable | :: | modelData |
Optional model data that can be used by contained terms |
||
type(StringArray), | private, | allocatable, dimension(:) | :: | implicitTermNames |
Names of implicit terms |
||
type(StringArray), | private, | allocatable, dimension(:) | :: | generalTermNames |
Names of general terms |
||
logical, | private, | allocatable, dimension(:) | :: | skipPattern |
Flag to skip pattern of particular implicit term when adding (for performance on startup) |
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 |
Check if model is assembled and ready to use
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(in) | :: | this |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 added |
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 |
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 |
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 |