PETScSNESSolver.h

Note

The documentation on this page was automatically extracted from the DOLFIN C++ code and may need to be edited or expanded.

class PETScSNESSolver

Parent class(es)

This class implements methods for solving nonlinear systems via PETSc’s SNES interface. It includes line search and trust region techniques for globalising the convergence of the nonlinear iteration.

PETScSNESSolver(std::string nls_type = "default")

Create SNES solver for a particular method

std::pair<std::size_t, bool> solve(NonlinearProblem &nonlinear_problem, GenericVector &x, const GenericVector &lb, const GenericVector &ub)

Solve a nonlinear variational inequality with bound constraints

Arguments
nonlinear_function (NonlinearProblem)
The nonlinear problem.
x (GenericVector)
The vector.
lb (GenericVector)
The lower bound.
ub (GenericVector)
The upper bound.
Returns
std::pair<std::size_t, bool>
Pair of number of Newton iterations, and whether iteration converged)
std::pair<std::size_t, bool> solve(NonlinearProblem &nonlinear_function, GenericVector &x)

Solve abstract nonlinear problem \(F(x) = 0\) for given \(F\) and Jacobian \(\dfrac{\partial F}{\partial x}\).

Arguments
nonlinear_function (NonlinearProblem)
The nonlinear problem.
x (GenericVector)
The vector.
Returns
std::pair<std::size_t, bool>
Pair of number of Newton iterations, and whether iteration converged)
void init(NonlinearProblem &nonlinear_problem, GenericVector &x)

Set up the SNES object, but don’t do anything yet, in case the user wants to access the SNES object directly

static std::vector<std::pair<std::string, std::string>> methods()

Return a list of available solver methods

static Parameters default_parameters()

Default parameter values

SNES snes() const

Return PETSc SNES pointer