Class ae108::cpppetsc::NonlinearSolver
ClassList > ae108 > cpppetsc > NonlinearSolver
Classes
| Type | Name |
|---|---|
| struct | Tolerances |
Public Types
| Type | Name |
|---|---|
| typedef std::function< void(const distributed< Vector > &, distributed< Vector > *)> | FunctionFunctor |
| typedef std::function< void(const distributed< Vector > &, Matrix *)> | JacobianFunctor The first parameter is the input, the second parameter is the output. |
| typedef typename Matrix::size_type | size_type |
Public Functions
| Type | Name |
|---|---|
| NonlinearSolver (const size_type dimension) Initializes the nonlinear solver with the problem dimension. |
|
| NonlinearSolver (Matrix buffer_matrix, distributed< Vector > buffer_vector) Initializes the nonlinear solver with the given buffer entities of correct dimension. |
|
| Tolerances | getTolerances () Get various parameters used in convergence tests. |
| void | setBasicTolerances (const Tolerances::real_type abstol, const Tolerances::real_type rtol) Set absolute and relative convergence tolerances. |
| void | setTolerances (const Tolerances & tolerances) Set SNES various parameters used in convergence tests. |
| distributed< Vector > | solve (FunctionFunctor function, JacobianFunctor jacobian, distributed< Vector > guess) const Solves the nonlinear equation f(x) == 0 for x. |
Public Types Documentation
typedef FunctionFunctor
using ae108::cpppetsc::NonlinearSolver::FunctionFunctor = std::function<void(const distributed<Vector> &, distributed<Vector> *)>;
Remark:
The first parameter is the input, the second parameter is the output.
typedef JacobianFunctor
The first parameter is the input, the second parameter is the output.
using ae108::cpppetsc::NonlinearSolver::JacobianFunctor = std::function<void(const distributed<Vector> &, Matrix *)>;
typedef size_type
using ae108::cpppetsc::NonlinearSolver::size_type = typename Matrix::size_type;
Public Functions Documentation
function NonlinearSolver [1/2]
Initializes the nonlinear solver with the problem dimension.
explicit ae108::cpppetsc::NonlinearSolver::NonlinearSolver (
const size_type dimension
)
Parameters:
dimensionThe ambient dimension, e.g. the size of the vector that the function returns.
function NonlinearSolver [2/2]
Initializes the nonlinear solver with the given buffer entities of correct dimension.
explicit ae108::cpppetsc::NonlinearSolver::NonlinearSolver (
Matrix buffer_matrix,
distributed < Vector > buffer_vector
)
Remark:
If buffer_matrix is of type MATNEST or MATSHELL, then no preconditioner is applied by default.
function getTolerances
Get various parameters used in convergence tests.
Tolerances ae108::cpppetsc::NonlinearSolver::getTolerances ()
function setBasicTolerances
Set absolute and relative convergence tolerances.
void ae108::cpppetsc::NonlinearSolver::setBasicTolerances (
const Tolerances::real_type abstol,
const Tolerances::real_type rtol
)
function setTolerances
Set SNES various parameters used in convergence tests.
void ae108::cpppetsc::NonlinearSolver::setTolerances (
const Tolerances & tolerances
)
function solve
Solves the nonlinear equation f(x) == 0 for x.
distributed < Vector > ae108::cpppetsc::NonlinearSolver::solve (
FunctionFunctor function,
JacobianFunctor jacobian,
distributed < Vector > guess
) const
Parameters:
functionA function object that computes f at a given point.jacobianA function object that computes the Jacobian of f at given point.
Exception:
- NonlinearSolverDivergedException if the solve diverged.
Returns:
The solution x of the nonlinear equation.
The documentation for this class was generated from the following file cpppetsc/src/include/ae108/cpppetsc/NonlinearSolver.h