PETScKrylovSolver

class dolfin.cpp.la.PETScKrylovSolver(*args)

Bases: dolfin.cpp.la.GenericLinearSolver, dolfin.cpp.la.PETScObject

This class implements Krylov methods for linear systems of the form Ax = b. It is a wrapper for the Krylov solvers of PETSc.

Overloaded versions

  • PETScKrylovSolver(comm, method=”default”, preconditioner=”default”)

    Create Krylov solver for a particular method and named preconditioner

  • PETScKrylovSolver(method=”default”, preconditioner=”default”)

    Create Krylov solver for a particular method and named preconditioner

  • PETScKrylovSolver(comm, method, preconditioner)

    Create Krylov solver for a particular method and PETScPreconditioner (shared_ptr version)

  • PETScKrylovSolver(method, preconditioner)

    Create Krylov solver for a particular method and PETScPreconditioner (shared_ptr version)

  • PETScKrylovSolver(comm, method, preconditioner)

    Create Krylov solver for a particular method and PETScPreconditioner (shared_ptr version)

  • PETScKrylovSolver(method, preconditioner)

    Create Krylov solver for a particular method and PETScPreconditioner (shared_ptr version)

  • PETScKrylovSolver(ksp)

    Create solver wrapper of a PETSc KSP object

static default_parameters()

Default parameter values

get_norm_type()

Get norm type used in convergence testing

get_options_prefix()

Returns the prefix used by PETSc when searching the PETSc options database

ksp()

Return petsc4py representation of PETSc KSP solver

static methods()

Return a list of available solver methods

monitor()

Monitor residual at each iteration

mpi_comm()

Return MPI communicator

norm_type_default_norm = 1
norm_type_natural = 4
norm_type_none = 0
norm_type_preconditioned = 2
norm_type_unpreconditioned = 3
static preconditioners()

Return a list of available named preconditioners

set_from_options()

Set options from PETSc options database

set_nonzero_guess()

Use nonzero intial guess for solution function (nonzero_guess=true, the solution vector x will not be zeroed before the solver starts)

set_norm_type()

Set norm type used in convergence testing - not all solvers types support all norm types

set_options_prefix()

Sets the prefix used by PETSc when searching the PETSc options database

set_reuse_preconditioner()

Reuse preconditioner if true, even if matrix operator changes (by default preconditioner will be re-built if the matrix changes)

set_tolerances()

Set tolerances (relative residual, alsolute residial, maximum number of iterations)

solve()

Overloaded versions

  • solve(x, b)

    Solve linear system Ax = b and return number of iterations

  • solve(x, b)

    Solve linear system Ax = b and return number of iterations

  • solve(A, x, b)

    Solve linear system Ax = b and return number of iterations

thisown

The membership flag