libMesh
inf_fe_jacobi_20_00_eval.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 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 
245  libmesh_error_msg("We'll never get here!");
246  return 0.;
247 } // jacobi_20_00_eval()
248 
249 
250 
251 
252 
253 Real jacobi_20_00_eval_deriv(Real v, unsigned i)
254 {
255  libmesh_assert (-1.-1.e-5 <= v && v < 1.);
256 
257  switch (i)
258  {
259  case 0:
260  return 0.;
261 
262  case 1:
263  return 2.;
264 
265  case 2:
266  return 7.5*v+2.5;
267 
268  case 3:
269  return -1.5+
270  (10.5+21.*v)*v;
271 
272  case 4:
273  return -3.5+
274  (-10.5+
275  (31.5+52.5*v)*v)*v;
276 
277  case 5:
278  return 1.25+
279  (-22.5+
280  (-45.+
281  (82.5+123.75*v)*v)*v)*v;
282 
283  case 6:
284  return 4.21875+
285  (12.65625+
286  (-92.8125+
287  (-154.6875+
288  (201.09375+281.53125*v)*v)*v)*v)*v;
289 
290  case 7:
291  return -1.09375+
292  (36.09375+
293  (72.1875+
294  (-312.8125+
295  (-469.21875+
296  (469.21875+625.625*v)*v)*v)*v)*v)*v;
297 
298  case 8:
299  return -4.8125+
300  (-14.4375+
301  (187.6875+
302  (312.8125+
303  (-938.4375+
304  (-1313.8125+
305  (1063.5625+1367.4375*v)*v)*v)*v)*v)*v)*v;
306 
307  case 9:
308  return .984375+
309  (-51.1875+
310  (-102.375+
311  (767.8125+
312  (1151.71875+
313  (-2610.5625+
314  (-3480.75+
315  (2361.9375+2952.421875*v)*v)*v)*v)*v)*v)*v)*v;
316 
317  case 10:
318  return 5.33203125+
319  (15.99609375+
320  (-319.921875+
321  (-533.203125+
322  (2719.3359375+
323  (3807.0703125+
324  (-6888.984375+
325  (-8857.265625+
326  (5166.73828125+6314.90234375*v)*v)*v)*v)*v)*v)*v)*v)*v;
327 
328  case 11:
329  return -.90234375+
330  (67.67578125+
331  (135.3515625+
332  (-1533.984375+
333  (-2300.9765625+
334  (8743.7109375+
335  (11658.28125+
336  (-17487.421875+
337  (-21859.27734375+
338  (11172.51953125+13407.0234375*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
339 
340  case 12:
341  return -5.80078125+
342  (-17.40234375+
343  (493.06640625+
344  (821.77734375+
345  (-6245.5078125+
346  (-8743.7109375+
347  (26231.1328125+
348  (33725.7421875+
349  (-43094.00390625+
350  (-52670.44921875+
351  (23941.11328125+28294.04296875*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
352 
353  case 13:
354  return .837890625+
355  (-85.46484375+
356  (-170.9296875+
357  (2706.38671875+
358  (4059.580078124999+
359  (-22733.6484375+
360  (-30311.53125+
361  (74696.2734375+
362  (93370.341796875+
363  (-103744.82421875+
364  (-124493.7890625+
365  (50929.27734375+59417.490234375*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
366 
367  case 14:
368  return 6.2318115234375+
369  (18.6954345703125+
370  (-710.426513671875+
371  (-1184.044189453125+
372  (12432.46398925781+
373  (17405.44958496094+
374  (-76252.44580078125+
375  (-98038.85888671875+
376  (204247.6226806641+
377  (249635.9832763672+
378  (-245097.1472167969+
379  (-289660.2648925781+
380  (107694.2010498047+124262.5396728516*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
381 
382  case 15:
383  return -.7855224609375+
384  (104.4744873046875+
385  (208.948974609375+
386  (-4387.928466796875+
387  (-6581.892700195313+
388  (50461.17736816406+
389  (67281.56982421875+
390  (-240291.3208007813+
391  (-300364.1510009766+
392  (540655.4718017578+
393  (648786.5661621094+
394  (-570145.7702636719+
395  (-665170.0653076172+
396  (226596.3958740234+258967.3095703125*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
397 
398  case 16:
399  return -6.63330078125+
400  (-19.89990234375+
401  (975.09521484375+
402  (1625.15869140625+
403  (-22427.18994140625+
404  (-31398.06591796875+
405  (186893.2495117188+
406  (240291.3208007813+
407  (-720873.9624023438+
408  (-881068.1762695313+
409  (1393689.660644531+
410  (1647087.780761719+
411  (-1309223.620605469+
412  (-1510642.639160156+
413  (474773.4008789063+538076.5209960938*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
414 
415  case 17:
416  return .74188232421875+
417  (-124.63623046875+
418  (-249.2724609375+
419  (6688.81103515625+
420  (10033.21655273437+
421  (-100332.1655273438+
422  (-133776.220703125+
423  (644992.4926757813+
424  (806240.6158447266+
425  (-2078309.143066406+
426  (-2493970.971679688+
427  (3514231.823730469+
428  (4099937.127685547+
429  (-2973580.773925781+
430  (-3398378.02734375+
431  (991193.5913085936+1115092.790222168*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
432 
433  case 18:
434  return 7.010787963867187+
435  (21.03236389160156+
436  (-1289.984985351562+
437  (-2149.974975585938+
438  (37624.5620727539+
439  (52674.38690185547+
440  (-406345.2703857421+
441  (-522443.9190673828+
442  (2104288.007354736+
443  (2571907.564544677+
444  (-5798482.509155273+
445  (-6852752.056274414+
446  (8697723.76373291+
447  (10035835.11199951+
448  (-6690556.741333007+
449  (-7582630.973510741+
450  (2062921.66191101+2305618.328018188*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
451 
452 
453  default:
454  libmesh_error_msg("bad index i = " << i);
455  }
456 
457  libmesh_error_msg("We'll never get here!");
458  return 0.;
459 } // jacobi_20_00_eval_deriv()
460 
461 
462 } // anonymous namespace
463 
464 
465 
466  // Specialize the eval() 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(Real v, Order, unsigned i) { return jacobi_20_00_eval(v, i); }
469 template <> Real InfFE<2,JACOBI_20_00,CARTESIAN>::eval(Real v, Order, unsigned i) { return jacobi_20_00_eval(v, i); }
470 template <> Real InfFE<3,JACOBI_20_00,CARTESIAN>::eval(Real v, Order, unsigned i) { return jacobi_20_00_eval(v, i); }
471 
472 // Specialize the eval_deriv() function for 1, 2, and 3 dimensions and the CARTESIAN mapping type
473 // to call the local helper function from the anonymous namespace.
474 template <> Real InfFE<1,JACOBI_20_00,CARTESIAN>::eval_deriv(Real v, Order, unsigned i) { return jacobi_20_00_eval_deriv(v, i); }
475 template <> Real InfFE<2,JACOBI_20_00,CARTESIAN>::eval_deriv(Real v, Order, unsigned i) { return jacobi_20_00_eval_deriv(v, i); }
476 template <> Real InfFE<3,JACOBI_20_00,CARTESIAN>::eval_deriv(Real v, Order, unsigned i) { return jacobi_20_00_eval_deriv(v, i); }
477 
478 } // namespace libMesh
479 
480 #endif // LIBMESH_ENABLE_INFINITE_ELEMENTS
static Real eval_deriv(Real v, Order o_radial, unsigned int i)
The libMesh namespace provides an interface to certain functionality in the library.
libmesh_assert(j)
static Real eval(Real v, Order o_radial, unsigned int i)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Order
defines an enum for polynomial orders.
Definition: enum_order.h:32