|
| NonlinearSolver (const DampingParameters< real_type > &dampingParams) |
| Creates a damped Newton nonlinear solver. More...
|
|
| NonlinearSolver () |
| Creates an un-damped Newton solver. More...
|
|
template<typename Solver , typename Residual , std::size_t DIM, std::size_t N> |
DiscreteFunction< DIM, value_type, N, N > | SolveWithStatus (Solver solve, Residual residual, DiscreteFunction< DIM, value_type, N, N > initialGuess, double &tolerance, std::size_t &iterations) |
| Solve the nonlinear system \(F(u) = 0\), where \(F(u)\) is the residual, and returns, via reference arguments, the actual number of iterations and achieved residual tolerance. More...
|
|
template<typename Solver , typename Residual , std::size_t DIM, std::size_t N> |
DiscreteFunction< DIM, value_type, N, N > | SolveWithStatus (Solver solve, Residual residual, const DiscreteFunction< DIM, value_type, N, N > &initialGuess, std::size_t &iterations) |
| Solve the nonlinear system \(F(u) = 0\), where \(F(u)\) is the residual, and returns, via reference arguments, the actual number of iterations. More...
|
|
template<typename Solver , typename Residual , std::size_t DIM, std::size_t N> |
DiscreteFunction< DIM, value_type, N, N > | Solve (Solver solve, Residual residual, DiscreteFunction< DIM, value_type, N, N > initialGuess, double tolerance=1e-8, std::size_t maxItns=100) |
| Solve the nonlinear system \(F(u) = 0\), where \(F(u)\) is the residual. More...
|
|
template<typename Solver , typename Residual , std::size_t DIM, std::size_t N> |
DiscreteFunction< DIM, value_type, N, N > | Solve (Solver solve, Residual residual, const DiscreteFunction< DIM, value_type, N, N > &initialGuess, std::size_t maxItns) |
| Solve the nonlinear system \(F(u) = 0\), where \(F(u)\) is the residual. More...
|
|
template<typename T>
class ptems::NonlinearSolver< T >
Nonlinear solver using (damped) Newton.
- Todo:
- This is for damped Newton only, should try to generalise!
- Template Parameters
-
T | The type of the nonlinear system |
template<typename T >
template<typename Solver , typename Residual , std::size_t DIM, std::size_t N>
Solve the nonlinear system \(F(u) = 0\), where \(F(u)\) is the residual, and returns, via reference arguments, the actual number of iterations.
Uses default tolerance of 1e-8.
- Template Parameters
-
Solver | Type of the function to solve \(F'(u)v = F(u)\), where \(F'(u)v\) is the Frechet derivative of F in the direction \(v\) at \(u\). |
Residual | Type of the residual ( \(F\)) function |
DIM | The dimension of the underlying domain |
N | The number of variables in the underlying finite element space |
- Parameters
-
solve | Function to solve \(F'(u)v = F(u)\), where \(F'(u)v\) is the Frechet derivative of F in the direction \(v\) at \(u\). Should take form DiscreteFunction<DIM, value_type, N>(const DiscreteFunction<DIM, value_type, N>&, const std::vector<value_type>&) where the first argument is the function \(u\) and the second is the right hand side (residual \(F(u)\) evaluated at \(u\)), and should return the update \(v\). |
residual | Function to compute the residual \(u\). Should have the form void(const DiscreteFunction<DIM, value_type, N>&, std::vector<value_type>&) where the first argument is the function \(u\) and the second is the residual vector \(F(u)\) to update - note this vector must be returned the same size as passed. |
initialGuess | The initial guess for the Newton solver |
iterations | Maximum number of Newton iterations to compute the solution. Updated at exit with the number of actual iterations performed |
- Returns
- The solution to the nonlinear solve
template<typename T >
template<typename Solver , typename Residual , std::size_t DIM, std::size_t N>
DiscreteFunction<DIM, value_type, N, N> ptems::NonlinearSolver< T >::SolveWithStatus |
( |
Solver |
solve, |
|
|
Residual |
residual, |
|
|
DiscreteFunction< DIM, value_type, N, N > |
initialGuess, |
|
|
double & |
tolerance, |
|
|
std::size_t & |
iterations |
|
) |
| |
|
inline |
Solve the nonlinear system \(F(u) = 0\), where \(F(u)\) is the residual, and returns, via reference arguments, the actual number of iterations and achieved residual tolerance.
- Exceptions
-
- Template Parameters
-
Solver | Type of the function to solve \(F'(u)v = F(u)\), where \(F'(u)v\) is the Frechet derivative of F in the direction \(v\) at \(u\). |
Residual | Type of the residual ( \(F\)) function |
DIM | The dimension of the underlying domain |
N | The number of variables in the underlying finite element space |
- Parameters
-
solve | Function to solve \(F'(u)v = F(u)\), where \(F'(u)v\) is the Frechet derivative of F in the direction \(v\) at \(u\). Should take form DiscreteFunction<DIM, value_type, N>(const DiscreteFunction<DIM, value_type, N>&, const std::vector<value_type>&) where the first argument is the function \(u\) and the second is the right hand side (residual \(F(u)\) evaluated at \(u\)), and should return the update \(v\). |
residual | Function to compute the residual \(u\). Should have the form void(const DiscreteFunction<DIM, value_type, N>&, std::vector<value_type>&) where the first argument is the function \(u\) and the second is the residual vector \(F(u)\) to update - note this vector must be returned the same size as passed. |
initialGuess | The initial guess for the Newton solver |
tolerance | Tolerance to acheive in the Newton solver. Updated at exit with the achieved tolerance |
iterations | Maximum number of Newton iterations to compute the solution. Updated at exit with the number of actual iterations performed |
- Returns
- The solution to the nonlinear solve