inf_fe_jacobi_20_00_eval.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 // Local Includes
20 #include "libmesh/libmesh_config.h"
21 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
22 #include "libmesh/inf_fe.h"
23 
24 namespace libMesh
25 {
26 
27 // Anonymous namespace for local helper functions
28 namespace {
29 
30 Real jacobi_20_00_eval(Real v, unsigned i)
31 {
32  libmesh_assert (-1.-1.e-5 <= v && v < 1.);
33 
34  switch (i)
35  {
36  case 0:
37  return 1.;
38 
39  case 1:
40  return 2.+2.*v;
41 
42  case 2:
43  return -1.25+
44  (2.5+3.75*v)*v;
45 
46  case 3:
47  return .25+
48  (-1.5+
49  (5.25+7.*v)*v)*v;
50 
51  case 4:
52  return -.875+
53  (-3.5+
54  (-5.25+
55  (10.5+13.125*v)*v)*v)*v;
56 
57  case 5:
58  return 1.625+
59  (1.25+
60  (-11.25+
61  (-15.+
62  (20.625+24.75*v)*v)*v)*v)*v;
63 
64  case 6:
65  return -1.078125+(4.21875+
66  (6.328125+
67  (-30.9375+
68  (-38.671875+
69  (40.21875+46.921875*v)*v)*v)*v)*v)*v;
70 
71  case 7:
72  return .453125+(-1.09375+
73  (18.046875+
74  (24.0625+
75  (-78.203125+
76  (-93.84375+
77  (78.203125+89.375*v)*v)*v)*v)*v)*v)*v;
78 
79  case 8:
80  return -.9453125+(-4.8125+
81  (-7.21875+
82  (62.5625+
83  (78.203125+
84  (-187.6875+
85  (-218.96875+
86  (151.9375+170.9296875*v)*v)*v)*v)*v)*v)*v)*v;
87 
88  case 9:
89  return 1.4921875+(.984375+
90  (-25.59375+
91  (-34.125+
92  (191.953125+
93  (230.34375+
94  (-435.09375+
95  (-497.25+
96  (295.2421875+328.046875*v)*v)*v)*v)*v)*v)*v)*v)*v;
97 
98  case 10:
99  return -1.041015625+(5.33203125+
100  (7.998046875+
101  (-106.640625+
102  (-133.30078125+
103  (543.8671875+
104  (634.51171875+
105  (-984.140625+
106  (-1107.158203125+
107  (574.08203125+631.490234375*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
108 
109  case 11:
110  return .548828125+(-.90234375+
111  (33.837890625+
112  (45.1171875+
113  (-383.49609375+
114  (-460.1953125+
115  (1457.28515625+
116  (1665.46875+
117  (-2185.927734375+
118  (-2428.80859375+
119  (1117.251953125+1218.8203125*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
120 
121  case 12:
122  return -.9677734375+
123  (-5.80078125+
124  (-8.701171875+
125  (164.35546875+
126  (205.4443359375+
127  (-1249.1015625+
128  (-1457.28515625+
129  (3747.3046875+
130  (4215.7177734375+
131  (-4788.22265625+
132  (-5267.044921875+
133  (2176.46484375+2357.8369140625*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
134 
135  case 13:
136  return 1.418945312499432+
137  (.837890625+
138  (-42.732421875+
139  (-56.9765625+
140  (676.5966796875+
141  (811.9160156249999+
142  (-3788.94140625+
143  (-4330.21875+
144  (9337.0341796875+
145  (10374.482421875+
146  (-10374.482421875+
147  (-11317.6171875+
148  (4244.1064453125+4570.576171875*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
149 
150  case 14:
151  return -1.02618408203125+
152  (6.2318115234375+
153  (9.34771728515625+
154  (-236.808837890625+
155  (-296.0110473632813+
156  (2486.492797851563+
157  (2900.908264160156+
158  (-10893.20654296875+
159  (-12254.85736083984+
160  (22694.18029785156+
161  (24963.59832763672+
162  (-22281.55883789063+
163  (-24138.35540771484+
164  (8284.169311523438+8875.895690917969*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
165 
166  case 15:
167  return .60723876953125+
168  (-.7855224609375+
169  (52.23724365234375+
170  (69.649658203125+
171  (-1096.982116699219+
172  (-1316.378540039063+
173  (8410.196228027344+
174  (9611.65283203125+
175  (-30036.41510009766+
176  (-33373.79455566406+
177  (54065.54718017578+
178  (58980.59692382813+
179  (-47512.14752197266+
180  (-51166.92810058594+
181  (16185.45684814453+17264.4873046875*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
182 
183  case 16:
184  return -.978179931640625+
185  (-6.63330078125+
186  (-9.949951171875+
187  (325.03173828125+
188  (406.2896728515625+
189  (-4485.43798828125+
190  (-5233.010986328125+
191  (26699.03564453125+
192  (30036.41510009766+
193  (-80097.10693359375+
194  (-88106.81762695313+
195  (126699.0600585938+
196  (137257.3150634766+
197  (-100709.5092773438+
198  (-107903.0456542969+
199  (31651.56005859375+33629.78256225586*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
200 
201  case 17:
202  return 1.370941162109141+
203  (.74188232421875+
204  (-62.31811523437499+
205  (-83.0908203125+
206  (1672.202758789063+
207  (2006.643310546875+
208  (-16722.02758789063+
209  (-19110.888671875+
210  (80624.06158447266+
211  (89582.29064941406+
212  (-207830.9143066406+
213  (-226724.6337890625+
214  (292852.6519775391+
215  (315379.7790527344+
216  (-212398.6267089844+
217  (-226558.53515625+
218  (61949.5994567871+65593.69354248047*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
219 
220  case 18:
221  return -1.018547058106322+
222  (7.010787963867187+
223  (10.51618194580078+
224  (-429.9949951171874+
225  (-537.4937438964844+
226  (7524.91241455078+
227  (8779.064483642578+
228  (-58049.32434082031+
229  (-65305.48988342284+
230  (233809.7785949707+
231  (257190.7564544677+
232  (-527134.7735595703+
233  (-571062.6713562012+
234  (669055.6741333008+
235  (716845.3651428223+
236  (-446037.1160888671+
237  (-473914.4358444213+
238  (121348.3330535889+128089.9071121216*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
239 
240 
241  default:
242  libmesh_error_msg("bad index i = " << i);
243  }
244 } // jacobi_20_00_eval()
245 
246 
247 
248 
249 
250 Real jacobi_20_00_eval_deriv(Real v, unsigned i)
251 {
252  libmesh_assert (-1.-1.e-5 <= v && v < 1.);
253 
254  switch (i)
255  {
256  case 0:
257  return 0.;
258 
259  case 1:
260  return 2.;
261 
262  case 2:
263  return 7.5*v+2.5;
264 
265  case 3:
266  return -1.5+
267  (10.5+21.*v)*v;
268 
269  case 4:
270  return -3.5+
271  (-10.5+
272  (31.5+52.5*v)*v)*v;
273 
274  case 5:
275  return 1.25+
276  (-22.5+
277  (-45.+
278  (82.5+123.75*v)*v)*v)*v;
279 
280  case 6:
281  return 4.21875+
282  (12.65625+
283  (-92.8125+
284  (-154.6875+
285  (201.09375+281.53125*v)*v)*v)*v)*v;
286 
287  case 7:
288  return -1.09375+
289  (36.09375+
290  (72.1875+
291  (-312.8125+
292  (-469.21875+
293  (469.21875+625.625*v)*v)*v)*v)*v)*v;
294 
295  case 8:
296  return -4.8125+
297  (-14.4375+
298  (187.6875+
299  (312.8125+
300  (-938.4375+
301  (-1313.8125+
302  (1063.5625+1367.4375*v)*v)*v)*v)*v)*v)*v;
303 
304  case 9:
305  return .984375+
306  (-51.1875+
307  (-102.375+
308  (767.8125+
309  (1151.71875+
310  (-2610.5625+
311  (-3480.75+
312  (2361.9375+2952.421875*v)*v)*v)*v)*v)*v)*v)*v;
313 
314  case 10:
315  return 5.33203125+
316  (15.99609375+
317  (-319.921875+
318  (-533.203125+
319  (2719.3359375+
320  (3807.0703125+
321  (-6888.984375+
322  (-8857.265625+
323  (5166.73828125+6314.90234375*v)*v)*v)*v)*v)*v)*v)*v)*v;
324 
325  case 11:
326  return -.90234375+
327  (67.67578125+
328  (135.3515625+
329  (-1533.984375+
330  (-2300.9765625+
331  (8743.7109375+
332  (11658.28125+
333  (-17487.421875+
334  (-21859.27734375+
335  (11172.51953125+13407.0234375*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
336 
337  case 12:
338  return -5.80078125+
339  (-17.40234375+
340  (493.06640625+
341  (821.77734375+
342  (-6245.5078125+
343  (-8743.7109375+
344  (26231.1328125+
345  (33725.7421875+
346  (-43094.00390625+
347  (-52670.44921875+
348  (23941.11328125+28294.04296875*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
349 
350  case 13:
351  return .837890625+
352  (-85.46484375+
353  (-170.9296875+
354  (2706.38671875+
355  (4059.580078124999+
356  (-22733.6484375+
357  (-30311.53125+
358  (74696.2734375+
359  (93370.341796875+
360  (-103744.82421875+
361  (-124493.7890625+
362  (50929.27734375+59417.490234375*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
363 
364  case 14:
365  return 6.2318115234375+
366  (18.6954345703125+
367  (-710.426513671875+
368  (-1184.044189453125+
369  (12432.46398925781+
370  (17405.44958496094+
371  (-76252.44580078125+
372  (-98038.85888671875+
373  (204247.6226806641+
374  (249635.9832763672+
375  (-245097.1472167969+
376  (-289660.2648925781+
377  (107694.2010498047+124262.5396728516*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
378 
379  case 15:
380  return -.7855224609375+
381  (104.4744873046875+
382  (208.948974609375+
383  (-4387.928466796875+
384  (-6581.892700195313+
385  (50461.17736816406+
386  (67281.56982421875+
387  (-240291.3208007813+
388  (-300364.1510009766+
389  (540655.4718017578+
390  (648786.5661621094+
391  (-570145.7702636719+
392  (-665170.0653076172+
393  (226596.3958740234+258967.3095703125*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
394 
395  case 16:
396  return -6.63330078125+
397  (-19.89990234375+
398  (975.09521484375+
399  (1625.15869140625+
400  (-22427.18994140625+
401  (-31398.06591796875+
402  (186893.2495117188+
403  (240291.3208007813+
404  (-720873.9624023438+
405  (-881068.1762695313+
406  (1393689.660644531+
407  (1647087.780761719+
408  (-1309223.620605469+
409  (-1510642.639160156+
410  (474773.4008789063+538076.5209960938*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
411 
412  case 17:
413  return .74188232421875+
414  (-124.63623046875+
415  (-249.2724609375+
416  (6688.81103515625+
417  (10033.21655273437+
418  (-100332.1655273438+
419  (-133776.220703125+
420  (644992.4926757813+
421  (806240.6158447266+
422  (-2078309.143066406+
423  (-2493970.971679688+
424  (3514231.823730469+
425  (4099937.127685547+
426  (-2973580.773925781+
427  (-3398378.02734375+
428  (991193.5913085936+1115092.790222168*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
429 
430  case 18:
431  return 7.010787963867187+
432  (21.03236389160156+
433  (-1289.984985351562+
434  (-2149.974975585938+
435  (37624.5620727539+
436  (52674.38690185547+
437  (-406345.2703857421+
438  (-522443.9190673828+
439  (2104288.007354736+
440  (2571907.564544677+
441  (-5798482.509155273+
442  (-6852752.056274414+
443  (8697723.76373291+
444  (10035835.11199951+
445  (-6690556.741333007+
446  (-7582630.973510741+
447  (2062921.66191101+2305618.328018188*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
448 
449 
450  default:
451  libmesh_error_msg("bad index i = " << i);
452  }
453 } // jacobi_20_00_eval_deriv()
454 
455 
456 } // anonymous namespace
457 
458 
459 
460  // Specialize the eval() function for 1, 2, and 3 dimensions and the CARTESIAN mapping type
461  // to call the local helper function from the anonymous namespace.
462 template <> Real InfFE<1,JACOBI_20_00,CARTESIAN>::eval(Real v, Order, unsigned i) { return jacobi_20_00_eval(v, i); }
463 template <> Real InfFE<2,JACOBI_20_00,CARTESIAN>::eval(Real v, Order, unsigned i) { return jacobi_20_00_eval(v, i); }
464 template <> Real InfFE<3,JACOBI_20_00,CARTESIAN>::eval(Real v, Order, unsigned i) { return jacobi_20_00_eval(v, i); }
465 
466 // Specialize the eval_deriv() function for 1, 2, and 3 dimensions and the CARTESIAN mapping type
467 // to call the local helper function from the anonymous namespace.
468 template <> Real InfFE<1,JACOBI_20_00,CARTESIAN>::eval_deriv(Real v, Order, unsigned i) { return jacobi_20_00_eval_deriv(v, i); }
469 template <> Real InfFE<2,JACOBI_20_00,CARTESIAN>::eval_deriv(Real v, Order, unsigned i) { return jacobi_20_00_eval_deriv(v, i); }
470 template <> Real InfFE<3,JACOBI_20_00,CARTESIAN>::eval_deriv(Real v, Order, unsigned i) { return jacobi_20_00_eval_deriv(v, i); }
471 
472 } // namespace libMesh
473 
474 #endif // LIBMESH_ENABLE_INFINITE_ELEMENTS
static Real eval_deriv(Real v, Order o_radial, unsigned int i)
static Real eval(Real v, Order o_radial, unsigned int i)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real