OGS
|
Find a solution to a nonlinear equation using the Picard fixpoint iteration method.
Definition at line 160 of file NonlinearSolver.h.
#include <NonlinearSolver.h>
Public Types | |
using | System = NonlinearSystem< NonlinearSolverTag::Picard > |
Type of the nonlinear equation system to be solved. More... | |
Public Member Functions | |
NonlinearSolver (GlobalLinearSolver &linear_solver, const int maxiter) | |
~NonlinearSolver () | |
void | setEquationSystem (System &eq, ConvergenceCriterion &conv_crit) |
void | calculateNonEquilibriumInitialResiduum (std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id) override |
NonlinearSolverStatus | solve (std::vector< GlobalVector * > &x, std::vector< GlobalVector * > const &x_prev, std::function< void(int, std::vector< GlobalVector * > const &)> const &postIterationCallback, int const process_id) override |
void | compensateNonEquilibriumInitialResiduum (bool const value) |
Public Member Functions inherited from NumLib::NonlinearSolverBase | |
virtual | ~NonlinearSolverBase ()=default |
Private Attributes | |
GlobalLinearSolver & | _linear_solver |
System * | _equation_system = nullptr |
ConvergenceCriterion * | _convergence_criterion = nullptr |
const int | _maxiter |
maximum number of iterations More... | |
GlobalVector * | _r_neq = nullptr |
non-equilibrium initial residuum. More... | |
std::size_t | _A_id = 0u |
ID of the \( A \) matrix. More... | |
std::size_t | _rhs_id = 0u |
ID of the right-hand side vector. More... | |
std::size_t | _x_new_id = 0u |
std::size_t | _r_neq_id = 0u |
bool | _compensate_non_equilibrium_initial_residuum = false |
using NumLib::NonlinearSolver< NonlinearSolverTag::Picard >::System = NonlinearSystem<NonlinearSolverTag::Picard> |
Type of the nonlinear equation system to be solved.
Definition at line 165 of file NonlinearSolver.h.
|
inlineexplicit |
Constructs a new instance.
linear_solver | the linear solver used by this nonlinear solver. |
maxiter | the maximum number of iterations used to solve the equation. |
Definition at line 173 of file NonlinearSolver.h.
Definition at line 457 of file NonlinearSolver.cpp.
References NumLib::GlobalVectorProvider::provider, and NumLib::VectorProvider::releaseVector().
|
overridevirtual |
Implements NumLib::NonlinearSolverBase.
Definition at line 27 of file NonlinearSolver.cpp.
References MathLib::LinAlg::axpy(), NumLib::MatrixProvider::getMatrix(), NumLib::VectorProvider::getVector(), MathLib::LinAlg::matMult(), NumLib::GlobalVectorProvider::provider, and NumLib::GlobalMatrixProvider::provider.
|
inline |
Definition at line 201 of file NonlinearSolver.h.
|
inline |
Set the nonlinear equation system that will be solved. TODO doc
Definition at line 183 of file NonlinearSolver.h.
|
overridevirtual |
Assemble and solve the equation system.
x | in: the initial guess, out: the solution. |
x_prev | previous time step solution. |
postIterationCallback | called after each iteration if set. |
process_id | usually used in staggered schemes. |
true | if the equation system could be solved |
false | otherwise |
Implements NumLib::NonlinearSolverBase.
Definition at line 49 of file NonlinearSolver.cpp.
References MathLib::LinAlg::axpy(), MathLib::LinAlg::copy(), BaseLib::RunTime::elapsed(), ERR(), NumLib::FAILURE, NumLib::MatrixProvider::getMatrix(), NumLib::VectorProvider::getVector(), INFO(), MathLib::LinAlg::matMult(), NumLib::GlobalVectorProvider::provider, NumLib::GlobalMatrixProvider::provider, NumLib::MatrixProvider::releaseMatrix(), NumLib::VectorProvider::releaseVector(), NumLib::REPEAT_ITERATION, BaseLib::RunTime::start(), and NumLib::SUCCESS.
|
private |
ID of the \( A \) matrix.
Definition at line 215 of file NonlinearSolver.h.
|
private |
Enables computation of the non-equilibrium initial residuum \( r_{\rm neq} \) before the first time step. The forces are zero if the external forces are in equilibrium with the initial state/initial conditions. During the simulation the new residuum reads \( \tilde r = r - r_{\rm neq} \).
Definition at line 224 of file NonlinearSolver.h.
|
private |
Definition at line 211 of file NonlinearSolver.h.
|
private |
Definition at line 208 of file NonlinearSolver.h.
|
private |
Definition at line 207 of file NonlinearSolver.h.
|
private |
maximum number of iterations
Definition at line 212 of file NonlinearSolver.h.
|
private |
non-equilibrium initial residuum.
Definition at line 214 of file NonlinearSolver.h.
|
private |
ID of the non-equilibrium initial residuum vector.
Definition at line 219 of file NonlinearSolver.h.
|
private |
ID of the right-hand side vector.
Definition at line 216 of file NonlinearSolver.h.
|
private |
ID of the vector storing the solution of the linearized equation.
Definition at line 217 of file NonlinearSolver.h.