18#ifndef ADAPTIVE_TRI_QUAD_H
19#define ADAPTIVE_TRI_QUAD_H
34const uint16_t ADAPTIVE_TRI_DEFAULT_MAX_LEVELS = 200;
35const Float ADAPTIVE_TRI_DEFAULT_TOL = 1
e-3;
63 base::points_weights_computed_ =
false;
83 base::points_weights_computed_ =
false;
113 if (!base::points_weights_computed_)
114 throw std::runtime_error(
115 "AdaptiveTriangleQuadrature::converged(): must call `compute_points_weights()` first.");
151 static void get_5_points(
184 "AdaptiveTriangleQuadrature::check_convergence(): divide by zero.");
218 {
return total_recursions_; };
224 void reset_recursion_count()
226 total_recursions_ = 0;
231 uint16_t max_levels_ = ADAPTIVE_TRI_DEFAULT_MAX_LEVELS;
232 Float tol_ = ADAPTIVE_TRI_DEFAULT_TOL;
233 bool converged_ =
false;
236 const EigColVecN<Float, 10> weights10_ = {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 1.0, 1.0, 2.0};
Class for adaptive quadrature over a triangle. Reference: O. Ergul, L. Gurel, "The Multilevel Fast Mu...
void compute_points_weights(const Triangle< dim > &tri, std::function< EigRowVec< Complex >(ConstEigRef< EigMatNX< Float, dim > >)> eval={}) override
Computes and stores the points on which to evaluate the integrand, and the corresponding weights.
bool converged() const
Checks whether the recursion converged.
uint16_t max_levels() const
Returns the maximum number of recursion levels allowed even if not converged.
void set_tol(const Float tol)
Sets the relative convergence tolerance defining when recursion should stop.
uint16_t converged_iter() const
Returns the recursion level at which the recursion converged.
Float tol() const
Returns the relative convergence tolerance defining when recursion should stop.
void set_max_levels(const uint16_t max_levels)
Sets the maximum number of recursion levels allowed even if not converged.
Base class for quadrature over a triangle.
bool compare_with_tol(const Complex val, const Complex val_ref, const Float tol, const uint8_t mode)
Compares two complex numbers within a given tolerance based on a given rule.
const Eigen::Ref< const EigObj > ConstEigRef
Read-only reference to an Eigen object.
double Float
Floating point number.
std::complex< Float > Complex
Complex floating point number.
Eigen::Matrix< T, N, 1 > EigColVecN
Fixed-size column vector of size N containing type T.
Primary namespace for the OpenBEM library.