#include <nonlinear.h>
Nonlinear (EquationSystems &es)
Nonlinear (EquationSystems &es, const std::string &name, const unsigned int number)
~Nonlinear ()
virtual void solve ()
unsigned int max_nonlinear_steps () const
unsigned int & max_nonlinear_steps ()
Real nonlinear_tolerance () const
Real & nonlinear_tolerance ()
unsigned int _max_nl_steps
Real _nl_tol
Author:
Definition at line 44 of file nonlinear.h.
Definition at line 111 of file nonlinear.h.
:
T (es), // Call the base class constructor
_max_nl_steps (5), // Default solver attributes
_nl_tol (1.e-6)
{
}
Definition at line 122 of file nonlinear.h.
:
Nonlinear (es),
T (es, name, number) // Call the base class constructor
{
}
Definition at line 134 of file nonlinear.h.
{
}
Definition at line 74 of file nonlinear.h.
References Nonlinear< T >::_max_nl_steps.
{ return _max_nl_steps; }
Definition at line 79 of file nonlinear.h.
References Nonlinear< T >::_max_nl_steps.
{ return _max_nl_steps; }
Definition at line 84 of file nonlinear.h.
References Nonlinear< T >::_nl_tol.
{ return _nl_tol; }
Definition at line 89 of file nonlinear.h.
References Nonlinear< T >::_nl_tol.
{ return _nl_tol; }
Definition at line 142 of file nonlinear.h.
{
for (unsigned int l=0; l<this->max_nonlinear_steps(); l++)
{
// Get a copy of the solution at the current nonlinear
// iteration
AutoPtr<NumericVector<Number> >
last_nonlinear_soln (this->system().solution->clone());
// Call the base class solver
T::solve ();
// Compute the difference between this solution
// and the last iterate
last_nonlinear_soln->add (-1., *(this->system().solution));
// We must close the vector before we ask it for its norm
last_nonlinear_soln->close();
// Compute the l2 norm of the difference
const Real norm_delta = last_nonlinear_soln->l2_norm();
// Print out convergence information
std::cout << 'Nonlinear convergence: ||u - u_old|| = '
<< norm_delta
<< std::endl;
// Terminate the solution iteration if the difference between
// this iteration and the last is sufficiently small.
if (norm_delta < this->nonlinear_tolerance())
{
std::cout << ' Nonlinear solver converged at step '
<< l
<< std::endl;
break;
}
}
}
Definition at line 97 of file nonlinear.h.
Referenced by Nonlinear< T >::max_nonlinear_steps().
Definition at line 102 of file nonlinear.h.
Referenced by Nonlinear< T >::nonlinear_tolerance().
Generated automatically by Doxygen for libMesh from the source code.