Reference documentation for deal.II version 8.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Public Member Functions | Public Attributes | Private Attributes | List of all members
Algorithms::Newton< VECTOR > Class Template Reference

#include <newton.h>

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

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 Member Functions inherited from Algorithms::Operator< VECTOR >
 ~Operator ()
 
void clear_events ()
 
- Public Member Functions inherited from Subscriptor
 Subscriptor ()
 
 Subscriptor (const Subscriptor &)
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
void subscribe (const char *identifier=0) const
 
void unsubscribe (const char *identifier=0) const
 
unsigned int n_subscriptions () const
 
void list_subscribers () const
 
 DeclException3 (ExcInUse, int, char *, std::string &,<< "Object of class "<< arg2<< " is still used by "<< arg1<< " other objects.\n"<< "(Additional information: "<< arg3<< ")\n"<< "Note the entry in the Frequently Asked Questions of "<< "deal.II (linked to from http://www.dealii.org/) for "<< "more information on what this error means.")
 
 DeclException2 (ExcNoSubscriber, char *, char *,<< "No subscriber with identifier \""<< arg2<< "\" did subscribe to this object of class "<< arg1)
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

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
 

Additional Inherited Members

- Protected Attributes inherited from Algorithms::Operator< VECTOR >
Event notifications
 

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 performs 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 69 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.

Definition at line 32 of file newton.templates.h.

Member Function Documentation

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

Declare the parameters applicable to Newton's method.

Definition at line 45 of file newton.templates.h.

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

Read the parameters.

Definition at line 58 of file newton.templates.h.

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

Initialize the pointer data_out for debugging.

Definition at line 70 of file newton.templates.h.

template<class VECTOR >
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 >.

Definition at line 86 of file newton.templates.h.

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

Register an event triggered by an outer iteration.

Reimplemented from Algorithms::Operator< VECTOR >.

Definition at line 77 of file newton.templates.h.

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 125 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 130 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 136 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 143 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 152 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 167 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 186 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 195 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 201 of file newton.h.


The documentation for this class was generated from the following files: