dolfinx.nls.petsc

Methods for solving nonlinear equations using PETSc solvers.

Classes

NewtonSolver(comm, problem)

A Newton solver for non-linear problems.

class dolfinx.nls.petsc.NewtonSolver(comm: MPI.Intracomm, problem: NewtonSolverNonlinearProblem)[source]

Bases: NewtonSolver

A Newton solver for non-linear problems.

Note

This class is deprecated in favour of dolfinx.fem.petsc.NonlinearProblem, a high level interface to PETSc SNES.

property A: Mat

Jacobian matrix

property b: Vec

Residual vector

setP(P: LambdaType, Pmat: Mat)[source]

Set the function for computing the preconditioner matrix

Parameters:
  • P – Function to compute the preconditioner matrix

  • Pmat – Matrix to assemble the preconditioner into

solve(u: Function)[source]

Solve non-linear problem into function u. Returns the number of iterations and if the solver converged.