75 std::vector<long double> points =
76 Polynomials::jacobi_polynomial_roots<long double>(n, 0, 0);
78 for (
unsigned int i = 0; i < (points.size() + 1) / 2; ++i)
84 const long double pp =
87 const long double x = -1. + 2. * points[i];
88 const double w = 1. / ((1. - x * x) * pp * pp);
105 long double result = n - 1;
106 for (
int i = n - 2; i > 1; --i)
120 std::vector<long double>
125 const unsigned int q = x.size();
126 std::vector<long double> w(q);
128 const long double factor =
130 ((q - 1) *
gamma(q) *
gamma(alpha + beta + q + 1));
131 for (
unsigned int i = 0; i < q; ++i)
133 const long double s =
135 w[i] = factor / (s * s);
138 w[q - 1] *= (alpha + 1);
153 std::vector<long double> points =
154 Polynomials::jacobi_polynomial_roots<long double>(n - 2, 1, 1);
155 points.insert(points.begin(), 0);
156 points.push_back(1.);
157 std::vector<long double>
w =
161 for (
unsigned int i = 0; i < points.size(); ++i)
164 this->weights[i] = 0.5 *
w[i];
184 static const double xpts[] = {0.0, 1.0};
185 static const double wts[] = {0.5, 0.5};
187 for (
unsigned int i = 0; i < this->
size(); ++i)
200 static const double xpts[] = {0.0, 0.5, 1.0};
201 static const double wts[] = {1. / 6., 2. / 3., 1. / 6.};
203 for (
unsigned int i = 0; i < this->
size(); ++i)
216 static const double xpts[] = {0.0, .25, .5, .75, 1.0};
217 static const double wts[] = {
218 7. / 90., 32. / 90., 12. / 90., 32. / 90., 7. / 90.};
220 for (
unsigned int i = 0; i < this->
size(); ++i)
233 static const double xpts[] = {
234 0.0, 1. / 6., 1. / 3., .5, 2. / 3., 5. / 6., 1.0};
235 static const double wts[] = {41. / 840.,
243 for (
unsigned int i = 0; i < this->
size(); ++i)
258 for (
unsigned int i = 0; i < this->
size(); ++i)
265 this->
weights[i] = revert ? w[n - 1 - i] : w[i];
273 std::vector<double> q_points(n);
278 q_points[0] = 0.3333333333333333;
282 q_points[0] = 0.1120088061669761;
283 q_points[1] = 0.6022769081187381;
287 q_points[0] = 0.06389079308732544;
288 q_points[1] = 0.3689970637156184;
289 q_points[2] = 0.766880303938942;
293 q_points[0] = 0.04144848019938324;
294 q_points[1] = 0.2452749143206022;
295 q_points[2] = 0.5561654535602751;
296 q_points[3] = 0.848982394532986;
300 q_points[0] = 0.02913447215197205;
301 q_points[1] = 0.1739772133208974;
302 q_points[2] = 0.4117025202849029;
303 q_points[3] = 0.6773141745828183;
304 q_points[4] = 0.89477136103101;
308 q_points[0] = 0.02163400584411693;
309 q_points[1] = 0.1295833911549506;
310 q_points[2] = 0.3140204499147661;
311 q_points[3] = 0.5386572173517997;
312 q_points[4] = 0.7569153373774084;
313 q_points[5] = 0.922668851372116;
318 q_points[0] = 0.0167193554082585;
319 q_points[1] = 0.100185677915675;
320 q_points[2] = 0.2462942462079286;
321 q_points[3] = 0.4334634932570557;
322 q_points[4] = 0.6323509880476823;
323 q_points[5] = 0.81111862674023;
324 q_points[6] = 0.940848166743287;
328 q_points[0] = 0.01332024416089244;
329 q_points[1] = 0.07975042901389491;
330 q_points[2] = 0.1978710293261864;
331 q_points[3] = 0.354153994351925;
332 q_points[4] = 0.5294585752348643;
333 q_points[5] = 0.7018145299391673;
334 q_points[6] = 0.849379320441094;
335 q_points[7] = 0.953326450056343;
339 q_points[0] = 0.01086933608417545;
340 q_points[1] = 0.06498366633800794;
341 q_points[2] = 0.1622293980238825;
342 q_points[3] = 0.2937499039716641;
343 q_points[4] = 0.4466318819056009;
344 q_points[5] = 0.6054816627755208;
345 q_points[6] = 0.7541101371585467;
346 q_points[7] = 0.877265828834263;
347 q_points[8] = 0.96225055941096;
351 q_points[0] = 0.00904263096219963;
352 q_points[1] = 0.05397126622250072;
353 q_points[2] = 0.1353118246392511;
354 q_points[3] = 0.2470524162871565;
355 q_points[4] = 0.3802125396092744;
356 q_points[5] = 0.5237923179723384;
357 q_points[6] = 0.6657752055148032;
358 q_points[7] = 0.7941904160147613;
359 q_points[8] = 0.898161091216429;
360 q_points[9] = 0.9688479887196;
365 q_points[0] = 0.007643941174637681;
366 q_points[1] = 0.04554182825657903;
367 q_points[2] = 0.1145222974551244;
368 q_points[3] = 0.2103785812270227;
369 q_points[4] = 0.3266955532217897;
370 q_points[5] = 0.4554532469286375;
371 q_points[6] = 0.5876483563573721;
372 q_points[7] = 0.7139638500230458;
373 q_points[8] = 0.825453217777127;
374 q_points[9] = 0.914193921640008;
375 q_points[10] = 0.973860256264123;
379 q_points[0] = 0.006548722279080035;
380 q_points[1] = 0.03894680956045022;
381 q_points[2] = 0.0981502631060046;
382 q_points[3] = 0.1811385815906331;
383 q_points[4] = 0.2832200676673157;
384 q_points[5] = 0.398434435164983;
385 q_points[6] = 0.5199526267791299;
386 q_points[7] = 0.6405109167754819;
387 q_points[8] = 0.7528650118926111;
388 q_points[9] = 0.850240024421055;
389 q_points[10] = 0.926749682988251;
390 q_points[11] = 0.977756129778486;
406 std::vector<double> quadrature_weights(n);
411 quadrature_weights[0] = -1.0;
414 quadrature_weights[0] = -0.7185393190303845;
415 quadrature_weights[1] = -0.2814606809696154;
419 quadrature_weights[0] = -0.5134045522323634;
420 quadrature_weights[1] = -0.3919800412014877;
421 quadrature_weights[2] = -0.0946154065661483;
425 quadrature_weights[0] = -0.3834640681451353;
426 quadrature_weights[1] = -0.3868753177747627;
427 quadrature_weights[2] = -0.1904351269501432;
428 quadrature_weights[3] = -0.03922548712995894;
432 quadrature_weights[0] = -0.2978934717828955;
433 quadrature_weights[1] = -0.3497762265132236;
434 quadrature_weights[2] = -0.234488290044052;
435 quadrature_weights[3] = -0.0989304595166356;
436 quadrature_weights[4] = -0.01891155214319462;
440 quadrature_weights[0] = -0.2387636625785478;
441 quadrature_weights[1] = -0.3082865732739458;
442 quadrature_weights[2] = -0.2453174265632108;
443 quadrature_weights[3] = -0.1420087565664786;
444 quadrature_weights[4] = -0.05545462232488041;
445 quadrature_weights[5] = -0.01016895869293513;
450 quadrature_weights[0] = -0.1961693894252476;
451 quadrature_weights[1] = -0.2703026442472726;
452 quadrature_weights[2] = -0.239681873007687;
453 quadrature_weights[3] = -0.1657757748104267;
454 quadrature_weights[4] = -0.0889432271377365;
455 quadrature_weights[5] = -0.03319430435645653;
456 quadrature_weights[6] = -0.005932787015162054;
460 quadrature_weights[0] = -0.164416604728002;
461 quadrature_weights[1] = -0.2375256100233057;
462 quadrature_weights[2] = -0.2268419844319134;
463 quadrature_weights[3] = -0.1757540790060772;
464 quadrature_weights[4] = -0.1129240302467932;
465 quadrature_weights[5] = -0.05787221071771947;
466 quadrature_weights[6] = -0.02097907374214317;
467 quadrature_weights[7] = -0.003686407104036044;
471 quadrature_weights[0] = -0.1400684387481339;
472 quadrature_weights[1] = -0.2097722052010308;
473 quadrature_weights[2] = -0.211427149896601;
474 quadrature_weights[3] = -0.1771562339380667;
475 quadrature_weights[4] = -0.1277992280331758;
476 quadrature_weights[5] = -0.07847890261203835;
477 quadrature_weights[6] = -0.0390225049841783;
478 quadrature_weights[7] = -0.01386729555074604;
479 quadrature_weights[8] = -0.002408041036090773;
483 quadrature_weights[0] = -0.12095513195457;
484 quadrature_weights[1] = -0.1863635425640733;
485 quadrature_weights[2] = -0.1956608732777627;
486 quadrature_weights[3] = -0.1735771421828997;
487 quadrature_weights[4] = -0.135695672995467;
488 quadrature_weights[5] = -0.0936467585378491;
489 quadrature_weights[6] = -0.05578772735275126;
490 quadrature_weights[7] = -0.02715981089692378;
491 quadrature_weights[8] = -0.00951518260454442;
492 quadrature_weights[9] = -0.001638157633217673;
497 quadrature_weights[0] = -0.1056522560990997;
498 quadrature_weights[1] = -0.1665716806006314;
499 quadrature_weights[2] = -0.1805632182877528;
500 quadrature_weights[3] = -0.1672787367737502;
501 quadrature_weights[4] = -0.1386970574017174;
502 quadrature_weights[5] = -0.1038334333650771;
503 quadrature_weights[6] = -0.06953669788988512;
504 quadrature_weights[7] = -0.04054160079499477;
505 quadrature_weights[8] = -0.01943540249522013;
506 quadrature_weights[9] = -0.006737429326043388;
507 quadrature_weights[10] = -0.001152486965101561;
511 quadrature_weights[0] = -0.09319269144393;
512 quadrature_weights[1] = -0.1497518275763289;
513 quadrature_weights[2] = -0.166557454364573;
514 quadrature_weights[3] = -0.1596335594369941;
515 quadrature_weights[4] = -0.1384248318647479;
516 quadrature_weights[5] = -0.1100165706360573;
517 quadrature_weights[6] = -0.07996182177673273;
518 quadrature_weights[7] = -0.0524069547809709;
519 quadrature_weights[8] = -0.03007108900074863;
520 quadrature_weights[9] = -0.01424924540252916;
521 quadrature_weights[10] = -0.004899924710875609;
522 quadrature_weights[11] = -0.000834029009809656;
530 return quadrature_weights;
538 const bool factor_out_singularity)
540 ((origin[0] == 0) || (origin[0] == 1)) ? (alpha == 1 ? n : 2 * n) : 4 * n)
541 , fraction(((origin[0] == 0) || (origin[0] == 1.)) ? 1. : origin[0])
566 unsigned int ns_offset = (
fraction == 1) ? n : 2 * n;
568 for (
unsigned int i = 0, j = ns_offset; i < n; ++i, ++j)
576 if ((alpha != 1) || (
fraction != 1))
596 if (factor_out_singularity ==
true)
597 for (
unsigned int i = 0; i <
size(); ++i)
602 "The singularity cannot be on a Gauss point of the same order!"));
605 Assert(denominator != 0.0,
607 "The quadrature formula you are using does not allow to "
608 "factor out the singularity, which is zero at one point."));
609 this->
weights[i] /= denominator;
618 const double eps = 1e-8;
622 [eps](
double coord) {
623 return std::abs(coord) < eps || std::abs(coord - 1.) < eps;
625 const bool on_vertex =
639 const bool factor_out_singularity)
648 std::vector<QGaussOneOverR<2>> quads;
649 std::vector<Point<2>> origins;
652 quads.emplace_back(n, 3, factor_out_singularity);
653 quads.emplace_back(n, 2, factor_out_singularity);
654 quads.emplace_back(n, 1, factor_out_singularity);
655 quads.emplace_back(n, 0, factor_out_singularity);
657 origins.emplace_back(0., 0.);
658 origins.emplace_back(singularity[0], 0.);
659 origins.emplace_back(0., singularity[1]);
660 origins.push_back(singularity);
665 unsigned int q_id = 0;
668 for (
unsigned int box = 0; box < 4; ++box)
672 double area = dist[0] * dist[1];
674 for (
unsigned int q = 0; q < quads[box].size(); ++q, ++q_id)
676 const Point<2> &qp = quads[box].point(q);
678 origins[box] +
Point<2>(dist[0] * qp[0], dist[1] * qp[1]);
679 this->
weights[q_id] = quads[box].weight(q) * area;
687 const unsigned int vertex_index,
688 const bool factor_out_singularity)
724 std::vector<double> & ws = this->
weights;
727 for (
unsigned int q = 0; q < gauss.
size(); ++q)
731 ps[q][1] = gp[0] *
std::tan(pi4 * gp[1]);
733 if (factor_out_singularity)
737 ws[gauss.
size() + q] = ws[q];
738 ps[gauss.
size() + q][0] = ps[q][1];
739 ps[gauss.
size() + q][1] = ps[q][0];
744 switch (vertex_index)
764 if (vertex_index != 0)
765 for (
unsigned int q = 0; q <
size(); ++q)
767 double x = ps[q][0] - .5, y = ps[q][1] - .5;
769 ps[q][0] = R00 * x + R01 * y + .5;
770 ps[q][1] = R10 * x + R11 * y + .5;
779 std::vector<unsigned int> permutation(quad.
size());
780 for (
unsigned int i = 0; i < quad.
size(); ++i)
783 std::sort(permutation.begin(),
785 [
this](
const unsigned int x,
const unsigned int y) {
786 return this->compare_weights(x, y);
796 for (
unsigned int i = 0; i < quad.
size(); ++i)
800 if (permutation[i] != i)
810 return (this->weights[a] < this->weights[b]);
896 const double eta_bar = singularity[0] * 2. - 1.;
897 const double eta_star = eta_bar * eta_bar - 1.;
901 std::vector<double> weights_dummy(
weights.size());
902 unsigned int cont = 0;
903 const double tol = 1e-10;
909 weights_dummy[d - cont] =
weights[d];
921 weights.resize(weights_dummy.size() - 1);
938 gamma_bar = (eta_bar * eta_star +
std::abs(eta_star)) /
942 (eta_bar * eta_star -
std::abs(eta_star)) /
951 double eta = (
std::pow(gamma - gamma_bar, 3.0) +
952 gamma_bar * (gamma_bar * gamma_bar + 3)) /
953 (1 + 3 * gamma_bar * gamma_bar);
955 double J = 3 * ((gamma - gamma_bar) * (gamma - gamma_bar)) /
956 (1 + 3 * gamma_bar * gamma_bar);
973 std::vector<double> points(n);
975 for (
unsigned short i = 0; i < n; ++i)
982 (1. +
double(2 * i + 1) /
double(2 * (n - 1) + 2))));
995 std::vector<double> weights(n);
997 for (
unsigned short i = 0; i < n; ++i)
1013 Assert(n > 0,
ExcMessage(
"Need at least one point for the quadrature rule"));
1017 for (
unsigned int i = 0; i < this->
size(); ++i)
1040 std::vector<double> points(n);
1042 for (
unsigned short i = 0; i < n; ++i)
1048 case ::QGaussRadauChebyshev<1>::left:
1054 (1 + 2 *
double(i) / (2 *
double(n - 1) + 1.))));
1058 case ::QGaussRadauChebyshev<1>::right:
1063 (2 *
double(n - 1) + 1.))));
1071 "This constructor can only be called with either "
1072 "QGaussRadauChebyshev::left or QGaussRadauChebyshev::right as "
1073 "second argument."));
1086 std::vector<double> weights(n);
1088 for (
unsigned short i = 0; i < n; ++i)
1091 weights[i] = 2. *
numbers::PI / double(2 * (n - 1) + 1.);
1111 std::vector<double> p =
1113 std::vector<double> w =
1116 for (
unsigned int i = 0; i < this->
size(); ++i)
1143 std::vector<double> points(n);
1145 for (
unsigned short i = 0; i < n; ++i)
1160 std::vector<double> weights(n);
1162 for (
unsigned short i = 0; i < n; ++i)
1166 if (i == 0 || i == (n - 1))
1183 "Need at least two points for Gauss-Lobatto quadrature rule"));
1184 std::vector<double> p =
1186 std::vector<double> w =
1189 for (
unsigned int i = 0; i < this->
size(); ++i)
1207 std::vector<Point<dim>> qpoints;
1208 std::vector<double> weights;
1210 for (
unsigned int i = 0; i < quad.
size(); ++i)
1217 for (
int d = 0; d < dim; ++d)
1218 r += quad.
point(i)[d];
1221 this->quadrature_points.push_back(quad.
point(i));
1222 this->weights.push_back(quad.
weight(i));
1235 for (
unsigned int d = 0; d < dim; ++d)
1245 std::vector<Point<dim>> qp(this->size());
1246 std::vector<double> w(this->size());
1248 for (
unsigned int i = 0; i < this->size(); ++i)
1251 w[i] = J * this->weight(i);
1266 for (
unsigned int i = 0; i < base.
size(); ++i)
1268 const auto &q = base.
point(i);
1269 const auto w = base.
weight(i);
1271 const auto xhat = q[0];
1272 const auto yhat = q[1];
1278 const double r = xhat / (st + ct);
1280 const double J = pi * xhat / (2 * (
std::sin(pi * yhat) + 1));
1303 for (
unsigned int i = 0; i < base.
size(); ++i)
1305 const auto &q = base.
point(i);
1306 const auto w = base.
weight(i);
1308 const auto xhat = q[0];
1309 const auto yhat = q[1];
1311 const double x =
std::pow(xhat, beta) * (1 - yhat);
1312 const double y =
std::pow(xhat, beta) * yhat;
1314 const double J = beta *
std::pow(xhat, 2. * beta - 1.);
1334 "The split point should be inside the unit reference cell."));
1336 std::array<Point<dim>, dim + 1>
vertices;
1344 for (
unsigned int start = 0; start < (dim > 2 ? 2 : 1); ++start)
1346 for (
unsigned int i = 0; i < dim; ++i)
1352 this->quadrature_points.insert(this->quadrature_points.end(),
1353 quad.get_points().begin(),
1354 quad.get_points().end());
1355 this->weights.insert(this->weights.end(),
1356 quad.get_weights().begin(),
1357 quad.get_weights().end());
1369 if (dim == 0 || dim == 1)
1371 const ::QGauss<dim> quad(n_points_1D);
1374 this->
weights = quad.get_weights();
1378 if (n_points_1D == 1)
1380 const double p = 1.0 / 3.0;
1382 this->
weights.emplace_back(0.5);
1384 else if (n_points_1D == 2)
1390 const double Q12 = 1.0 / 2.0;
1392 0.1550510257216822);
1394 0.6449489742783178);
1396 0.1550510257216822);
1398 0.6449489742783178);
1400 this->
weights.emplace_back(0.31804138174397717 * Q12);
1401 this->
weights.emplace_back(0.18195861825602283 * Q12);
1402 this->
weights.emplace_back(0.31804138174397717 * Q12);
1403 this->
weights.emplace_back(0.18195861825602283 * Q12);
1405 else if (n_points_1D == 3)
1408 const double p0 = 2.0 / 7.0 -
std::sqrt(15.0) / 21.0;
1409 const double p1 = 2.0 / 7.0 +
std::sqrt(15.0) / 21.0;
1410 const double p2 = 3.0 / 7.0 - 2.0 *
std::sqrt(15.0) / 21.0;
1411 const double p3 = 3.0 / 7.0 + 2.0 *
std::sqrt(15.0) / 21.0;
1420 const double q12 = 0.5;
1421 const double w0 = 9.0 / 40.0;
1422 const double w1 = 31.0 / 240.0 -
std::sqrt(15.0) / 1200.0;
1423 const double w2 = 31.0 / 240.0 +
std::sqrt(15.0) / 1200.0;
1424 this->
weights.emplace_back(q12 * w0);
1425 this->
weights.emplace_back(q12 * w1);
1426 this->
weights.emplace_back(q12 * w1);
1427 this->
weights.emplace_back(q12 * w1);
1428 this->
weights.emplace_back(q12 * w2);
1429 this->
weights.emplace_back(q12 * w2);
1430 this->
weights.emplace_back(q12 * w2);
1432 else if (n_points_1D == 4)
1440 if (n_points_1D == 1)
1442 const double Q14 = 1.0 / 4.0;
1443 const double Q16 = 1.0 / 6.0;
1446 this->
weights.emplace_back(Q16);
1453 else if (n_points_1D == 2)
1455 const double Q16 = 1.0 / 6.0;
1456 this->
weights.emplace_back(0.1223220027573451 * Q16);
1457 this->
weights.emplace_back(0.1280664127107469 * Q16);
1458 this->
weights.emplace_back(0.1325680271444452 * Q16);
1459 this->
weights.emplace_back(0.1406244096604032 * Q16);
1460 this->
weights.emplace_back(0.2244151669175574 * Q16);
1461 this->
weights.emplace_back(0.2520039808095023 * Q16);
1465 0.01271836631368145);
1468 0.3621268299455338);
1470 0.01140332944455717,
1471 0.3586207204668839);
1474 0.6384932999617267);
1477 0.1308471689520965);
1480 0.1403728057942107);
1484 else if (n_points_1D == 3)
1489 else if (n_points_1D == 4)
1499 "QGaussSimplex is currently only implemented for "
1500 "n_points_1D = 1, 2, 3, and 4 while you are asking for "
1507 template <std::
size_t b_dim>
1508 std::vector<std::array<double, b_dim>>
1509 all_permutations(
const std::array<double, b_dim> &b_point)
1511 std::vector<std::array<double, b_dim>> output;
1516 std::array<double, b_dim> temp = b_point;
1517 std::sort(temp.begin(), temp.end());
1520 output.push_back(temp);
1522 while (std::next_permutation(temp.begin(), temp.end()));
1532 const unsigned int n_points_1D,
1533 const bool use_odd_order)
1545 std::array<double, dim + 1> centroid;
1546 std::fill(centroid.begin(), centroid.end(), 1.0 / (dim + 1.0));
1547 std::vector<std::vector<std::array<double, dim + 1>>> b_point_permutations;
1548 std::vector<double> b_weights;
1558 auto process_point_1 = [&](
const double a,
const double w) {
1559 const double b = 1.0 - dim * a;
1560 std::array<double, dim + 1> b_point;
1561 std::fill(b_point.begin(), b_point.begin() + dim, a);
1564 b_weights.push_back(w);
1565 b_point_permutations.push_back(all_permutations(b_point));
1570 auto process_point_2 = [&](
const double a,
const double w) {
1572 const double b = (1.0 - 2.0 * a) / 2.0;
1573 std::array<double, dim + 1> b_point;
1574 std::fill(b_point.begin(), b_point.begin() + dim - 1, a);
1575 b_point[dim - 1] = b;
1578 b_weights.push_back(w);
1579 b_point_permutations.push_back(all_permutations(b_point));
1585 auto process_point_3 = [&](
const double a,
const double b,
const double w) {
1586 const double c = 1.0 - (dim - 1.0) * a - b;
1587 std::array<double, dim + 1> b_point;
1588 std::fill(b_point.begin(), b_point.begin() + dim - 1, a);
1589 b_point[dim - 1] = b;
1592 b_weights.push_back(w);
1593 b_point_permutations.push_back(all_permutations(b_point));
1596 switch (n_points_1D)
1605 b_point_permutations.push_back({centroid});
1606 b_weights.push_back(1.0000000000000000e+00);
1611 process_point_1(1.6666666666666669e-01,
1612 3.3333333333333331e-01);
1619 b_point_permutations.push_back({centroid});
1620 b_weights.push_back(1.0000000000000000e+00);
1625 process_point_1(1.3819660112501050e-01,
1626 2.5000000000000000e-01);
1638 process_point_1(9.1576213509770743e-02, 1.0995174365532187e-01);
1639 process_point_1(4.4594849091596489e-01, 2.2338158967801147e-01);
1645 process_point_1(3.2816330251638171e-01,
1646 1.3621784253708741e-01);
1647 process_point_1(1.0804724989842859e-01,
1648 1.1378215746291261e-01);
1667 b_point_permutations.push_back({centroid});
1668 b_weights.push_back(2.2500000000000001e-01);
1669 process_point_1(1.0128650732345634e-01,
1670 1.2593918054482714e-01);
1671 process_point_1(4.7014206410511511e-01,
1672 1.3239415278850619e-01);
1677 process_point_1(6.3089014491502227e-02,
1678 5.0844906370206819e-02);
1679 process_point_1(2.4928674517091043e-01,
1680 1.1678627572637937e-01);
1681 process_point_3(5.3145049844816938e-02,
1682 3.1035245103378439e-01,
1683 8.2851075618373571e-02);
1690 process_point_1(3.1088591926330061e-01,
1691 1.1268792571801590e-01);
1692 process_point_1(9.2735250310891248e-02,
1693 7.3493043116361956e-02);
1694 process_point_2(4.5503704125649642e-02,
1695 4.2546020777081472e-02);
1700 process_point_1(4.0673958534611372e-02,
1701 1.0077211055320640e-02);
1702 process_point_1(3.2233789014227548e-01,
1703 5.5357181543654717e-02);
1704 process_point_1(2.1460287125915201e-01,
1705 3.9922750258167487e-02);
1706 process_point_3(6.3661001875017442e-02,
1707 6.0300566479164919e-01,
1708 4.8214285714285710e-02);
1722 process_point_1(3.3730648554587850e-02,
1723 1.6545050110792131e-02);
1724 process_point_1(4.7430969250471822e-01,
1725 7.7086646185986069e-02);
1726 process_point_1(2.4157738259540357e-01,
1727 1.2794417123015558e-01);
1728 process_point_3(4.7036644652595216e-02,
1729 1.9868331479735168e-01,
1730 5.5878732903199779e-02);
1735 b_point_permutations.push_back({centroid});
1736 b_weights.push_back(1.4431560767778717e-01);
1737 process_point_1(5.0547228317030957e-02,
1738 3.2458497623198079e-02);
1739 process_point_1(4.5929258829272313e-01,
1740 9.5091634267284619e-02);
1741 process_point_1(1.7056930775176021e-01,
1742 1.0321737053471824e-01);
1743 process_point_3(8.3947774099575878e-03,
1744 2.6311282963463811e-01,
1745 2.7230314174434993e-02);
1752 b_point_permutations.push_back({centroid});
1753 b_weights.push_back(9.5485289464130846e-02);
1754 process_point_1(3.1570114977820279e-01,
1755 4.2329581209967028e-02);
1756 process_point_2(5.0489822598396350e-02,
1757 3.1896927832857580e-02);
1758 process_point_3(1.8883383102600099e-01,
1759 5.7517163758699996e-01,
1760 3.7207130728334620e-02);
1761 process_point_3(2.1265472541483140e-02,
1762 8.1083024109854862e-01,
1763 8.1107708299033420e-03);
1768 process_point_1(1.0795272496221089e-01,
1769 2.6426650908408830e-02);
1770 process_point_1(1.8510948778258660e-01,
1771 5.2031747563738531e-02);
1772 process_point_1(4.2316543684767283e-02,
1773 7.5252561535401989e-03);
1774 process_point_1(3.1418170912403898e-01,
1775 4.1763782856934897e-02);
1776 process_point_2(4.3559132858383021e-01,
1777 3.6280930261308818e-02);
1778 process_point_3(2.1433930127130570e-02,
1779 7.1746406342630831e-01,
1780 7.1569028908444327e-03);
1781 process_point_3(2.0413933387602909e-01,
1782 5.8379737830214440e-01,
1783 1.5453486150960340e-02);
1797 b_point_permutations.push_back({centroid});
1798 b_weights.push_back(9.7135796282798836e-02);
1799 process_point_1(4.4729513394452691e-02,
1800 2.5577675658698031e-02);
1801 process_point_1(4.8968251919873762e-01,
1802 3.1334700227139071e-02);
1803 process_point_1(4.3708959149293664e-01,
1804 7.7827541004774278e-02);
1805 process_point_1(1.8820353561903275e-01,
1806 7.9647738927210249e-02);
1807 process_point_3(3.6838412054736258e-02,
1808 2.2196298916076568e-01,
1809 4.3283539377289376e-02);
1814 b_point_permutations.push_back({centroid});
1815 b_weights.push_back(8.1743329146285973e-02);
1816 process_point_1(3.2055373216943517e-02,
1817 1.3352968813149567e-02);
1818 process_point_1(1.4216110105656438e-01,
1819 4.5957963604744731e-02);
1820 process_point_3(2.8367665339938453e-02,
1821 1.6370173373718250e-01,
1822 2.5297757707288385e-02);
1823 process_point_3(2.9619889488729734e-02,
1824 3.6914678182781102e-01,
1825 3.4184648162959429e-02);
1826 process_point_3(1.4813288578382056e-01,
1827 3.2181299528883545e-01,
1828 6.3904906396424044e-02);
1835 b_point_permutations.push_back({centroid});
1836 b_weights.push_back(5.8010548912480253e-02);
1837 process_point_1(6.1981697552226933e-10,
1838 6.4319281759256394e-05);
1839 process_point_1(1.6077453539526160e-01,
1840 2.3173338462425461e-02);
1841 process_point_1(3.2227652182142102e-01,
1842 2.9562912335429289e-02);
1843 process_point_1(4.5108918345413578e-02,
1844 8.0639799796161822e-03);
1845 process_point_2(1.1229654600437609e-01,
1846 3.8134080103702457e-02);
1847 process_point_3(4.5887144875245922e-01,
1848 2.5545792330413102e-03,
1849 8.3844221982985519e-03);
1850 process_point_3(3.3775870685338598e-02,
1851 7.1835032644207453e-01,
1852 1.0234559352745330e-02);
1853 process_point_3(1.8364136980992790e-01,
1854 3.4415910578175279e-02,
1855 2.0524915967988139e-02);
1860 b_point_permutations.push_back({centroid});
1861 b_weights.push_back(4.7399773556020743e-02);
1862 process_point_1(3.1225006869518868e-01,
1863 2.6937059992268701e-02);
1864 process_point_1(1.1430965385734609e-01,
1865 9.8691597167933822e-03);
1866 process_point_3(4.1043073921896539e-01,
1867 1.6548602561961109e-01,
1868 1.1393881220195230e-02);
1869 process_point_3(6.1380088247906528e-03,
1870 9.4298876734520487e-01,
1871 3.6194434433925362e-04);
1872 process_point_3(1.2105018114558939e-01,
1873 4.7719037990428043e-01,
1874 2.5739731980456069e-02);
1875 process_point_3(3.2779468216442620e-02,
1876 5.9425626948000698e-01,
1877 1.0135871679755789e-02);
1878 process_point_3(3.2485281564823047e-02,
1879 8.0117728465834437e-01,
1880 6.5761472770359038e-03);
1881 process_point_3(1.7497934218393901e-01,
1882 6.2807184547536599e-01,
1883 1.2907035798861989e-02);
1896 b_point_permutations.push_back({centroid});
1897 b_weights.push_back(8.5761179732224219e-02);
1898 process_point_1(2.8485417614371900e-02, 1.0431870512894697e-02);
1899 process_point_1(4.9589190096589092e-01, 1.6606273054585369e-02);
1900 process_point_1(1.0263548271224643e-01, 3.8630759237019321e-02);
1901 process_point_1(4.3846592676435220e-01, 6.7316154079468296e-02);
1902 process_point_1(2.1021995670317828e-01, 7.0515684111716576e-02);
1903 process_point_3(7.3254276860644785e-03,
1904 1.4932478865208237e-01,
1905 1.0290289572953278e-02);
1906 process_point_3(4.6010500165429957e-02,
1907 2.8958112563770588e-01,
1908 4.0332476640500554e-02);
1913 process_point_1(2.4646363436335583e-02, 7.9316425099736389e-03);
1914 process_point_1(4.8820375094554153e-01, 2.4266838081452032e-02);
1915 process_point_1(1.0925782765935427e-01, 2.8486052068877544e-02);
1916 process_point_1(4.4011164865859309e-01, 4.9918334928060942e-02);
1917 process_point_1(2.7146250701492608e-01, 6.2541213195902765e-02);
1918 process_point_3(2.1382490256170616e-02,
1919 1.2727971723358933e-01,
1920 1.5083677576511438e-02);
1921 process_point_3(2.3034156355267121e-02,
1922 2.9165567973834094e-01,
1923 2.1783585038607559e-02);
1924 process_point_3(1.1629601967792658e-01,
1925 2.5545422863851736e-01,
1926 4.3227363659414209e-02);
1935 b_point_permutations.push_back({centroid});
1936 b_weights.push_back(6.7960036586831640e-02);
1937 process_point_1(2.1509681108843159e-02, 6.0523371035391717e-03);
1938 process_point_1(4.8907694645253935e-01, 2.3994401928894731e-02);
1939 process_point_1(4.2694141425980042e-01, 5.5601967530453329e-02);
1940 process_point_1(2.2137228629183292e-01, 5.8278485119199981e-02);
1941 process_point_3(5.1263891023823893e-03,
1942 2.7251581777342970e-01,
1943 9.5906810035432631e-03);
1944 process_point_3(2.4370186901093827e-02,
1945 1.1092204280346341e-01,
1946 1.4965401105165668e-02);
1947 process_point_3(8.7895483032197297e-02,
1948 1.6359740106785048e-01,
1949 2.4179039811593819e-02);
1950 process_point_3(6.8012243554206653e-02,
1951 3.0844176089211778e-01,
1952 3.4641276140848373e-02);
1957 process_point_1(1.9390961248701044e-02, 4.9234036024000819e-03);
1958 process_point_1(6.1799883090872587e-02, 1.4433699669776668e-02);
1959 process_point_1(4.8896391036217862e-01, 2.1883581369428889e-02);
1960 process_point_1(4.1764471934045394e-01, 3.2788353544125348e-02);
1961 process_point_1(1.7720553241254344e-01, 4.2162588736993016e-02);
1962 process_point_1(2.7347752830883865e-01, 5.1774104507291585e-02);
1963 process_point_3(1.2683309328720416e-03,
1964 1.1897449769695684e-01,
1965 5.0102288385006719e-03);
1966 process_point_3(1.4646950055654417e-02,
1967 2.9837288213625779e-01,
1968 1.4436308113533840e-02);
1969 process_point_3(5.7124757403647919e-02,
1970 1.7226668782135557e-01,
1971 2.4665753212563674e-02);
1972 process_point_3(9.2916249356971847e-02,
1973 3.3686145979634496e-01,
1974 3.8571510787060684e-02);
1982 for (
unsigned int permutation_n = 0; permutation_n < b_weights.size();
1985 for (
const std::array<double, dim + 1> &b_point :
1986 b_point_permutations[permutation_n])
1988 const double volume = (dim == 2 ? 1.0 / 2.0 : 1.0 / 6.0);
1989 this->
weights.emplace_back(volume * b_weights[permutation_n]);
1991 std::copy(b_point.begin(),
1992 b_point.begin() + dim,
2015 const unsigned int n_copies)
2025 const unsigned int n_copies)
2031 setup_qiterated_1D(base_quad, n_copies);
2036 const auto n_refinements =
2037 static_cast<unsigned int>(std::round(std::log2(n_copies)));
2038 Assert((1u << n_refinements) == n_copies,
2039 ExcMessage(
"The number of copies must be a power of 2."));
2041 const auto reference_cell = ReferenceCells::get_simplex<dim>();
2045 reference_cell.template get_default_linear_mapping<dim>();
2052 std::vector<Point<dim>> points;
2053 std::vector<double> weights;
2057 for (
unsigned int qp = 0; qp < base_quad.
size(); ++qp)
2060 weights.push_back(fe_values.
JxW(qp));
2085 for (
unsigned int i = 0; i < quad_line.
size(); ++i)
2086 for (
unsigned int j = 0; j < quad_tri.
size(); ++j)
2089 quad_tri.
point(j)[1],
2090 quad_line.
point(i)[0]);
2107 if (n_points_1D == 1)
2109 const double Q14 = 1.0 / 4.0;
2110 const double Q43 = 4.0 / 3.0;
2113 this->
weights.emplace_back(Q43);
2115 else if (n_points_1D == 2)
2118 this->
quadrature_points.emplace_back(-0.26318405556971, -0.26318405556971, 0.54415184401122);
2119 this->
quadrature_points.emplace_back(-0.50661630334979, -0.50661630334979, 0.12251482265544);
2120 this->
quadrature_points.emplace_back(-0.26318405556971, +0.26318405556971, 0.54415184401122);
2121 this->
quadrature_points.emplace_back(-0.50661630334979, +0.50661630334979, 0.12251482265544);
2122 this->
quadrature_points.emplace_back(+0.26318405556971, -0.26318405556971, 0.54415184401122);
2123 this->
quadrature_points.emplace_back(+0.50661630334979, -0.50661630334979, 0.12251482265544);
2124 this->
quadrature_points.emplace_back(+0.26318405556971, +0.26318405556971, 0.54415184401122);
2125 this->
quadrature_points.emplace_back(+0.50661630334979, +0.50661630334979, 0.12251482265544);
2128 this->
weights.emplace_back(0.10078588207983);
2129 this->
weights.emplace_back(0.23254745125351);
2130 this->
weights.emplace_back(0.10078588207983);
2131 this->
weights.emplace_back(0.23254745125351);
2132 this->
weights.emplace_back(0.10078588207983);
2133 this->
weights.emplace_back(0.23254745125351);
2134 this->
weights.emplace_back(0.10078588207983);
2135 this->
weights.emplace_back(0.23254745125351);
double JxW(const unsigned int quadrature_point) const
const Point< spacedim > & quadrature_point(const unsigned int q) const
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, level_dof_access > > &cell)
Abstract base class for mapping classes.
QDuffy(const Quadrature< 1 > &radial_quadrature, const Quadrature< 1 > &angular_quadrature, const double beta=1.0)
QGaussChebyshev(const unsigned int n)
Generate a formula with n quadrature points.
QGaussLobattoChebyshev(const unsigned int n)
Generate a formula with n quadrature points.
QGaussLobatto(const unsigned int n)
QGaussLogR(const unsigned int n, const Point< dim > &x0=Point< dim >(), const double alpha=1, const bool factor_out_singular_weight=false)
QGaussLog(const unsigned int n, const bool revert=false)
static std::vector< double > get_quadrature_points(const unsigned int n)
static std::vector< double > get_quadrature_weights(const unsigned int n)
QGaussOneOverR(const unsigned int n, const Point< dim > &singularity, const bool factor_out_singular_weight=false)
static unsigned int quad_size(const Point< dim > &singularity, const unsigned int n)
QGaussPyramid(const unsigned int n_points_1D)
QGaussRadauChebyshev(const unsigned int n, EndPoint ep=QGaussRadauChebyshev::left)
Generate a formula with n quadrature points.
QGaussSimplex(const unsigned int n_points_1D)
QGaussWedge(const unsigned int n_points_1D)
QGauss(const unsigned int n)
QIteratedSimplex(const Quadrature< dim > &base_quadrature, const unsigned int n_copies)
QSimplex(const Quadrature< dim > &quad)
Quadrature< dim > compute_affine_transformation(const std::array< Point< dim >, dim+1 > &vertices) const
QSorted(const Quadrature< dim > &quad)
bool compare_weights(const unsigned int a, const unsigned int b) const
QSplit(const QSimplex< dim > &base, const Point< dim > &split_point)
QTelles(const Quadrature< 1 > &base_quad, const Point< dim > &singularity)
QTrianglePolar(const Quadrature< 1 > &radial_quadrature, const Quadrature< 1 > &angular_quadrature)
QWitherdenVincentSimplex(const unsigned int n_points_1D, const bool use_odd_order=true)
std::vector< Point< dim > > quadrature_points
Quadrature & operator=(const Quadrature< dim > &)
const Point< dim > & point(const unsigned int i) const
bool is_tensor_product_flag
double weight(const unsigned int i) const
std::vector< double > weights
unsigned int size() const
void refine_global(const unsigned int times=1)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
@ update_JxW_values
Transformed quadrature weights.
@ update_quadrature_points
Transformed quadrature points.
IteratorRange< active_cell_iterator > active_cell_iterators() const
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
void reference_cell(Triangulation< dim, spacedim > &tria, const ReferenceCell &reference_cell)
void quadrature_points(const Triangulation< dim, spacedim > &triangulation, const Quadrature< dim > &quadrature, const std::vector< std::vector< BoundingBox< spacedim > > > &global_bounding_boxes, ParticleHandler< dim, spacedim > &particle_handler, const Mapping< dim, spacedim > &mapping=(ReferenceCells::get_hypercube< dim >() .template get_default_linear_mapping< dim, spacedim >()), const std::vector< std::vector< double > > &properties={})
Tensor< 2, dim, Number > w(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
Number jacobi_polynomial_value(const unsigned int degree, const int alpha, const int beta, const Number x)
std::string to_string(const number value, const unsigned int digits=numbers::invalid_unsigned_int)
std::vector< double > get_quadrature_weights(const unsigned int n)
std::vector< double > get_quadrature_points(const unsigned int n)
std::vector< double > get_quadrature_points(const unsigned int n)
std::vector< double > get_quadrature_weights(const unsigned int n)
std::vector< long double > compute_quadrature_weights(const std::vector< long double > &x, const int alpha, const int beta)
long double gamma(const unsigned int n)
std::vector< double > get_quadrature_points(const unsigned int n, ::QGaussRadauChebyshev< 1 >::EndPoint ep)
std::vector< double > get_quadrature_weights(const unsigned int n, ::QGaussRadauChebyshev< 1 >::EndPoint ep)
static constexpr double PI_2
static constexpr double PI
::VectorizedArray< Number, width > log(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > tan(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > cos(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > sin(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > sqrt(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > pow(const ::VectorizedArray< Number, width > &, const Number p)
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)
static Point< dim > unit_cell_vertex(const unsigned int vertex)
constexpr Number determinant(const SymmetricTensor< 2, dim, Number > &)
const ::Triangulation< dim, spacedim > & tria