.TH "newton" 3rheolef "Sat Mar 13 2021" "Version 7.1" "rheolef" \" -*- nroff -*- .ad l .nh .SH NAME newton \- nonlinear solver (rheolef-7\&.1) .PP .SH "SYNOPSIS" .PP .PP .nf template int newton (const Problem& P, Field& uh, Float& tol, size_t& max_iter, odiststream *p_derr = 0) .fi .PP .SH "DESCRIPTION" .PP This function implements a generic Newton method for the resolution of the following problem: .PP .nf F(u) = 0 .fi .PP A simple call to the algorithm writes: .PP .nf my_problem P; field uh (Xh); newton (P, uh, tol, max_iter); .fi .PP The \fCmy_problem\fP class should contain some methods for the evaluation of F, i\&.e\&. the \fCresidue\fP of the problem, and its derivative\&. The minimal requirements are: .PP .nf 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; }; .fi .PP The \fCvalue_type\fP could be a \fBfield(2)\fP\&. The Newton method could also be applied when \fCvalue_type\fP is a simple \fCFloat\fP scalar\&. Conversely, it supports multi-field extensions\&. .PP The \fCupdate_derivative\fP and \fCderivative_solver\fP members are called at each step of the Newton algorithm\&. .PP The \fCdual_space_norm\fP member function returns a scalar from the weighted residual field term \fCmrh\fP returned by the \fCresidue\fP function: this scalar is used as the stopping criterion of the algorithm\&. .SH "EXAMPLE" .PP See the \fBp_laplacian_newton\&.cc\fP example and the \fBusersguide\fP for more\&. .SH "IMPLEMENTATION" .PP This documentation has been generated from file main/lib/newton\&.h .SH AUTHOR Pierre Saramito .SH COPYRIGHT Copyright (C) 2000-2018 Pierre Saramito GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.