PETSc.jl

This is a extension for importing solvers from PETSc.jl SNES into the SciML interface. Note that these solvers do not come by default, and thus one needs to install the package before using these solvers:

using Pkg
Pkg.add("PETSc")
using PETSc, NonlinearSolve

Solver API

NonlinearSolve.PETScSNESType
PETScSNES(; petsclib = missing, autodiff = nothing, mpi_comm = missing, kwargs...)

Wrapper over PETSc.jl SNES solvers.

Keyword Arguments

  • petsclib: PETSc library to use. If set to missing, then we will use the first available PETSc library in PETSc.petsclibs based on the problem element type.
  • autodiff: the choice of method for generating the Jacobian. Defaults to nothing which means that a default is selected according to the problem specification. Can be any valid ADTypes.jl autodiff type (conditional on that backend being supported in NonlinearSolve.jl). If set to missing, then PETSc computes the Jacobian using finite differences.
  • mpi_comm: MPI communicator to use. If set to missing, then we will use MPI.COMM_SELF.
  • kwargs: Keyword arguments to be passed to the PETSc SNES solver. See PETSc SNES documentation and SNESSetFromOptions for more information.

Options via CommonSolve.solve

These options are forwarded from solve to the PETSc SNES solver. If these are provided to kwargs, then they will be ignored.

solve optionPETSc SNES option
atolsnes_atol
rtolsnes_rtol
maxiterssnes_max_it
show_tracesnes_monitor
Note

This algorithm is only available if PETSc.jl is installed and loaded.

source