17 #define MAX_DIRECT_CALCULATION_LEGENDRE 12
22 const std::vector<std::size_t> & order,
29 else if (expansion_type ==
"sqrt_mu")
31 else if (expansion_type ==
"standard")
34 mooseError(
"The specified type of normalization for expansion does not exist");
38 else if (generation_type ==
"sqrt_mu")
40 else if (generation_type ==
"standard")
43 mooseError(
"The specified type of normalization for generation does not exist");
56 if (bounds.size() != 2)
57 mooseError(
"Legend: Invalid number of bounds specified for single series!");
65 const Real x2 = x * x;
81 case MAX_DIRECT_CALCULATION_LEGENDRE:
82 save(12, ((((((676039 * x2 - 1939938) * x2 + 2078505) * x2 - 1021020) * x2 + 225225) * x2 - 18018) * x2 + 231) / 1024
84 libmesh_fallthrough();
87 save(11, (((((88179 * x2 - 230945) * x2 + 218790) * x2 - 90090) * x2 + 15015) * x2 - 693) * x / 256
89 libmesh_fallthrough();
92 save(10, (((((46189 * x2 - 109395) * x2 + 90090) * x2 - 30030) * x2 + 3465) * x2 - 63) / 256
94 libmesh_fallthrough();
97 save(9, ((((12155 * x2 - 25740) * x2 + 18018) * x2 - 4620) * x2 + 315) * x / 128
99 libmesh_fallthrough();
102 save(8, ((((6435 * x2 - 12012) * x2 + 6930) * x2 - 1260) * x2 + 35) / 128
104 libmesh_fallthrough();
107 save(7, (((429 * x2 - 693) * x2 + 315) * x2 - 35) * x / 16
109 libmesh_fallthrough();
112 save(6, (((231 * x2 - 315) * x2 + 105) * x2 - 5) / 16
114 libmesh_fallthrough();
117 save(5, ((63 * x2 - 70) * x2 + 15) * x / 8
119 libmesh_fallthrough();
122 save(4, ((35 * x2 - 30) * x2 + 3) / 8
124 libmesh_fallthrough();
127 save(3, (5 * x2 - 3) * x / 2
129 libmesh_fallthrough();
132 save(2, (3 * x2 - 1) / 2
134 libmesh_fallthrough();
139 libmesh_fallthrough();
169 for (k = MAX_DIRECT_CALCULATION_LEGENDRE + 1; k <=
_orders[0]; ++k)
170 save(k, ((k + k + 1) / Real(k)) * (x *
load(k - 1) - ((k - 1) / (k + k - 3.0)) *
load(k - 2)));
178 const Real x2 = x * x;
194 case MAX_DIRECT_CALCULATION_LEGENDRE:
195 save(12, ((((((676039 * x2 - 1939938) * x2 + 2078505) * x2 - 1021020) * x2 + 225225) * x2 - 18018) * x2 + 231) / 1024);
196 libmesh_fallthrough();
199 save(11, (((((88179 * x2 - 230945) * x2 + 218790) * x2 - 90090) * x2 + 15015) * x2 - 693) * x / 256);
200 libmesh_fallthrough();
203 save(10, (((((46189 * x2 - 109395) * x2 + 90090) * x2 - 30030) * x2 + 3465) * x2 - 63) / 256);
204 libmesh_fallthrough();
207 save(9, ((((12155 * x2 - 25740) * x2 + 18018) * x2 - 4620) * x2 + 315) * x / 128);
208 libmesh_fallthrough();
211 save(8, ((((6435 * x2 - 12012) * x2 + 6930) * x2 - 1260) * x2 + 35) / 128);
212 libmesh_fallthrough();
215 save(7, (((429 * x2 - 693) * x2 + 315) * x2 - 35) * x / 16);
216 libmesh_fallthrough();
219 save(6, (((231 * x2 - 315) * x2 + 105) * x2 - 5) / 16);
220 libmesh_fallthrough();
223 save(5, ((63 * x2 - 70) * x2 + 15) * x / 8);
224 libmesh_fallthrough();
227 save(4, ((35 * x2 - 30) * x2 + 3) / 8);
228 libmesh_fallthrough();
231 save(3, (5 * x2 - 3) * x / 2);
232 libmesh_fallthrough();
235 save(2, (3 * x2 - 1) / 2);
236 libmesh_fallthrough();
240 libmesh_fallthrough();
254 for (k = MAX_DIRECT_CALCULATION_LEGENDRE + 1; k <=
_orders[0]; ++k)
255 save(k, (((2 * k - 1) * x *
load(k - 1)) - ((k - 1) *
load(k - 2))) / Real(k));
263 save(i,
load(i) * std::sqrt(i + 0.5));
266 const std::vector<Real> &
270 static const std::vector<Real> standardizedFunctionLimits = {-1, 1};
272 return standardizedFunctionLimits;
288 const Real ratio = difference / span;
291 return {ratio * 2 - 1};