deal.II version GIT relicensing-2291-g668cd86249 2024-12-24 11:30:00+00:00
|
Classes | |
struct | AdditionalData |
Public Member Functions | |
RootFinder (const AdditionalData &data=AdditionalData()) | |
void | find_roots (const std::vector< std::reference_wrapper< const Function< 1 > > > &functions, const BoundingBox< 1 > &interval, std::vector< double > &roots) |
Private Member Functions | |
void | find_roots (const Function< 1 > &function, const BoundingBox< 1 > &interval, const unsigned int recursion_depth, std::vector< double > &roots) |
Private Attributes | |
const AdditionalData | additional_data |
A class that attempts to find multiple distinct roots of a function, \(f(x)\), over an interval, \([l, r]\). This is done as follows. If there is a sign change in function value between the interval end points, we solve for the root. If there is no sign change, we attempt to bound the function value away from zero on \([a, b]\), to conclude that no roots exist. If we can't exclude that there are roots, we split the interval in two: \([l, (r + l) / 2]\), \([(r + l) / 2, r]\), and use the same algorithm recursively on each interval. This means that we can typically find 2 distinct roots, but not 3.
The bounds on the functions values are estimated using the function taylor_estimate_function_bounds, which approximates the function as a second order Taylor-polynomial around the interval midpoint. When we have a sign change on an interval, this class uses boost::math::tools::toms748_solve for finding roots .
Definition at line 661 of file quadrature_generator.h.
NonMatching::internal::QuadratureGeneratorImplementation::RootFinder::RootFinder | ( | const AdditionalData & | data = AdditionalData() | ) |
Constructor.
Definition at line 526 of file quadrature_generator.cc.
void NonMatching::internal::QuadratureGeneratorImplementation::RootFinder::find_roots | ( | const std::vector< std::reference_wrapper< const Function< 1 > > > & | functions, |
const BoundingBox< 1 > & | interval, | ||
std::vector< double > & | roots | ||
) |
For each of the incoming functions
, attempt to find the roots over the interval defined by interval
and add these to roots
. The returned roots will be sorted in ascending order: \(x_0 < x_1 <...\) and duplicate roots (with respect to the tolerance in AdditionalData) will be removed.
Definition at line 533 of file quadrature_generator.cc.
|
private |
Attempt to find the roots of the function
over the interval defined by interval
and add these to roots
. recursion_depth
holds the number of times this function has been called recursively.
Definition at line 556 of file quadrature_generator.cc.
|
private |
Definition at line 726 of file quadrature_generator.h.