Loading...
Searching...
No Matches
newton

nonlinear solver

# Synopsis

template <class Problem, class Field>
int newton (const Problem& P, Field& uh, Float& tol, size_t& max_iter, odiststream *p_derr = 0)

# Description

This function implements a generic Newton method for the resolution of the following problem:

        F(u) = 0

A simple call to the algorithm writes:

        my_problem P;
        field uh (Xh);
        newton (P, uh, tol, max_iter);

The my_problem class should contain some methods for the evaluation of F, i.e. the residue of the problem, and its derivative. The minimal requirements are:

        class my_problem {
        public:
          typedef value_type;
          value_type residue           (const value_type& uh)  const;
          void update_derivative       (const value_type& uh)  const;
          value_type  derivative_solve (const value_type& mrh) const;
          Float dual_space_norm        (const value_type& mrh) const;
        };

The value_type could be a field. The Newton method could also be applied when value_type is a simple Float scalar. Conversely, it supports multi-field extensions.

The update_derivative and derivative_solver members are called at each step of the Newton algorithm.

The dual_space_norm member function returns a scalar from the weighted residual field term mrh returned by the residue function: this scalar is used as the stopping criterion of the algorithm.

# Example

See the p_laplacian_newton.cc example and the User's guide for more.

# Implementation

This documentation has been generated from file main/lib/newton.h