Public Member Functions | Public Attributes | Private Attributes

Algorithms::Newton< VECTOR > Class Template Reference

Inheritance diagram for Algorithms::Newton< VECTOR >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Newton (Operator< VECTOR > &residual, Operator< VECTOR > &inverse_derivative)
void declare_parameters (ParameterHandler &param)
void initialize (ParameterHandler &param)
void initialize (OutputOperator< VECTOR > &output)
virtual void operator() (NamedData< VECTOR * > &out, const NamedData< VECTOR * > &in)
virtual void notify (const Event &)
double threshold (double new_value)

Public Attributes

ReductionControl control
bool debug_vectors
unsigned int debug

Private Attributes

SmartPointer< Operator< VECTOR >
, Newton< VECTOR > > 
residual
SmartPointer< Operator< VECTOR >
, Newton< VECTOR > > 
inverse_derivative
SmartPointer< OutputOperator
< VECTOR >, Newton< VECTOR > > 
data_out
bool assemble_now
unsigned int n_stepsize_iterations
double assemble_threshold

Detailed Description

template<class VECTOR>
class Algorithms::Newton< VECTOR >

Operator class performing Newton's iteration with standard step size control and adaptive matrix generation.

This class performes a Newton iteration up to convergence determined by control. If after an update the norm of the residual has become larger, then step size control is activated and the update is subsequently divided by two until the residual actually becomes smaller (or the minimal scaling factor determined by n_stepsize_iterations is reached).

Since assembling matrices, depending on the implementation, tends to be costly, this method applies an adaptive reassembling strategy. Only if the reduction factor for the residual is more than threshold, the event Algorithms::bad_derivative is submitted to inverse_derivative. It is up to this object to implement reassembling accordingly.

Contents of the NamedData objects

The only value used by the Newton method is the first vector in the parameter out of operator()(). It serves as the start vector of Newton's method and in the end contains the solution. All other vectors of out are ignored by Newton's method and its inner Operator objects. All vectors of in are forwarded to the inner Operator objects, with additional information added as follows.

When calling (*residual)(), the NamedData in given to the Newton iteration is prepended by a vector "Newton iterate", the current value of the Newton iterate, which can be used to evaluate the residual at this point.

For the call to (*inverse_derivative), the vector "Newton residual" is inserted before "Newton iterate".

Author:
Guido Kanschat, 2006, 2010

Definition at line 64 of file newton.h.


Constructor & Destructor Documentation

template<class VECTOR >
Algorithms::Newton< VECTOR >::Newton ( Operator< VECTOR > &  residual,
Operator< VECTOR > &  inverse_derivative 
)

Constructor, receiving the applications computing the residual and solving the linear problem, respectively.


Member Function Documentation

template<class VECTOR >
void Algorithms::Newton< VECTOR >::declare_parameters ( ParameterHandler param )

Declare the parameters applicable to Newton's method.

template<class VECTOR >
void Algorithms::Newton< VECTOR >::initialize ( ParameterHandler param )

Read the parameters.

template<class VECTOR >
void Algorithms::Newton< VECTOR >::initialize ( OutputOperator< VECTOR > &  output )

Initialize the pointer data_out for debugging.

template<class VECTOR >
virtual void Algorithms::Newton< VECTOR >::operator() ( NamedData< VECTOR * > &  out,
const NamedData< VECTOR * > &  in 
) [virtual]

The actual Newton iteration. The initial value is in out(0), which also contains the result after convergence. Values in in are not used by Newton, but will be handed down to the objects residual and inverse_derivative.

Implements Algorithms::Operator< VECTOR >.

template<class VECTOR >
virtual void Algorithms::Newton< VECTOR >::notify ( const Event  ) [virtual]

Register an event triggered by an outer iteration.

Reimplemented from Algorithms::Operator< VECTOR >.

template<class VECTOR >
double Algorithms::Newton< VECTOR >::threshold ( double  new_value )

Set the maximal residual reduction allowed without triggering assembling in the next step. Return the previous value.


Member Data Documentation

template<class VECTOR >
ReductionControl Algorithms::Newton< VECTOR >::control

Control object for the Newton iteration.

Definition at line 120 of file newton.h.

template<class VECTOR >
SmartPointer<Operator<VECTOR>, Newton<VECTOR> > Algorithms::Newton< VECTOR >::residual [private]

The operator computing the residual.

Definition at line 125 of file newton.h.

template<class VECTOR >
SmartPointer<Operator<VECTOR>, Newton<VECTOR> > Algorithms::Newton< VECTOR >::inverse_derivative [private]

The operator applying the inverse derivative to the residual.

Definition at line 131 of file newton.h.

template<class VECTOR >
SmartPointer<OutputOperator<VECTOR>, Newton<VECTOR> > Algorithms::Newton< VECTOR >::data_out [private]

The operator handling the output in case the debug_vectors is true. Call the initialize function first.

Definition at line 138 of file newton.h.

template<class VECTOR >
bool Algorithms::Newton< VECTOR >::assemble_now [private]

This flag is set by the function assemble(), indicating that the matrix must be assembled anew upon start.

Definition at line 147 of file newton.h.

template<class VECTOR >
unsigned int Algorithms::Newton< VECTOR >::n_stepsize_iterations [private]

A flag used to decide how many stepsize iteration should be made. Default is the original value of 21.

Enter zero here to turn of stepsize control.

Note:
Controlled by Stepsize iterations in parameter file

Definition at line 162 of file newton.h.

template<class VECTOR >
double Algorithms::Newton< VECTOR >::assemble_threshold [private]

Threshold for re-assembling matrix.

If the quotient of two consecutive residuals is smaller than this threshold, the system matrix is not assembled in this step.

Note:
This parameter should be adjusted to the residual gain of the inner solver.

The default values is zero, resulting in reassembling in every Newton step.

Definition at line 181 of file newton.h.

template<class VECTOR >
bool Algorithms::Newton< VECTOR >::debug_vectors

Print residual, update and updated solution after each step into file Newton_NNN?

Definition at line 190 of file newton.h.

template<class VECTOR >
unsigned int Algorithms::Newton< VECTOR >::debug

Write debug output to deallog; the higher the number, the more output.

Definition at line 196 of file newton.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

deal.II documentation generated on Fri Feb 3 2012 06:04:13 by doxygen 1.7.2