MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / __init__

Method __init__

python/dolfinx/nls/petsc.py:42–58  ·  view source on GitHub ↗

Initialize Newton solver. Note: This class is deprecated in favour of :class:`dolfinx.fem.petsc.NonlinearProblem`, a high level interface to PETSc SNES.

(self, comm: MPI.Intracomm, problem: NewtonSolverNonlinearProblem)

Source from the content-addressed store, hash-verified

40 """
41
42 def __init__(self, comm: MPI.Intracomm, problem: NewtonSolverNonlinearProblem):
43 """Initialize Newton solver.
44
45 Note:
46 This class is deprecated in favour of
47 :class:`dolfinx.fem.petsc.NonlinearProblem`, a high
48 level interface to PETSc SNES.
49 """
50 super().__init__(comm)
51
52 # Create matrix and vector to be used for assembly of the
53 # non-linear problem
54 self._A = create_matrix(problem.a)
55 self.setJ(problem.J, self._A)
56 self._b = create_vector(extract_function_spaces(problem.L)) # type: ignore
57 self.setF(problem.F, self._b)
58 self.set_form(problem.form)
59
60 def __del__(self):
61 """Destroy PETSc objects owned by the solver."""

Callers

nothing calls this directly

Calls 6

setJMethod · 0.95
setFMethod · 0.95
set_formMethod · 0.95
create_matrixFunction · 0.90
create_vectorFunction · 0.90
extract_function_spacesFunction · 0.90

Tested by

no test coverage detected