39 throw std::invalid_argument(
40 "AdaptiveTriangleQuadrature::compute_points_weights(): invalid or missing eval."
43 base::points_.resize(
dim, 0);
44 base::weights_.resize(1, 0);
46 reset_recursion_count();
54 iq.set_starting_order(1);
55 iq.compute_points_weights(
tri, eval);
58 base::points_ =
iq.points();
59 base::weights_ =
iq.weights();
60 base::points_weights_computed_ =
true;
61 vals_ = eval(base::points_);
70 vals_main_ = eval(p_main_);
74 if (
level == max_levels_)
76 base::points_weights_computed_ =
true;
81 converged_iter_ =
level;
82 base::points_weights_computed_ =
true;
117 p_sub_.col(0) =
p_sub1.col(0);
118 p_sub_.col(1) =
p_sub1.col(1);
119 p_sub_.col(2) =
p_sub1.col(4);
120 p_sub_.col(3) =
p_sub2.col(0);
121 p_sub_.col(4) =
p_sub2.col(1);
122 p_sub_.col(5) =
p_sub2.col(4);
126 vals_sub_ = eval(p_sub_);
133 Complex I5 = (vals_main_.sum() + vals_main_[4]) * area / (
Float)6.0;
136 Complex I10 = vals_sub_.sum() + vals_sub_[2] + vals_sub_[5];
153 I10 += vals_main_[idx_extra1_[0]] + vals_main_[idx_extra1_[1]];
170 I10 += vals_main_[idx_extra2_[0]] + vals_main_[idx_extra2_[1]];
176 bool converged = check_convergence(
I5,
I10);
193 if (converged ||
level == max_levels_)
199 base::points_.conservativeResize(
dim, base::points_.
cols() +
num_add);
200 base::weights_.conservativeResize(1, base::weights_.size() +
num_add);
201 vals_.conservativeResize(1, vals_.size() +
num_add);
205 base::points_.col(
idx_add + 2 *
ii) = p_main_.col(idx_extra1_[
ii]);
206 base::points_.col(
idx_add + 2 *
ii + 1) = p_main_.col(idx_extra2_[
ii]);
208 vals_[
idx_add + 2 *
ii] = vals_main_[idx_extra1_[
ii]];
209 vals_[
idx_add + 2 *
ii + 1] = vals_main_[idx_extra2_[
ii]];
214 base::points_.rightCols(p_sub_.cols()) = p_sub_;
215 base::weights_.rightCols(10) = weights10_ * area / (
Float)12.0;
216 vals_.rightCols(vals_sub_.size()) = vals_sub_;
231 vals_main_[idx_extra1_[0]],
232 vals_main_[idx_extra1_[1]],
244 vals_main_[idx_extra2_[0]],
245 vals_main_[idx_extra2_[1]],
257 vals_main_ = vals_subtri1_;
265 base::points_.conservativeResize(
dim, base::points_.
cols() +
num_add);
268 base::weights_.conservativeResize(1, base::weights_.size() +
num_add);
271 vals_.conservativeResize(1, vals_.size() +
num_add);
272 vals_.rightCols(
num_add) = vals_subtri1_;
282 vals_main_ = vals_subtri2_;
290 base::points_.conservativeResize(
dim, base::points_.
cols() +
num_add);
293 base::weights_.conservativeResize(1, base::weights_.size() +
num_add);
296 vals_.conservativeResize(1, vals_.size() +
num_add);
297 vals_.rightCols(
num_add) = vals_subtri2_;
306template <u
int8_t dim>
307void AdaptiveTriangleQuadrature<dim>::get_5_points(
320 p.col(0) = (
v1 +
vm) / two;
321 p.col(1) = (
v2 +
vm) / two;
322 p.col(2) = (
v0 +
v2) / two;
323 p.col(3) = (
v0 +
v1) / two;
324 p.col(4) = (
v0 +
vm) / two;
331template <u
int8_t dim>
332void AdaptiveTriangleQuadrature<dim>::get_subtris(
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.
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.