dolfinx.nls.petsc

Methods for solving nonlinear equations using PETSc solvers.

Classes

NewtonSolver(comm, problem)

Newton solver for non-linear problems.

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

Bases: NewtonSolver

Newton solver for non-linear problems.

Deprecated.

Initialize Newton solver.

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.