libMesh
inf_fe_jacobi_30_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_30_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.5+2.5*v;
41 
42  case 2:
43  return -.75+(4.5+5.25*v)*v;
44 
45  case 3:
46  return (10.5+10.5*v)*v*v;
47 
48  case 4:
49  return -1.375+
50  (-5.5+
51  (-2.25+
52  (22.5+20.625*v)*v)*v)*v;
53 
54  case 5:
55  return 1.78125+
56  (-1.40625+
57  (-19.6875+
58  (-10.3125+
59  (46.40625+40.21875*v)*v)*v)*v)*v;
60 
61  case 6:
62  return -.609375+
63  (6.09375+
64  (-2.578125+
65  (-58.4375+
66  (-33.515625+
67  (93.84375+78.203125*v)*v)*v)*v)*v)*v;
68 
69  case 7:
70  return .34375+
71  (2.40625+
72  (28.875+
73  (-156.40625+
74  (-93.84375+
75  (187.6875+151.9375*v)*v)*v)*v*v)*v)*v;
76 
77  case 8:
78  return -1.3828125+
79  (-6.5625+
80  (8.53125+
81  (108.0625+
82  (21.328125+
83  (-392.4375+
84  (-241.71875+
85  (372.9375+295.2421875*v)*v)*v)*v)*v)*v)*v)*v;
86 
87  case 9:
88  return 1.57421875+
89  (-3.19921875+
90  (-38.390625+
91  (21.328125+
92  (351.9140625+
93  (108.7734375+
94  (-942.703125+
95  (-590.484375+
96  (738.10546875+574.08203125*v)*v)*v)*v)*v)*v)*v)*v)*v;
97 
98  case 10:
99  return -.6308593750004547+
100  (6.97265625+
101  (-15.380859375+
102  (-172.265625+
103  (34.86328125+
104  (1045.8984375+
105  (397.4414062499999+
106  (-2195.390625+
107  (-1391.044921875+
108  (1457.28515625+1117.251953125*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
109 
110  case 11:
111  return .484375+
112  (3.8671875+
113  (48.33984375+
114  (-54.78515625+
115  (-657.421875+
116  (2914.5703125+
117  (1249.1015625+
118  (-4996.40625+
119  (-3192.1484375+
120  (2872.93359375+2176.46484375*v)*v)*v)*v)*v)*v*v)*v)*v)*v)*v;
121 
122  case 12:
123  return -1.3544921875+
124  (-7.34765625+
125  (23.009765625+
126  (252.01171875+
127  (-156.1376953125+
128  (-2248.3828125+
129  (-291.45703125+
130  (7744.4296875+
131  (3591.1669921875+
132  (-11172.51953125+
133  (-7182.333984375+
134  (5658.80859375+4244.1064453125*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
135 
136  case 13:
137  return 1.471313476557931+
138  (-4.4512939453125+
139  (-58.75708007812499+
140  (101.489501953125+
141  (1099.469604492188+
142  (-355.2132568359375+
143  (-7104.265136718749+
144  (-1556.17236328125+
145  (19841.19763183594+
146  (9726.077270507813+
147  (-24639.39575195312+
148  (-15915.39916992187+
149  (11140.77941894531+8284.169311523438*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
150 
151  case 14:
152  return -.65960693359375+
153  (7.6981201171875+
154  (-31.34234619140625+
155  (-348.248291015625+
156  (365.6607055664063+
157  (4241.664184570313+
158  (-560.6797485351563+
159  (-21145.63623046875+
160  (-6007.283020019531+
161  (49393.21594238281+
162  (25230.58868408203+
163  (-53737.87719726563+
164  (-34842.24151611328+
165  (21928.68347167969+16185.45684814453*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
166 
167  case 15:
168  return .5635986328125+
169  (4.9749755859375+
170  (69.649658203125+
171  (-162.515869140625+
172  (-1706.416625976563+
173  (1121.359497070313+
174  (14951.4599609375+
175  (-60072.83020019531+
176  (-20024.27673339844+
177  (120145.6604003906+
178  (63349.53002929688+
179  (-116140.8050537109+
180  (-75532.13195800781+
181  (43161.21826171875+31651.56005859375*v)*v)*v)*v)*v)*v)*v)*v*v)*v)*v)*v)*v)*v)*v;
182 
183  case 16:
184  return -1.327301025390625+
185  (-8.02978515625+
186  (40.323486328125+
187  (461.88720703125+
188  (-688.5540771484375+
189  (-7318.34619140625+
190  (2950.946044921875+
191  (49182.43408203125+
192  (4742.591857910156+
193  (-164409.8510742188+
194  (-61126.73950195313+
195  (286739.9780273438+
196  (155039.6392822266+
197  (-249123.5229492188+
198  (-162422.4792480469+
199  (84959.45068359375+61949.59945678711*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
200 
201  case 17:
202  return 1.408035278320313+
203  (-5.452835083007813+
204  (-81.0135498046875+
205  (238.8861083984375+
206  (2508.304138183594+
207  (-2508.304138183594+
208  (-28427.44689941406+
209  (6449.924926757813+
210  (153185.717010498+
211  (25978.86428833008+
212  (-436444.9200439453+
213  (-175711.5911865234+
214  (673561.0995483398+
215  (371697.5967407227+
216  (-530996.5667724609+
217  (-346917.7569580078+
218  (167263.9185333252+121348.3330535889*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
219 
220  case 18:
221  return -.6847000124835247+
222  (8.346176147460938+
223  (-49.9101333618164+
224  (-593.8026123046875+
225  (1151.772308349609+
226  (11824.86236572266+
227  (-8062.406158447265+
228  (-102277.3809814453+
229  (10020.4190826416+
230  (456485.7582092285+
231  (103544.3305206299+
232  (-1129574.514770508+
233  (-483206.8757629394+
234  (1561129.906311035+
235  (876144.3351745604+
236  (-1125712.721557617+
237  (-736757.7363967896+
238  (329374.0468597412+237881.2560653686*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_30_00_eval()
248 
249 
250 
251 
252 Real jacobi_30_00_eval_deriv(Real v, unsigned i)
253 {
254  libmesh_assert (-1.-1.e-5 <= v && v < 1.);
255 
256  switch (i)
257  {
258  case 0:
259  return 0.;
260 
261  case 1:
262  return 2.5;
263 
264  case 2:
265  return 10.5*v+4.5;
266 
267  case 3:
268  return (21.+31.5*v)*v;
269 
270  case 4:
271  return -5.5+
272  (-4.5+
273  (67.5+82.5*v)*v)*v;
274 
275  case 5:
276  return -1.40625+
277  (-39.375+
278  (-30.9375+
279  (185.625+201.09375*v)*v)*v)*v;
280 
281  case 6:
282  return 6.09375+
283  (-5.15625+
284  (-175.3125+
285  (-134.0625+
286  (469.21875+469.21875*v)*v)*v)*v)*v;
287 
288  case 7:
289  return 2.40625+
290  (57.75+
291  (-625.625+
292  (-469.21875+
293  (1126.125+1063.5625*v)*v)*v)*v*v)*v;
294 
295  case 8:
296  return -6.5625+
297  (17.0625+
298  (324.1875+
299  (85.3125+
300  (-1962.1875+
301  (-1450.3125+
302  (2610.5625+2361.9375*v)*v)*v)*v)*v)*v)*v;
303 
304  case 9:
305  return -3.19921875+
306  (-76.78125+
307  (63.984375+
308  (1407.65625+
309  (543.8671875+
310  (-5656.21875+
311  (-4133.390625+
312  (5904.84375+5166.73828125*v)*v)*v)*v)*v)*v)*v)*v;
313 
314  case 10:
315  return 6.97265625+
316  (-30.76171875+
317  (-516.796875+
318  (139.453125+
319  (5229.4921875+
320  (2384.6484375+
321  (-15367.734375+
322  (-11128.359375+
323  (13115.56640625+11172.51953125*v)*v)*v)*v)*v)*v)*v)*v)*v;
324 
325  case 11:
326  return 3.8671875+
327  (96.6796875+
328  (-164.35546875+
329  (-2629.6875+
330  (17487.421875+
331  (8743.7109375+
332  (-39971.25+
333  (-28729.3359375+
334  (28729.3359375+23941.11328125*v)*v)*v)*v)*v)*v*v)*v)*v)*v;
335 
336  case 12:
337  return -7.34765625+
338  (46.01953125+
339  (756.03515625+
340  (-624.55078125+
341  (-11241.9140625+
342  (-1748.7421875+
343  (54211.0078125+
344  (28729.3359375+
345  (-100552.67578125+
346  (-71823.33984375+
347  (62246.89453125+50929.27734375*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
348 
349  case 13:
350  return -4.4512939453125+
351  (-117.51416015625+
352  (304.468505859375+
353  (4397.87841796875+
354  (-1776.066284179688+
355  (-42625.59082031249+
356  (-10893.20654296875+
357  (158729.5810546875+
358  (87534.69543457031+
359  (-246393.9575195312+
360  (-175069.3908691406+
361  (133689.3530273438+107694.2010498047*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
362 
363  case 14:
364  return 7.6981201171875+
365  (-62.6846923828125+
366  (-1044.744873046875+
367  (1462.642822265625+
368  (21208.32092285156+
369  (-3364.078491210938+
370  (-148019.4536132813+
371  (-48058.26416015625+
372  (444538.9434814453+
373  (252305.8868408203+
374  (-591116.6491699219+
375  (-418106.8981933594+
376  (285072.8851318359+226596.3958740234*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
377 
378  case 15:
379  return 4.9749755859375+
380  (139.29931640625+
381  (-487.547607421875+
382  (-6825.66650390625+
383  (5606.797485351563+
384  (89708.759765625+
385  (-480582.6416015625+
386  (-180218.4906005859+
387  (1201456.604003906+
388  (696844.8303222656+
389  (-1393689.660644531+
390  (-981917.7154541016+
391  (604257.0556640625+474773.4008789063*v)*v)*v)*v)*v)*v)*v)*v*v)*v)*v)*v)*v)*v;
392 
393  case 16:
394  return -8.02978515625+
395  (80.64697265625+
396  (1385.66162109375+
397  (-2754.21630859375+
398  (-36591.73095703125+
399  (17705.67626953125+
400  (344277.0385742188+
401  (37940.73486328125+
402  (-1479688.659667969+
403  (-611267.3950195313+
404  (3154139.758300781+
405  (1860475.671386719+
406  (-3238605.798339844+
407  (-2273914.709472656+
408  (1274391.760253906+991193.5913085938*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
409 
410  case 17:
411  return -5.452835083007813+
412  (-162.027099609375+
413  (716.6583251953125+
414  (10033.21655273438+
415  (-12541.52069091797+
416  (-170564.6813964844+
417  (45149.47448730469+
418  (1225485.736083984+
419  (233809.7785949707+
420  (-4364449.200439453+
421  (-1932827.503051758+
422  (8082733.194580078+
423  (4832068.757629395+
424  (-7433951.934814453+
425  (-5203766.354370117+
426  (2676222.696533203+2062921.661911011*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
427 
428  case 18:
429  return 8.346176147460938+
430  (-99.8202667236328+
431  (-1781.407836914063+
432  (4607.089233398438+
433  (59124.31182861328+
434  (-48374.43695068359+
435  (-715941.6668701171+
436  (80163.35266113281+
437  (4108371.823883056+
438  (1035443.305206299+
439  (-12425319.66247559+
440  (-5798482.509155273+
441  (20294688.78204345+
442  (12266020.69244385+
443  (-16885690.82336426+
444  (-11788123.78234863+
445  (5599358.796615601+4281862.609176635*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v)*v;
446 
447 
448  default:
449  libmesh_error_msg("bad index i = " << i);
450  }
451 
452  libmesh_error_msg("We'll never get here!");
453  return 0.;
454 } // jacobi_30_00_eval_deriv()
455 
456 
457 } // anonymous namespace
458 
459 
460 
461  // Specialize the eval() function for 1, 2, and 3 dimensions and the CARTESIAN mapping type
462  // to call the local helper function from the anonymous namespace.
463 template <> Real InfFE<1,JACOBI_30_00,CARTESIAN>::eval(Real v, Order, unsigned i) { return jacobi_30_00_eval(v, i); }
464 template <> Real InfFE<2,JACOBI_30_00,CARTESIAN>::eval(Real v, Order, unsigned i) { return jacobi_30_00_eval(v, i); }
465 template <> Real InfFE<3,JACOBI_30_00,CARTESIAN>::eval(Real v, Order, unsigned i) { return jacobi_30_00_eval(v, i); }
466 
467 // Specialize the eval_deriv() function for 1, 2, and 3 dimensions and the CARTESIAN mapping type
468 // to call the local helper function from the anonymous namespace.
469 template <> Real InfFE<1,JACOBI_30_00,CARTESIAN>::eval_deriv(Real v, Order, unsigned i) { return jacobi_30_00_eval_deriv(v, i); }
470 template <> Real InfFE<2,JACOBI_30_00,CARTESIAN>::eval_deriv(Real v, Order, unsigned i) { return jacobi_30_00_eval_deriv(v, i); }
471 template <> Real InfFE<3,JACOBI_30_00,CARTESIAN>::eval_deriv(Real v, Order, unsigned i) { return jacobi_30_00_eval_deriv(v, i); }
472 
473 } // namespace libMesh
474 
475 #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