dolfinx_adjoint.nls.petsc module
- class dolfinx_adjoint.nls.petsc.NewtonSolver(*args, **kwargs)
Bases:
NewtonSolverOVERLOADS:
dolfinx.nls.petsc.NewtonSolverA Newton solver for non-linear problems.The overloaded class modifies the initialization of the NewtonSolver to keep track of the dependencies in the computational graph and the adjoint equations. The original functionality is kept.
- solve(*args, **kwargs)
OVERLOADS:
dolfinx.nls.petsc.NewtonSolver.solve()Solve non-linear problem into function u. Returns the number of iterations and if the solver converged.- Parameters:
args – Arguments to
dolfinx.nls.petsc.NewtonSolver.solve()kwargs – Keyword arguments to
dolfinx.nls.petsc.NewtonSolver.solve()graph (graph, optional) – An additional keyword argument to specifier whether the assemble operation should be added to the graph. If not present, the original functionality of dolfinx is used without any additional functionalities.
version (int, optional) – An additional keyword argument to specify the version of the solution node. If not present, the version is set to 1.
- Returns:
Number of iterations bool: Convergence of the solver
- Return type:
int
- class dolfinx_adjoint.nls.petsc.NewtonSolverNode(object: Any, comm: Intracomm, problem: NewtonSolverNonlinearProblem, name='NewtonSolver', **kwargs)
Bases:
AbstractNodeNode for the initialization of
dolfinx.nls.petsc.NewtonSolver