petsc_controller_procedures Submodule

Contains module procedures associated with the petsc controller class


Uses


Module Functions

pure module function objectsCreated(this) result(created)

Return true if PETSc objects have been created

Arguments

Type IntentOptional Attributes Name
class(PETScController), intent(in) :: this

Return Value logical

pure module function getLastConvergedReason(this) result(conv)

Getter for lastConvergedReason

Arguments

Type IntentOptional Attributes Name
class(PETScController), intent(in) :: this

Return Value integer(kind=ik)

pure module function getLastNumIterations(this) result(numIters)

Getter for lastNumIterations

Arguments

Type IntentOptional Attributes Name
class(PETScController), intent(in) :: this

Return Value integer(kind=ik)


Module Subroutines

module subroutine initPETScController(this, indexingObj, mpiCont, solOptions, numObjs)

PETSc controller initialization routine

Arguments

Type IntentOptional Attributes Name
class(PETScController), intent(inout) :: this
type(Indexing), intent(in) :: indexingObj

Indexing object used to initialize preallocation data

type(MPIController), intent(in) :: mpiCont

Reference MPI controller

type(SolverOptions), intent(in) :: solOptions

KSP solver options

integer(kind=ik), intent(in), optional :: numObjs

Number of PETSc object groups

pure module subroutine addRowDataToPreallocation(this, rowData)

Add sparse row data structure to total preallocation sparsity pattern

Arguments

Type IntentOptional Attributes Name
class(PETScController), intent(inout) :: this
type(SparseRowData), intent(in) :: rowData

module subroutine addRowValuesToMatrix(this, rowData, multConst, objGroup)

Add row data to matrix, optionally multiplied by a real constant

Arguments

Type IntentOptional Attributes Name
class(PETScController), intent(inout) :: this
type(SparseRowData), intent(in) :: rowData
real(kind=rk), intent(in), optional :: multConst
integer(kind=ik), intent(in), optional :: objGroup

module subroutine createPETScObjs(this)

Assemble the preallocation object, create PETSc objects, and deallocate the preallocation object

Arguments

Type IntentOptional Attributes Name
class(PETScController), intent(inout) :: this

module subroutine linearSolve(this, knownVec, unknownVec, objGroup)

Solve the equation petscMat * unknownVec = knownVec where the vectors are local to each processor - assembles and zeros out the matrix before/after the solve

Arguments

Type IntentOptional Attributes Name
class(PETScController), intent(inout) :: this
real(kind=rk), intent(in), dimension(:) :: knownVec
real(kind=rk), intent(out), dimension(:) :: unknownVec
integer(kind=ik), intent(in), optional :: objGroup

module subroutine finalize(this)

Finalizes PETSc and destroys all PETSc objects

Arguments

Type IntentOptional Attributes Name
class(PETScController), intent(inout) :: this