Class NewtonRootFinder

Inheritance Relationships

Base Type

Class Documentation

class NewtonRootFinder : public RootFinder

Root finder based on Newton’s method.

Controlled by the maximum number of iterations. The convergence tolerance is fixed internally as a binary digit target for the root estimate.

Usage

    RootFinder
    {
        type       Newton;
        maxIter    value; (default 30)
    }

Contributors/Copyright: 2016-2026 Timofey Mukha 2017 Saleh Rezaeiravesh

Source files

Public Functions

inline NewtonRootFinder(const word &rootFinderName, std::function<scalar(scalar)> f, std::function<scalar(scalar)> d, const label maxIter)

Construct given name, function, its derivative and maximum number.

of iterations

inline NewtonRootFinder(std::function<scalar(scalar)> f, std::function<scalar(scalar)> d, const dictionary &dict)

Construct given a function, its derivative, and dictionary.

inline NewtonRootFinder(const dictionary &dict)

Construct given dictionary.

NewtonRootFinder(const NewtonRootFinder&) = default

Copy constructor.

inline virtual autoPtr<RootFinder> clone() const

Clone the object.

inline virtual ~NewtonRootFinder()

Destructor.

virtual std::pair<scalar, label> root(scalar guess, scalar lowerBound, scalar upperBound) const

Compute and return root.

inline virtual void write(Ostream &os) const

Write.