Class ae108::cpppetsc::NonlinearSolver
template <class Policy>
ClassList > ae108 > cpppetsc > NonlinearSolver
Public Types
Type | Name |
---|---|
typedef std::function< void(const distributed< vector_type > &, distributed< vector_type > *)> | FunctionFunctor |
typedef std::function< void(const distributed< vector_type > &, matrix_type *)> | JacobianFunctor The first parameter is the input, the second parameter is the output. |
typedef Matrix< Policy > | matrix_type |
typedef typename Matrix< Policy >::size_type | size_type |
typedef Vector< Policy > | vector_type |
Public Functions
Type | Name |
---|---|
NonlinearSolver (const size_type dimension) Initializes the nonlinear solver with the problem dimension. |
|
NonlinearSolver (matrix_type buffer_matrix, distributed< vector_type > buffer_vector) Initializes the nonlinear solver with the given buffer entities of correct dimension. |
|
distributed< vector_type > | solve (FunctionFunctor function, JacobianFunctor jacobian, distributed< vector_type > guess) const Solves the nonlinear equation f(x) == 0 for x. |
Public Types Documentation
typedef FunctionFunctor
using ae108::cpppetsc::NonlinearSolver< Policy >::FunctionFunctor = std::function<void(const distributed<vector_type> &, distributed<vector_type> *)>;
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< Policy >::JacobianFunctor = std::function<void(const distributed<vector_type> &, matrix_type *)>;
typedef matrix_type
using ae108::cpppetsc::NonlinearSolver< Policy >::matrix_type = Matrix<Policy>;
typedef size_type
using ae108::cpppetsc::NonlinearSolver< Policy >::size_type = typename Matrix<Policy>::size_type;
typedef vector_type
using ae108::cpppetsc::NonlinearSolver< Policy >::vector_type = Vector<Policy>;
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:
dimension
The 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_type buffer_matrix,
distributed < vector_type > buffer_vector
)
Remark:
If buffer_matrix
is of type MATNEST or MATSHELL, then no preconditioner is applied by default.
function solve
Solves the nonlinear equation f(x) == 0 for x.
distributed < vector_type > ae108::cpppetsc::NonlinearSolver::solve (
FunctionFunctor function,
JacobianFunctor jacobian,
distributed < vector_type > guess
) const
Parameters:
function
A function object that computes f at a given point.jacobian
A 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