The multi-dimensional Newton method.
More...
#include <newtonmethod.hh>
|
| NewtonMethod (Simulator &simulator) |
|
bool | converged () const |
| Returns true if the error of the solution is below the tolerance. More...
|
|
Problem & | problem () |
| Returns a reference to the object describing the current physical problem. More...
|
|
const Problem & | problem () const |
| Returns a reference to the object describing the current physical problem. More...
|
|
Model & | model () |
| Returns a reference to the numeric model. More...
|
|
const Model & | model () const |
| Returns a reference to the numeric model. More...
|
|
int | numIterations () const |
| Returns the number of iterations done since the Newton method was invoked. More...
|
|
Scalar | tolerance () const |
| Return the current tolerance at which the Newton method considers itself to be converged. More...
|
|
void | setTolerance (Scalar value) |
| Set the current tolerance at which the Newton method considers itself to be converged. More...
|
|
bool | apply () |
| Run the Newton method. More...
|
|
Scalar | linearizeTime () const |
| Returns the wall time spend so far for linearizing the non-linear system for all iterations of the current time step. More...
|
|
Scalar | solveTime () const |
| Returns the wall time spend so far for solving the linear systems for all iterations of the current time step. More...
|
|
Scalar | updateTime () const |
| Returns the wall time spend so far for updating the iterative solutions of the non-linear system for all iterations of the current time step. More...
|
|
Scalar | suggestTimeStepSize (Scalar oldTimeStep) const |
| Suggest a new time-step size based on the old time-step size. More...
|
|
std::ostringstream & | endIterMsg () |
| Message that should be printed for the user after the end of an iteration. More...
|
|
|
bool | verbose_ () const |
| Returns true if the Newton method ought to be chatty. More...
|
|
void | begin_ (const SolutionVector &u) |
| Called before the Newton method is applied to an non-linear system of equations. More...
|
|
void | beginIteration_ () |
| Indicates the beginning of a Newton iteration. More...
|
|
void | linearize_ () |
| Linearize the global non-linear system of equations. More...
|
|
bool | solveLinear_ (const JacobianMatrix &A, GlobalEqVector &x, GlobalEqVector &b) |
| Solve the linear system of equations . More...
|
|
void | updateError_ (const SolutionVector &nextSolution, const SolutionVector ¤tSolution, const GlobalEqVector ¤tResidual, const GlobalEqVector &solutionUpdate) |
| Update the error of the solution given the previous iteration. More...
|
|
void | update_ (SolutionVector &nextSolution, const SolutionVector ¤tSolution, const GlobalEqVector &solutionUpdate, const GlobalEqVector ¤tResidual) |
| Update the current solution with a delta vector. More...
|
|
void | updatePrimaryVariables_ (int globalDofIdx, PrimaryVariables &nextValue, const PrimaryVariables ¤tValue, const EqVector &update, const EqVector ¤tResidual) |
| Update a single primary variables object. More...
|
|
void | writeConvergence_ (const SolutionVector ¤tSolution, const GlobalEqVector &solutionUpdate) |
| Write the convergence behaviour of the newton method to disk. More...
|
|
void | endIteration_ (const SolutionVector &nextSolution, const SolutionVector ¤tSolution) |
| Indicates that one Newton iteration was finished. More...
|
|
bool | proceed_ () const |
| Returns true iff another Newton iteration should be done. More...
|
|
void | end_ () |
| Indicates that we're done solving the non-linear system of equations. More...
|
|
void | failed_ () |
| Called if the Newton method broke down. More...
|
|
void | succeeded_ () |
| Called if the Newton method was successful. More...
|
|
int | targetIterations_ () const |
|
int | maxIterations_ () const |
|
template<class TypeTag>
class Ewoms::NewtonMethod< TypeTag >
The multi-dimensional Newton method.
This class uses static polymorphism to allow implementations to implement different update/convergence strategies.
Run the Newton method.
The actual implementation can influence all the strategic decisions via callbacks using static polymorphism.
References Ewoms::Simulator< TypeTag >::addPrePostProcessTime(), Ewoms::NewtonMethod< TypeTag >::converged(), Ewoms::Timer::halt(), Ewoms::NewtonMethod< TypeTag >::linearizeTime_, Ewoms::NewtonMethod< TypeTag >::linearizeTimer_, Ewoms::NewtonMethod< TypeTag >::model(), Ewoms::NewtonMethod< TypeTag >::proceed_(), Ewoms::Timer::realTimeElapsed(), Ewoms::NewtonMethod< TypeTag >::simulator_, Ewoms::NewtonMethod< TypeTag >::solveTime_, Ewoms::NewtonMethod< TypeTag >::solveTimer_, Ewoms::Timer::start(), Ewoms::Timer::stop(), Ewoms::NewtonMethod< TypeTag >::updateTime_, Ewoms::NewtonMethod< TypeTag >::updateTimer_, and Ewoms::NewtonMethod< TypeTag >::verbose_().
Referenced by Ewoms::FvBaseDiscretization< TypeTag >::update().
template<class TypeTag >
void Ewoms::NewtonMethod< TypeTag >::endIteration_ |
( |
const SolutionVector & |
nextSolution, |
|
|
const SolutionVector & |
currentSolution |
|
) |
| |
|
inlineprotected |
template<class TypeTag >
bool Ewoms::NewtonMethod< TypeTag >::solveLinear_ |
( |
const JacobianMatrix & |
A, |
|
|
GlobalEqVector & |
x, |
|
|
GlobalEqVector & |
b |
|
) |
| |
|
inlineprotected |
Solve the linear system of equations .
Throws Opm::NumericalProblem if the linear solver didn't converge.
- Parameters
-
A | The matrix of the linear system of equations |
x | The vector which solves the linear system |
b | The right hand side of the linear system |
References Ewoms::NewtonMethod< TypeTag >::linearSolver_.
template<class TypeTag >
void Ewoms::NewtonMethod< TypeTag >::update_ |
( |
SolutionVector & |
nextSolution, |
|
|
const SolutionVector & |
currentSolution, |
|
|
const GlobalEqVector & |
solutionUpdate, |
|
|
const GlobalEqVector & |
currentResidual |
|
) |
| |
|
inlineprotected |
Update the current solution with a delta vector.
Different update strategies, such as chopped updates can be implemented by overriding this method. The default behavior is use the standard Newton-Raphson update strategy, i.e.
- Parameters
-
nextSolution | The solution vector after the current iteration |
currentSolution | The solution vector after the last iteration |
solutionUpdate | The delta vector as calculated by solving the linear system of equations |
currentResidual | The residual vector of the current Newton-Raphson iteraton |
template<class TypeTag >
void Ewoms::NewtonMethod< TypeTag >::updateError_ |
( |
const SolutionVector & |
nextSolution, |
|
|
const SolutionVector & |
currentSolution, |
|
|
const GlobalEqVector & |
currentResidual, |
|
|
const GlobalEqVector & |
solutionUpdate |
|
) |
| |
|
inlineprotected |
template<class TypeTag >
void Ewoms::NewtonMethod< TypeTag >::updatePrimaryVariables_ |
( |
int |
globalDofIdx, |
|
|
PrimaryVariables & |
nextValue, |
|
|
const PrimaryVariables & |
currentValue, |
|
|
const EqVector & |
update, |
|
|
const EqVector & |
currentResidual |
|
) |
| |
|
inlineprotected |
Update a single primary variables object.
template<class TypeTag >
void Ewoms::NewtonMethod< TypeTag >::writeConvergence_ |
( |
const SolutionVector & |
currentSolution, |
|
|
const GlobalEqVector & |
solutionUpdate |
|
) |
| |
|
inlineprotected |
The documentation for this class was generated from the following file:
|