Reference documentation for deal.II version 9.1.1
|
#include <deal.II/algorithms/newton.h>
Public Member Functions | |
Newton (OperatorBase &residual, OperatorBase &inverse_derivative) | |
void | parse_parameters (ParameterHandler ¶m) |
void | initialize (OutputOperator< VectorType > &output) |
virtual void | operator() (AnyData &out, const AnyData &in) override |
virtual void | notify (const Event &) override |
double | threshold (double new_value) |
Public Member Functions inherited from Algorithms::OperatorBase | |
virtual | ~OperatorBase () override=default |
void | clear_events () |
Public Member Functions inherited from Subscriptor | |
Subscriptor () | |
Subscriptor (const Subscriptor &) | |
Subscriptor (Subscriptor &&) noexcept | |
virtual | ~Subscriptor () |
Subscriptor & | operator= (const Subscriptor &) |
Subscriptor & | operator= (Subscriptor &&) noexcept |
void | subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const |
void | unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const |
unsigned int | n_subscriptions () const |
template<typename StreamType > | |
void | list_subscribers (StreamType &stream) const |
void | list_subscribers () const |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Static Public Member Functions | |
static void | declare_parameters (ParameterHandler ¶m) |
Static Public Member Functions inherited from Subscriptor | |
static ::ExceptionBase & | ExcInUse (int arg1, std::string arg2, std::string arg3) |
static ::ExceptionBase & | ExcNoSubscriber (std::string arg1, std::string arg2) |
Public Attributes | |
ReductionControl | control |
bool | debug_vectors |
unsigned int | debug |
Private Attributes | |
SmartPointer< OperatorBase, Newton< VectorType > > | residual |
SmartPointer< OperatorBase, Newton< VectorType > > | inverse_derivative |
SmartPointer< OutputOperator< VectorType >, Newton< VectorType > > | data_out |
bool | assemble_now |
unsigned int | n_stepsize_iterations |
double | assemble_threshold |
Additional Inherited Members | |
Protected Attributes inherited from Algorithms::OperatorBase | |
Event | notifications |
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.
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 AnyData 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"
.
Algorithms::Newton< VectorType >::Newton | ( | OperatorBase & | residual, |
OperatorBase & | inverse_derivative | ||
) |
Constructor, receiving the applications computing the residual and solving the linear problem, respectively.
|
static |
Declare the parameters applicable to Newton's method.
void Algorithms::Newton< VectorType >::parse_parameters | ( | ParameterHandler & | param | ) |
Read the parameters in the ParameterHandler.
void Algorithms::Newton< VectorType >::initialize | ( | OutputOperator< VectorType > & | output | ) |
Initialize the pointer data_out for debugging.
|
overridevirtual |
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::OperatorBase.
|
overridevirtual |
Register an event triggered by an outer iteration.
Reimplemented from Algorithms::OperatorBase.
double Algorithms::Newton< VectorType >::threshold | ( | double | new_value | ) |
Set the maximal residual reduction allowed without triggering assembling in the next step. Return the previous value.
ReductionControl Algorithms::Newton< VectorType >::control |
|
private |
|
private |
|
private |
|
private |
|
private |
|
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.
The default values is zero, resulting in reassembling in every Newton step.
bool Algorithms::Newton< VectorType >::debug_vectors |
unsigned int Algorithms::Newton< VectorType >::debug |