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

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:05 UTC

Hosted By:
SourceForge.net Logo