GCC Code Coverage Report


Directory: Bembel/src/
File: Bembel/src/Quadrature/GaussLegendreRule.hpp
Date: 2024-09-30 07:01:38
Exec Total Coverage
Lines: 92 129 71.3%
Functions: 51 51 100.0%
Branches: 54 104 51.9%

Line Branch Exec Source
1 // This file is part of Bembel, the higher order C++ boundary element library.
2 //
3 // Copyright (C) 2022 see <http://www.bembel.eu>
4 //
5 // It was written as part of a cooperation of J. Doelz, H. Harbrecht, S. Kurz,
6 // M. Multerer, S. Schoeps, and F. Wolf at Technische Universitaet Darmstadt,
7 // Universitaet Basel, and Universita della Svizzera italiana, Lugano. This
8 // source code is subject to the GNU General Public License version 3 and
9 // provided WITHOUT ANY WARRANTY, see <http://www.bembel.eu> for further
10 // information.
11
12 #ifndef BEMBEL_SRC_QUADRATURE_GAUSSLEGENDRERULE_HPP_
13 #define BEMBEL_SRC_QUADRATURE_GAUSSLEGENDRERULE_HPP_
14
15 namespace Bembel {
16 /**
17 * \ingroup Quadrature
18 * \brief Gauss Legendre quadrature rules. The first 20 are hard coded.
19 * Afterwards, the programmer in charge lost his interest and
20 * provided a method to compute arbitrary order Legendre rules
21 * by solving the corresponding eigenvalue problem.
22 *
23 * In addition, to make use of the bracket initializer, std::vector
24 * had to be used in the template specializations. However, this
25 * is taken care of by the quadrature struct.
26 **/
27 template <unsigned int Order>
28 struct GaussLegendreRule {
29 3800 GaussLegendreRule() {
30
1/2
✓ Branch 1 taken 1901 times.
✗ Branch 2 not taken.
3800 Eigen::MatrixXd A(Order, Order);
31
1/2
✓ Branch 1 taken 1901 times.
✗ Branch 2 not taken.
3800 A.setZero();
32
3/4
✓ Branch 1 taken 66385 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 66385 times.
✓ Branch 4 taken 1901 times.
136530 for (auto i = 1; i < Order; ++i) A(i, i - 1) = i / (sqrt(4. * i * i - 1));
33
1/2
✓ Branch 1 taken 1901 times.
✗ Branch 2 not taken.
3800 Eigen::SelfAdjointEigenSolver<Eigen::MatrixXd> es;
34
1/2
✓ Branch 1 taken 1901 times.
✗ Branch 2 not taken.
3800 es.compute(A);
35
1/2
✓ Branch 1 taken 1901 times.
✗ Branch 2 not taken.
3800 xi_.resize(Order);
36
1/2
✓ Branch 1 taken 1901 times.
✗ Branch 2 not taken.
3800 w_.resize(Order);
37
2/2
✓ Branch 0 taken 68286 times.
✓ Branch 1 taken 1901 times.
140330 for (auto i = 0; i < Order; ++i) {
38
1/2
✓ Branch 2 taken 68286 times.
✗ Branch 3 not taken.
136530 xi_[i] = 0.5 * (es.eigenvalues()(i) + 1);
39
2/4
✓ Branch 2 taken 68286 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 68286 times.
✗ Branch 7 not taken.
136530 w_[i] = es.eigenvectors()(0, i) * es.eigenvectors()(0, i);
40 }
41 3800 }
42 std::vector<double> xi_;
43 std::vector<double> w_;
44 };
45 /**
46 * \brief Gauss Legendre Rule - Unused base case
47 */
48 template <>
49 struct GaussLegendreRule<0> {
50 GaussLegendreRule() {
51 assert(false && "Order of GaussLegendre Quadrature has to be at least 1");
52 }
53 };
54 /**
55 * \brief Gauss Legendre Rule using 1 point.
56 */
57 template <>
58 struct GaussLegendreRule<1> {
59 76 GaussLegendreRule() {
60
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 xi_ = {0.5};
61
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 w_ = {1.0};
62 76 }
63 std::vector<double> xi_;
64 std::vector<double> w_;
65 };
66 /**
67 * \brief Gauss Legendre Rule using 2 point.
68 */
69 template <>
70 struct GaussLegendreRule<2> {
71 76 GaussLegendreRule() {
72 xi_ = {0.2113248654051871177454256097490212721762,
73
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.7886751345948128822545743902509787278238};
74
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 w_ = {0.5, 0.5};
75 76 }
76 std::vector<double> xi_;
77 std::vector<double> w_;
78 };
79 /**
80 * \brief Gauss Legendre Rule using 3 point.
81 */
82 template <>
83 struct GaussLegendreRule<3> {
84 76 GaussLegendreRule() {
85 xi_ = {0.1127016653792583114820734600217600389167, 0.5,
86
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.8872983346207416885179265399782399610833};
87
88 w_ = {.2777777777777777777777777777777777777778,
89 .4444444444444444444444444444444444444444,
90
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 .2777777777777777777777777777777777777778};
91 76 }
92 std::vector<double> xi_;
93 std::vector<double> w_;
94 };
95 /**
96 * \brief Gauss Legendre Rule using 4 point.
97 */
98 template <>
99 struct GaussLegendreRule<4> {
100 76 GaussLegendreRule() {
101 xi_ = {0.06943184420297371238802675555359524745214,
102 0.3300094782075718675986671204483776563997,
103 0.6699905217924281324013328795516223436003,
104
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.9305681557970262876119732444464047525479};
105
106 w_ = {.1739274225687269286865319746109997036177,
107 .3260725774312730713134680253890002963823,
108 .3260725774312730713134680253890002963823,
109
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 .1739274225687269286865319746109997036177};
110 76 }
111 std::vector<double> xi_;
112 std::vector<double> w_;
113 };
114 /**
115 * \brief Gauss Legendre Rule using 5 point.
116 */
117 template <>
118 struct GaussLegendreRule<5> {
119 76 GaussLegendreRule() {
120 xi_ = {0.04691007703066800360118656085030351743717,
121 0.2307653449471584544818427896498955975164, 0.5,
122 0.7692346550528415455181572103501044024836,
123
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.9530899229693319963988134391496964825628};
124
125 w_ = {.1184634425280945437571320203599586813216,
126 .2393143352496832340206457574178190964561,
127 .2844444444444444444444444444444444444444,
128 .2393143352496832340206457574178190964561,
129
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 .1184634425280945437571320203599586813216};
130 76 }
131 std::vector<double> xi_;
132 std::vector<double> w_;
133 };
134 /**
135 * \brief Gauss Legendre Rule using 6 point.
136 */
137 template <>
138 struct GaussLegendreRule<6> {
139 76 GaussLegendreRule() {
140 xi_ = {0.03376524289842398609384922275300269543262,
141 0.1693953067668677431693002024900473264968,
142 0.3806904069584015456847491391596440322907,
143 0.6193095930415984543152508608403559677093,
144 0.8306046932331322568306997975099526735032,
145
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.9662347571015760139061507772469973045674};
146
147 w_ = {.08566224618958517252014807108636644676341,
148 .1803807865240693037849167569188580558308,
149 .2339569672863455236949351719947754974058,
150 .2339569672863455236949351719947754974058,
151 .1803807865240693037849167569188580558308,
152
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 .08566224618958517252014807108636644676341};
153 76 }
154 std::vector<double> xi_;
155 std::vector<double> w_;
156 };
157 /**
158 * \brief Gauss Legendre Rule using 7 point.
159 */
160 template <>
161 struct GaussLegendreRule<7> {
162 76 GaussLegendreRule() {
163 xi_ = {0.02544604382862073773690515797607436879961,
164 0.1292344072003027800680676133596057964629,
165 0.2970774243113014165466967939615192683263,
166 0.5,
167 0.7029225756886985834533032060384807316737,
168 0.8707655927996972199319323866403942035371,
169
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.9745539561713792622630948420239256312004};
170
171 w_ = {0.06474248308443484663530571633954100916429,
172 0.1398526957446383339507338857118897912435,
173 0.1909150252525594724751848877444875669392,
174 0.2089795918367346938775510204081632653061,
175 0.1909150252525594724751848877444875669392,
176 0.1398526957446383339507338857118897912435,
177
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.06474248308443484663530571633954100916429};
178 76 }
179 std::vector<double> xi_;
180 std::vector<double> w_;
181 };
182 /**
183 * \brief Gauss Legendre Rule using 8 point.
184 */
185 template <>
186 struct GaussLegendreRule<8> {
187 76 GaussLegendreRule() {
188 xi_ = {0.01985507175123188415821956571526350478588,
189 0.1016667612931866302042230317620847815814,
190 0.237233795041835507091130475405376825479,
191 0.4082826787521750975302619288199080096666,
192 0.5917173212478249024697380711800919903334,
193 0.762766204958164492908869524594623174521,
194 0.8983332387068133697957769682379152184186,
195
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.9801449282487681158417804342847364952141};
196
197 w_ = {0.0506142681451881295762656771549810950577,
198 0.1111905172266872352721779972131204422151,
199 0.1568533229389436436689811009933006566302,
200 0.1813418916891809914825752246385978060971,
201 0.1813418916891809914825752246385978060971,
202 0.1568533229389436436689811009933006566302,
203 0.1111905172266872352721779972131204422151,
204
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.0506142681451881295762656771549810950577};
205 76 }
206 std::vector<double> xi_;
207 std::vector<double> w_;
208 };
209 /**
210 * \brief Gauss Legendre Rule using 9 point.
211 */
212 template <>
213 struct GaussLegendreRule<9> {
214 76 GaussLegendreRule() {
215 xi_ = {0.0159198802461869550822118985481635649753,
216 0.08198444633668210285028510596513256172795,
217 0.1933142836497048013456489803292629076071,
218 0.337873288298095535480730992678331695714,
219 0.5,
220 0.662126711701904464519269007321668304286,
221 0.8066857163502951986543510196707370923929,
222 0.9180155536633178971497148940348674382721,
223
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.9840801197538130449177881014518364350247};
224
225 w_ = {.04063719418078720598594607905526182533783,
226 .09032408034742870202923601562145640475717,
227 .1303053482014677311593714347093164248859,
228 .1561735385200014200343152032922218327994,
229 .1651196775006298815822625346434870244394,
230 .1561735385200014200343152032922218327994,
231 .1303053482014677311593714347093164248859,
232 .09032408034742870202923601562145640475717,
233
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 .04063719418078720598594607905526182533783};
234 76 }
235 std::vector<double> xi_;
236 std::vector<double> w_;
237 };
238 /**
239 * \brief Gauss Legendre Rule using 10 point.
240 */
241 template <>
242 struct GaussLegendreRule<10> {
243 76 GaussLegendreRule() {
244 xi_ = {0.01304673574141413996101799395777397328587,
245 0.06746831665550774463395165578825347573623,
246 0.1602952158504877968828363174425632121154,
247 0.2833023029353764046003670284171079189,
248 0.4255628305091843945575869994351400076912,
249 0.5744371694908156054424130005648599923088,
250 0.7166976970646235953996329715828920811,
251 0.8397047841495122031171636825574367878846,
252 0.9325316833444922553660483442117465242638,
253
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.9869532642585858600389820060422260267141};
254
255 w_ = {0.03333567215434406879678440494666589642893,
256 0.07472567457529029657288816982884866620128,
257 0.1095431812579910219977674671140815962294,
258 0.1346333596549981775456134607847346764299,
259 0.1477621123573764350869464973256691647105,
260 0.1477621123573764350869464973256691647105,
261 0.1346333596549981775456134607847346764299,
262 0.1095431812579910219977674671140815962294,
263 0.07472567457529029657288816982884866620128,
264
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.03333567215434406879678440494666589642893};
265 76 }
266 std::vector<double> xi_;
267 std::vector<double> w_;
268 };
269 /**
270 * \brief Gauss Legendre Rule using 11 point.
271 */
272 template <>
273 struct GaussLegendreRule<11> {
274 76 GaussLegendreRule() {
275 xi_ = {0.01088567092697150359803099943857130461429,
276 0.05646870011595235046242111534803636668416,
277 0.1349239972129753379532918739844232709752,
278 0.2404519353965940920371371652706952227599,
279 0.3652284220238275138342340072995692376602,
280 0.5,
281 0.6347715779761724861657659927004307623398,
282 0.7595480646034059079628628347293047772401,
283 0.8650760027870246620467081260155767290248,
284 0.9435312998840476495375788846519636333158,
285
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.9891143290730284964019690005614286953857};
286
287 w_ = {0.02783428355808683324137686022127428936426,
288 0.06279018473245231231734714961197005009881,
289 0.09314510546386712571304882071582794584564,
290 0.1165968822959952399592618524215875697159,
291 0.1314022722551233310903444349452545976864,
292 0.136462543388950315357241764168171094578,
293 0.1314022722551233310903444349452545976864,
294 0.1165968822959952399592618524215875697159,
295 0.09314510546386712571304882071582794584564,
296 0.06279018473245231231734714961197005009881,
297
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.02783428355808683324137686022127428936426};
298 76 }
299 std::vector<double> xi_;
300 std::vector<double> w_;
301 };
302 /**
303 * \brief Gauss Legendre Rule using 12 point.
304 */
305 template <>
306 struct GaussLegendreRule<12> {
307 76 GaussLegendreRule() {
308 xi_ = {0.009219682876640374654725454925359588519922,
309 0.0479413718147625716607670669404519037312,
310 0.1150486629028476564815530833935909620075,
311 0.2063410228566912763516487905297328598155,
312 0.3160842505009099031236542316781412193718,
313 0.4373832957442655422637793152680734350083,
314 0.5626167042557344577362206847319265649917,
315 0.6839157494990900968763457683218587806282,
316 0.7936589771433087236483512094702671401845,
317 0.8849513370971523435184469166064090379925,
318 0.9520586281852374283392329330595480962688,
319
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.9907803171233596253452745450746404114801};
320
321 w_ = {0.02358766819325591359730798074250853015851,
322 0.05346966299765921548012735909699811210729,
323 0.08003916427167311316732626477167953593601,
324 0.1015837133615329608745322279048991882533,
325 0.1167462682691774043804249494624390281297,
326 0.1245735229067013925002812180214756054152,
327 0.1245735229067013925002812180214756054152,
328 0.1167462682691774043804249494624390281297,
329 0.1015837133615329608745322279048991882533,
330 0.08003916427167311316732626477167953593601,
331 0.05346966299765921548012735909699811210729,
332
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.02358766819325591359730798074250853015851};
333 76 }
334 std::vector<double> xi_;
335 std::vector<double> w_;
336 };
337 /**
338 * \brief Gauss Legendre Rule using 13 point.
339 */
340 template <>
341 struct GaussLegendreRule<13> {
342 76 GaussLegendreRule() {
343 xi_ = {0.007908472640705925263585275596445194467505,
344 0.04120080038851101739672608174964024380476,
345 0.09921095463334504360289675520857005484719,
346 0.1788253302798298896780076965022421749642,
347 0.275753624481776573561043573936180066099,
348 0.3847708420224326029672359394510055823942,
349 0.5,
350 0.6152291579775673970327640605489944176058,
351 0.724246375518223426438956426063819933901,
352 0.8211746697201701103219923034977578250358,
353 0.9007890453666549563971032447914299451528,
354 0.9587991996114889826032739182503597561952,
355
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.9920915273592940747364147244035548055325};
356
357 w_ = {0.02024200238265793976001079610049303002099,
358 0.04606074991886422395721088797689856046184,
359 0.06943675510989361923180088843443573381093,
360 0.08907299038097286914002334599804899775641,
361 0.1039080237684442511562616096530263816933,
362 0.1131415901314486192060450930198883092174,
363 0.1162757766154369550972947576344179740783,
364 0.1131415901314486192060450930198883092174,
365 0.1039080237684442511562616096530263816933,
366 0.08907299038097286914002334599804899775641,
367 0.06943675510989361923180088843443573381093,
368 0.04606074991886422395721088797689856046184,
369
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.02024200238265793976001079610049303002099};
370 76 }
371 std::vector<double> xi_;
372 std::vector<double> w_;
373 };
374 /**
375 * \brief Gauss Legendre Rule using 14 point.
376 */
377 template <>
378 struct GaussLegendreRule<14> {
379 76 GaussLegendreRule() {
380 xi_ = {0.006858095651593830579201366647973599161954,
381 0.03578255816821324133180443031106286776148,
382 0.08639934246511750340510262867480251948015,
383 0.1563535475941572649259900984903329312308,
384 0.2423756818209229540173546407244056688456,
385 0.3404438155360551197821640879157622665829,
386 0.445972525646328168966877674890082626194,
387 0.554027474353671831033122325109917373806,
388 0.6595561844639448802178359120842377334171,
389 0.7576243181790770459826453592755943311544,
390 0.8436464524058427350740099015096670687692,
391 0.9136006575348824965948973713251974805199,
392 0.9642174418317867586681955696889371322385,
393
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.993141904348406169420798633352026400838};
394
395 w_ = {0.01755973016587593151591643806909589030985,
396 0.04007904357988010490281663853142715479185,
397 0.06075928534395159234470740453623831297833,
398 0.07860158357909676728480096931192107830283,
399 0.09276919873896890687085829506257851812446,
400 0.1025992318606478019829620328306090278552,
401 0.1076319267315788950979382216581300176375,
402 0.1076319267315788950979382216581300176375,
403 0.1025992318606478019829620328306090278552,
404 0.09276919873896890687085829506257851812446,
405 0.07860158357909676728480096931192107830283,
406 0.06075928534395159234470740453623831297833,
407 0.04007904357988010490281663853142715479185,
408
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.01755973016587593151591643806909589030985};
409 76 }
410 std::vector<double> xi_;
411 std::vector<double> w_;
412 };
413 /**
414 * \brief Gauss Legendre Rule using 15 point.
415 */
416 template <>
417 struct GaussLegendreRule<15> {
418 76 GaussLegendreRule() {
419 xi_ = {0.006003740989757285755217140706693709426514,
420 0.031363303799647047846120526144895264378,
421 0.07589670829478639189967583961289157431687,
422 0.1377911343199149762919069726930309951846,
423 0.2145139136957305762313866313730446793808,
424 0.3029243264612183150513963145094772658186,
425 0.3994029530012827388496858483027018960936,
426 0.5,
427 0.6005970469987172611503141516972981039064,
428 0.6970756735387816849486036854905227341814,
429 0.7854860863042694237686133686269553206192,
430 0.8622088656800850237080930273069690048154,
431 0.9241032917052136081003241603871084256831,
432 0.968636696200352952153879473855104735622,
433
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.9939962590102427142447828592933062905735};
434
435 w_ = {0.01537662099805863417731419678860220886087,
436 0.03518302374405406235463370822533366923335,
437 0.05357961023358596750593477334293465170777,
438 0.06978533896307715722390239725551416126043,
439 0.08313460290849696677660043024060440556545,
440 0.09308050000778110551340028093321141225311,
441 0.09921574266355578822805916322191966240935,
442 0.1012891209627806364403100999837596574193,
443 0.09921574266355578822805916322191966240935,
444 0.09308050000778110551340028093321141225311,
445 0.08313460290849696677660043024060440556545,
446 0.06978533896307715722390239725551416126043,
447 0.05357961023358596750593477334293465170777,
448 0.03518302374405406235463370822533366923335,
449
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.01537662099805863417731419678860220886087};
450 76 }
451 std::vector<double> xi_;
452 std::vector<double> w_;
453 };
454 /**
455 * \brief Gauss Legendre Rule using 16 point.
456 */
457 template <>
458 struct GaussLegendreRule<16> {
459 76 GaussLegendreRule() {
460 xi_ = {0.005299532504175033701922913274833686286863,
461 0.02771248846338371196100579223269582745443,
462 0.06718439880608412805976605114380343380633,
463 0.1222977958224984830524494025762788658231,
464 0.1910618777986781257766641179756044905041,
465 0.27099161117138630682879027850821121323,
466 0.359198224610370543384769749269751946757,
467 0.4524937450811812799073403322875209684348,
468 0.5475062549188187200926596677124790315652,
469 0.640801775389629456615230250730248053243,
470 0.72900838882861369317120972149178878677,
471 0.8089381222013218742233358820243955094959,
472 0.8777022041775015169475505974237211341769,
473 0.9328156011939158719402339488561965661937,
474 0.9722875115366162880389942077673041725456,
475
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.9947004674958249662980770867251663137131};
476
477 w_ = {0.01357622970587704742589028622800905175613,
478 0.03112676196932394643142191849718884713749,
479 0.04757925584124639240496255380112311317763,
480 0.06231448562776693602623814109600821007244,
481 0.07479799440828836604075086527373927448525,
482 0.08457825969750126909465603951517998110582,
483 0.09130170752246179443338183398460996969178,
484 0.09472530522753424814269836160414155257345,
485 0.09472530522753424814269836160414155257345,
486 0.09130170752246179443338183398460996969178,
487 0.08457825969750126909465603951517998110582,
488 0.07479799440828836604075086527373927448525,
489 0.06231448562776693602623814109600821007244,
490 0.04757925584124639240496255380112311317763,
491 0.03112676196932394643142191849718884713749,
492
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.01357622970587704742589028622800905175613};
493 76 }
494 std::vector<double> xi_;
495 std::vector<double> w_;
496 };
497 /**
498 * \brief Gauss Legendre Rule using 17 point.
499 */
500 template <>
501 struct GaussLegendreRule<17> {
502 76 GaussLegendreRule() {
503 xi_ = {0.004712262342791332162282990029667361746105,
504 0.02466223911561611938864152105209848927831,
505 0.05988042313650704893852215275592215368829,
506 0.109242998051599296537384972239761974888,
507 0.1711644203916546170748488916784988324261,
508 0.2436547314567615160568767156852240627085,
509 0.3243841182730618423514072414523269974797,
510 0.4107579092520760720746612531729672212623,
511 0.5,
512 0.5892420907479239279253387468270327787377,
513 0.6756158817269381576485927585476730025203,
514 0.7563452685432384839431232843147759372915,
515 0.8288355796083453829251511083215011675739,
516 0.890757001948400703462615027760238025112,
517 0.9401195768634929510614778472440778463117,
518 0.9753377608843838806113584789479015107217,
519
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.9952877376572086678377170099703326382539};
520
521 w_ = {0.01207415143427396598005501314378266234585,
522 0.02772976468699360056472008267912233025642,
523 0.04251807415858959044176768509553103692525,
524 0.05594192359670198554739419281317796336792,
525 0.06756818423426273664315999085117509868606,
526 0.07702288053840514404071579740097930597024,
527 0.0840020510782250222549853318941615775106,
528 0.08828135268349632316263549505659861957546,
529 0.08972323517810326272913282213094281072439,
530 0.08828135268349632316263549505659861957546,
531 0.0840020510782250222549853318941615775106,
532 0.07702288053840514404071579740097930597024,
533 0.06756818423426273664315999085117509868606,
534 0.05594192359670198554739419281317796336792,
535 0.04251807415858959044176768509553103692525,
536 0.02772976468699360056472008267912233025642,
537
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.01207415143427396598005501314378266234585};
538 76 }
539 std::vector<double> xi_;
540 std::vector<double> w_;
541 };
542 /**
543 * \brief Gauss Legendre Rule using 18 point.
544 */
545 template <>
546 struct GaussLegendreRule<18> {
547 76 GaussLegendreRule() {
548 xi_ = {0.004217415789534526634991997646924614873711,
549 0.02208802521430112240940205353511184501358,
550 0.05369876675122213039696970443642724229605,
551 0.09814752051373844215879127249270460144835,
552 0.1541564784698233960625544593555758052739,
553 0.2201145844630262326960642257373354315362,
554 0.2941244192685786769820341030834741814605,
555 0.3740568871542472452055135725610443849186,
556 0.4576124934791323493788690735321080941333,
557 0.5423875065208676506211309264678919058667,
558 0.6259431128457527547944864274389556150814,
559 0.7058755807314213230179658969165258185395,
560 0.7798854155369737673039357742626645684638,
561 0.8458435215301766039374455406444241947261,
562 0.9018524794862615578412087275072953985516,
563 0.9463012332487778696030302955635727577039,
564 0.9779119747856988775905979464648881549864,
565
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.9957825842104654733650080023530753851263};
566
567 w_ = {0.01080800676324165515667135513322623469384,
568 0.02485727444748489822666747310131932084043,
569 0.03821286512744452826456483880831826280266,
570 0.0504710220531435827814069924624173035314,
571 0.06127760335573923009225956340010077761408,
572 0.07032145733532532560236565187597361404775,
573 0.07734233756313262246270900191818738609661,
574 0.08213824187291636149302688823296379520617,
575 0.08457119148157179592032823506749330516705,
576 0.08457119148157179592032823506749330516705,
577 0.08213824187291636149302688823296379520617,
578 0.07734233756313262246270900191818738609661,
579 0.07032145733532532560236565187597361404775,
580 0.06127760335573923009225956340010077761408,
581 0.0504710220531435827814069924624173035314,
582 0.03821286512744452826456483880831826280266,
583 0.02485727444748489822666747310131932084043,
584
1/2
✓ Branch 1 taken 76 times.
✗ Branch 2 not taken.
76 0.01080800676324165515667135513322623469384};
585 76 }
586 std::vector<double> xi_;
587 std::vector<double> w_;
588 };
589 /**
590 * \brief Gauss Legendre Rule using 19 point.
591 */
592 template <>
593 struct GaussLegendreRule<19> {
594 71 GaussLegendreRule() {
595 xi_ = {0.003796578078207798405491164873369753205342,
596 0.01989592393258498457361057965617423669245,
597 0.0484220481925910491786695357338437560953,
598 0.08864267173142858751053875664364304911273,
599 0.1395169113323853106914520695881091851714,
600 0.1997273476691594882651809175268803600658,
601 0.2677146293120195271413664259479488160119,
602 0.3417179500181850840049413355750775410539,
603 0.4198206771798873120659519421296282252476,
604 0.5,
605 0.5801793228201126879340480578703717747524,
606 0.6582820499818149159950586644249224589461,
607 0.7322853706879804728586335740520511839881,
608 0.8002726523308405117348190824731196399342,
609 0.8604830886676146893085479304118908148286,
610 0.9113573282685714124894612433563569508873,
611 0.9515779518074089508213304642661562439047,
612 0.9801040760674150154263894203438257633075,
613
1/2
✓ Branch 1 taken 71 times.
✗ Branch 2 not taken.
71 0.9962034219217922015945088351266302467947};
614
615 w_ = {0.009730894114863238518156020732219217876453,
616 0.02240711338284980016641907870099710597588,
617 0.03452227136882061329035412900300652248092,
618 0.04574501081122499973223104706191982633046,
619 0.05578332277366699735801195084088299874067,
620 0.06437698126966811383775789242843855852792,
621 0.07130335108680330588787305472095148623783,
622 0.0763830210329298333894277004488314992305,
623 0.07948442169697717382497821973252360083939,
624 0.08052722492439184798958181266045836751995,
625 0.07948442169697717382497821973252360083939,
626 0.0763830210329298333894277004488314992305,
627 0.07130335108680330588787305472095148623783,
628 0.06437698126966811383775789242843855852792,
629 0.05578332277366699735801195084088299874067,
630 0.04574501081122499973223104706191982633046,
631 0.03452227136882061329035412900300652248092,
632 0.02240711338284980016641907870099710597588,
633
1/2
✓ Branch 1 taken 71 times.
✗ Branch 2 not taken.
71 0.009730894114863238518156020732219217876453};
634 71 }
635 std::vector<double> xi_;
636 std::vector<double> w_;
637 };
638 /**
639 * \brief Gauss Legendre Rule using 20 point.
640 */
641 template <>
642 struct GaussLegendreRule<20> {
643 71 GaussLegendreRule() {
644 xi_ = {0.003435700407452537606938805764339860888676,
645 0.01801403636104310436616693440136138904397,
646 0.04388278587433704706612377939835094347541,
647 0.08044151408889058830273546914923965733519,
648 0.1268340467699246036928474648221792048446,
649 0.1819731596367424872735816518868570316283,
650 0.2445664990245864509978179745223745007873,
651 0.3131469556422902196637259114875363813021,
652 0.3861070744291774609597519023157126876285,
653 0.4617367394332513331226797953005808944976,
654 0.5382632605667486668773202046994191055024,
655 0.6138929255708225390402480976842873123715,
656 0.6868530443577097803362740885124636186979,
657 0.7554335009754135490021820254776254992127,
658 0.8180268403632575127264183481131429683717,
659 0.8731659532300753963071525351778207951554,
660 0.9195584859111094116972645308507603426648,
661 0.9561172141256629529338762206016490565246,
662 0.981985963638956895633833065598638610956,
663
1/2
✓ Branch 1 taken 71 times.
✗ Branch 2 not taken.
71 0.9965642995925474623930611942356601391113};
664
665 w_ = {0.008807003569576059155930981175926408181072,
666 0.02030071490019347066551997613746605493955,
667 0.0313360241670545317847532675935208031758,
668 0.04163837078835237436237907161102310305009,
669 0.05096505990862021751837506774017493808335,
670 0.05909726598075920865618868885569114350252,
671 0.06584431922458831344924724987408156745806,
672 0.07104805465919102566464916253358246651726,
673 0.07458649323630187339391436850098471834634,
674 0.07637669356536292534904216597754879674597,
675 0.07637669356536292534904216597754879674597,
676 0.07458649323630187339391436850098471834634,
677 0.07104805465919102566464916253358246651726,
678 0.06584431922458831344924724987408156745806,
679 0.05909726598075920865618868885569114350252,
680 0.05096505990862021751837506774017493808335,
681 0.04163837078835237436237907161102310305009,
682 0.0313360241670545317847532675935208031758,
683 0.02030071490019347066551997613746605493955,
684
1/2
✓ Branch 1 taken 71 times.
✗ Branch 2 not taken.
71 0.008807003569576059155930981175926408181072};
685 71 }
686 std::vector<double> xi_;
687 std::vector<double> w_;
688 };
689
690 } // namespace Bembel
691 #endif // BEMBEL_SRC_QUADRATURE_GAUSSLEGENDRERULE_HPP_
692