12 double xsquare = pow(x, 2);
14 case(0): L = 0.5 * (1 - 1 * x);
return L;
15 case(1): L = 0.5 * (1 + x);
return L;
18 L = L * 0.5 * pow(3. / 2., 0.5);
21 L = x * (-1 + xsquare);
22 L = L * 0.5 * pow(5. / 2., 0.5);
25 L = 1 + xsquare * (-6 + 5. * xsquare);
26 L = L * 1. / 8. * pow(7. / 2., 0.5);
29 L = x * (3 + xsquare * (-10 + 7. * xsquare));
30 L = L * 3. / 8. * pow(2., -0.5);
33 L = -1 + xsquare * (15 + xsquare * (-35 + 21 * xsquare));
34 L = L * 1. / 16. * pow(11. / 2., 0.5);
37 L = x * (-5 + xsquare * (35 + xsquare * (-63 + 33 * xsquare)));
38 L = L * 1. / 16. * pow(13. / 2., 0.5);
42 5 + xsquare * (-140 + xsquare * (630 + xsquare * (-924 + 429 * xsquare)));
43 L = L * 1. / 128. * pow(15. / 2., 0.5);
48 (-420 + xsquare * (1386 + xsquare * (-1716 + 715 * xsquare))));
49 L = L * 1. / 128. * pow(17. / 2., 0.5);
56 (-2310 + xsquare * (6006 + xsquare * (-6435 + 2431 * xsquare))));
57 L = L * 1. / 256. * pow(19. / 2., 0.5);
66 (-6006 + xsquare * (12870 + xsquare * (-12155 + 4199 * xsquare)))));
67 L = L * 1. / 256. * pow(21. / 2., 0.5);
77 xsquare * (109395 + xsquare * (-92378 + 29393 * xsquare)))));
78 L = L * 1. / 1024. * pow(23. / 2., 0.5);
90 xsquare * (230945 + xsquare * (-176358 + 52003 * xsquare))))));
91 L = L * 5. / 1024. * pow(2., -0.5);
103 xsquare * (969969 + xsquare * (-676039 +
104 185725 * xsquare))))));
105 L = L * 3. / 2048. * pow(3. / 2., 0.5);
119 (2028117 + xsquare * (-1300075 + 334305 * xsquare)))))));
120 L = L * 1. / 2048. * pow(29. / 2., 0.5);
123 default:
throw std::runtime_error(
"Lobatto functions are written for orders =< 15");
130 double xsquare = pow(x, 2);
132 case(0): dL = -0.5;
return dL;
133 case(1): dL = 0.5;
return dL;
136 dL = dL * 0.5 * pow(3. / 2., 0.5);
139 dL = -1 + 3 * xsquare;
140 dL = dL * 0.5 * pow(5. / 2., 0.5);
143 dL = x * (-12 + 20 * xsquare);
144 dL = dL * 1. / 8. * pow(7. / 2., 0.5);
147 dL = 3 + xsquare * (-30 + 35. * xsquare);
148 dL = dL * 3. / 8. * pow(2., -0.5);
151 dL = x * (30 + xsquare * (-140 + 126 * xsquare));
152 dL = dL * 1. / 16. * pow(11. / 2., 0.5);
155 dL = -5 + xsquare * (105 + xsquare * (-315 + 231 * xsquare));
156 dL = dL * 1. / 16. * pow(13. / 2., 0.5);
159 dL = x * (-280 + xsquare * (2520 + xsquare * (-5544 + 3432 * xsquare)));
160 dL = dL * 1. / 128. * pow(15. / 2., 0.5);
165 (-1260 + xsquare * (6930 + xsquare * (-12012 + 6435 * xsquare)));
166 dL = dL * 1. / 128. * pow(17. / 2., 0.5);
172 (-9240 + xsquare * (36036 + xsquare * (-51480 + 24310 * xsquare))));
173 dL = dL * 1. / 256. * pow(19. / 2., 0.5);
181 xsquare * (90090 + xsquare * (-109395 + 46189 * xsquare))));
182 dL = dL * 1. / 256. * pow(21. / 2., 0.5);
191 xsquare * (875160 + xsquare * (-923780 + 352716 * xsquare)))));
192 dL = dL * 1. / 1024. * pow(23. / 2., 0.5);
203 xsquare * (2078505 + xsquare * (-1939938 + 676039 * xsquare)))));
204 dL = dL * 5. / 1024. * pow(2., -0.5);
214 xsquare * (-5542680 +
215 xsquare * (9699690 + xsquare * (-8112468 +
216 2600150 * xsquare))))));
217 dL = dL * 3. / 2048. * pow(3. / 2., 0.5);
229 xsquare * (22309287 +
230 xsquare * (-16900975 + 5014575 * xsquare))))));
231 dL = dL * 1. / 2048. * pow(29. / 2., 0.5);
234 default:
throw std::runtime_error(
"Lobatto functions are written for orders =< 15");
241 double xsquare = pow(x, 2);
243 case(0): phi = -pow(6, 0.5);
return phi;
244 case(1): phi = -x * pow(10, 0.5);
return phi;
246 phi = 1 - 5 * xsquare;
247 phi = phi * 0.5 * pow(7. / 2., 0.5);
250 phi = x * (3 - 7 * xsquare);
251 phi = phi * 3. / 2. * pow(2, -0.5);
254 phi = -1 + xsquare * (14 - 21 * xsquare);
255 phi = phi * 1. / 4. * pow(11. / 2., 0.5);
258 phi = x * (-5 + xsquare * (30 - 33 * xsquare));
259 phi = phi * 1. / 4. * pow(13. / 2., 0.5);
262 phi = 5 + xsquare * (-135 + xsquare * (495 - 429 * xsquare));
263 phi = phi * 1. / 32. * pow(15. / 2., 0.5);
266 phi = x * (35 + xsquare * (-385 + xsquare * (1001 - 715 * xsquare)));
267 phi = phi * 1. / 32. * pow(17. / 2., 0.5);
271 (308 + xsquare * (-2002 + xsquare * (4004 - 2431 * xsquare)));
272 phi = phi * 1. / 64. * pow(19. / 2., 0.5);
278 (1092 + xsquare * (-4914 + xsquare * (7956 - 4199 * xsquare))));
279 phi = phi * 1. / 64. * pow(21. / 2., 0.5);
287 (13650 + xsquare * (-46410 + xsquare * (62985 - 29393 * xsquare))));
288 phi = phi * 1. / 256. * pow(23. / 2., 0.5);
297 xsquare * (-106590 + xsquare * (124355 - 52003 * xsquare)))));
298 phi = phi * 5. / 256. * pow(2, -0.5);
309 xsquare * (-479655 + xsquare * (490314 - 185725 * xsquare)))));
310 phi = phi * 3. / 512. * pow(3. / 2., 0.5);
321 (554268 + xsquare * (-1062347 +
322 xsquare * (965770 - 334305 * xsquare))))));
323 phi = phi * 1. / 512. * pow(29. / 2., 0.5);
325 default:
throw std::runtime_error(
"Lobatto functions are written for orders =< 15");
332 double xsquare = pow(x, 2);
334 case(0): dphi = 0;
return dphi;
335 case(1): dphi = -pow(10, 0.5);
return dphi;
339 dphi = dphi * 0.5 * pow(7. / 2., 0.5);
342 dphi = 3 - 21 * xsquare;
343 dphi = dphi * 3. / 2. * pow(2, -0.5);
346 dphi = x * (28 - 84 * xsquare);
347 dphi = dphi * 1. / 4. * pow(11. / 2., 0.5);
350 dphi = -5 + xsquare * (90 - 165 * xsquare);
351 dphi = dphi * 1. / 4. * pow(13. / 2., 0.5);
354 dphi = x * (-270 + xsquare * (1980 - 2574 * xsquare));
355 dphi = dphi * 1. / 32. * pow(15. / 2., 0.5);
358 dphi = 35 + xsquare * (-1155 + xsquare * (5005 - 5005 * xsquare));
359 dphi = dphi * 1. / 32. * pow(17. / 2., 0.5);
362 dphi = x * (616 + xsquare * (-8008 + xsquare * (24024 - 19448 * xsquare)));
363 dphi = dphi * 1. / 64. * pow(19. / 2., 0.5);
368 (3276 + xsquare * (-24570 + xsquare * (55692 - 37791 * xsquare)));
369 dphi = dphi * 1. / 64. * pow(21. / 2., 0.5);
376 (54600 + xsquare * (-278460 + xsquare * (503880 - 293930 * xsquare))));
378 dphi = dphi * 1. / 256. * pow(23. / 2., 0.5);
386 xsquare * (-746130 + xsquare * (1119195 - 572033 * xsquare))));
387 dphi = dphi * 5. / 256. * pow(2, -0.5);
395 xsquare * (-3837240 +
396 xsquare * (4903140 - 2228700 * xsquare)))));
397 dphi = dphi * 3. / 512. * pow(3. / 2., 0.5);
407 xsquare * (-9561123 +
408 xsquare * (10623470 - 4345965 * xsquare)))));
409 dphi = dphi * 1. / 512. * pow(29. / 2., 0.5);
411 default:
throw std::runtime_error(
"Lobatto functions are written for orders =< 15");
418 double xsquare = pow(x, 2);
420 case(0): L = 1;
return L;
421 case(1): L = x;
return L;
422 case(2): L = 3. / 2. * xsquare - 1. / 2.;
return L;
423 case(3): L = 0.5 * x * (5 * xsquare - 3);
return L;
425 L = (3 + xsquare * (35 * xsquare - 30));
429 L = x * (xsquare * (63 * xsquare - 70) + 15);
433 L = ((231 * xsquare - 315) * xsquare + 105) * xsquare - 5;
437 L = x * (((429 * xsquare - 693) * xsquare + 315) * xsquare - 35);
442 (((6435 * xsquare - 12012) * xsquare + 6930) * xsquare - 1260) * xsquare +
447 L = ((((12155 * xsquare - 25740) * xsquare + 18018) * xsquare - 4620) *
454 L = ((((46189 * xsquare - 109395) * xsquare + 90090) * xsquare - 30030) *
461 default:
throw std::runtime_error(
"Legendre functions are written for orders =< 10");
468 double xsquare = pow(x, 2);
470 case(0): dL = 0;
return dL;
471 case(1): dL = 1;
return dL;
472 case(2): dL = 3 * x;
return dL;
473 case(3): dL = 0.5 * (15 * xsquare - 3);
return dL;
475 dL = x * (140 * xsquare - 60);
479 dL = 15 + xsquare * (315 * xsquare - 210);
483 dL = x * (210 + xsquare * (1386 * xsquare - 1260));
487 dL = ((xsquare * 3003 - 3465) * xsquare + 945) * xsquare - 35;
491 dL = x * (((51480 * xsquare - 72072) * xsquare + 27720) * xsquare - 2520);
497 xsquare * (90090 + xsquare * (-180180 + 109395 * xsquare)));
504 xsquare * (540540 + xsquare * (-875160 + 461890 * xsquare))));
507 default:
throw std::runtime_error(
"Legendre functions are written for orders =< 10");