# dolfinx.nls.petsc

(Deprecated) Methods for solving nonlinear equations using PETSc solvers.

Classes

`NewtonSolver`(comm, problem) | (Deprecated) A Newton solver for non-linear problems.

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

  Bases: `NewtonSolver`

  (Deprecated) 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)

    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)

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