Julia interfaces
For the main PETSc objects (Vec
,Mat
,KSP
, etc...) we provide high-level Julia interfaces that are easy to use and integrate with Julia's Array
and SparseArray
APIs. For distributed arrays, we support `PartitionedArrays.jl APIs.
GridapPETSc.PETSC
GridapPETSc.PETScIndexSet
GridapPETSc.PETScLinearSolver
GridapPETSc.PETScMatrix
GridapPETSc.PETScNonlinearSolver
GridapPETSc.PETScVector
GridapPETSc.Finalize
GridapPETSc.Init
GridapPETSc.Initialized
GridapPETSc.destroy
GridapPETSc.gridap_petsc_gc
GridapPETSc.with
GridapPETSc.PETScIndexSet
— Typestruct PETScIndexSet
Julia interface for a PETSc IS
object.
GridapPETSc.PETScLinearSolver
— Typestruct PETScLinearSolver <: LinearSolver
Julia interface for a PETSc KSP
object.
GridapPETSc.PETScMatrix
— Typestruct PETScMatrix <: AbstractMatrix{PetscScalar}
Julia interface for a PETSc Mat
object.
GridapPETSc.PETScNonlinearSolver
— Typestruct PETScNonlinearSolver{F} <: NonlinearSolver
Julia interface for a PETSc SNES
object.
GridapPETSc.PETScVector
— Typestruct PETScVector <: AbstractVector{PetscScalar}
Julia interface for a PETSc Vec
object.
GridapPETSc.Finalize
— MethodGridapPETSc.Finalize()
Finalize PETSc and clean up resources. Wrapper for PetscFinalize
.
GridapPETSc.Init
— MethodGridapPETSc.Init(;args=String[],file="",help="",finalize_atexit=true)
Initialize PETSc with optional command line arguments, a file name, and help text. Wrapper for PetscInitializeNoPointers
.
GridapPETSc.Initialized
— MethodGridapPETSc.Initialized()
Returns true if PETSc has been initialized. Wrapper for PetscInitialized
.
GridapPETSc.destroy
— MethodGridapPETSc.destroy(a)
Call the appropriate PETSc destroy function for the object a
. This is a collective operation and must be called on all processes at the same time.
GridapPETSc.gridap_petsc_gc
— MethodGridapPETSc.gridap_petsc_gc()
Call PetscObjectRegisterDestroyAll
to destroy all PETSc objects registered for destruction. This is a collective operation and must be called on all processes at the same time.
GridapPETSc.with
— MethodGridapPETSc.with(f; kwargs...)
Similar to the Base.with
execution block, but for PETSc:
Usage:
GridapPETSc.with() do
# PETSc-dependent code here
end