VTK  9.7.1
PyrF2Gradient.h
Go to the documentation of this file.
1 const RealT HALF = 0.5;
2 const RealT ONE = 1.;
3 const RealT ZERO = 0.;
4 const RealT TWO = 2.;
5 const RealT THREE = 3.;
6 const RealT FOUR = 4.;
7 const RealT SIXTEENTHIRDS = 16. / 3.;
8 const RealT EIGHT = 8.;
9 const RealT TWENTYSEVEN = 27.;
10 const RealT FOURTH = 0.25;
11 const RealT NINTH = 1. / 9.;
12 const RealT THREESIXTYFOURTHS = 3. / 64.;
13 const RealT EIGHTH = 1. / 8.;
14 const RealT FOURNINTHS = 4. / 9.;
15 const RealT THREESIXTEENTHS = 3. / 16.;
16 const RealT NINESIXTEENTHS = 9. / 16.;
17 
18 const RealT K1 = -0.25;
19 const RealT K5 = ONE;
20 const RealT K6 = -HALF;
21 const RealT K10 = -ONE;
22 const RealT K14 = ONE;
23 const RealT K15A = TWENTYSEVEN / EIGHT;
24 const RealT K15B = -TWENTYSEVEN / EIGHT;
25 const RealT K19 = -SIXTEENTHIRDS;
26 
27 RealT r2 = rr * rr;
28 RealT s2 = ss * ss;
29 RealT t2 = tt * tt;
30 RealT rs = rr * ss;
31 RealT rt = rr * tt;
32 RealT st = ss * tt;
33 RealT r2s = r2 * ss;
34 RealT rs2 = rr * s2;
35 RealT r2s2 = r2 * s2;
36 
37 RealT tm = tt - ONE;
38 RealT tm2 = tm * tm;
39 RealT tm3 = tm2 * tm;
40 RealT tm4 = tm3 * tm;
41 
42 // Be sure that the basis functions are defined when tt is very close to 1.
43 RealT mt = abs(tm) > eps ? ONE / tm : ZERO;
44 RealT m2t = abs(tm2) > eps ? ONE / tm2 : ZERO;
45 RealT m3t = abs(tm3) > eps ? ONE / tm3 : ZERO;
46 RealT m4t = abs(tm4) > eps ? ONE / tm4 : ZERO;
47 
48 basisGradient[0] = K1 * (rs * mt - rr - ss + tt + (ss * mt - ONE) * (rr + ss - ONE) - ONE);
49 basisGradient[1] = K1 * (rs * mt - rr - ss + tt + (rr * mt - ONE) * (rr + ss - ONE) - ONE);
50 basisGradient[2] = K1 * (-rs * m2t + ONE) * (rr + ss - ONE);
51 
52 basisGradient[3] = K1 * (rs * mt - rr + ss - tt + (-ss * mt + ONE) * (-rr + ss - ONE) + ONE);
53 basisGradient[4] = K1 * (-rs * mt + rr - ss + tt + (-rr * mt - ONE) * (-rr + ss - ONE) - ONE);
54 basisGradient[5] = K1 * (rs * m2t + ONE) * (-rr + ss - ONE);
55 
56 basisGradient[6] = K1 * (-rs * mt - rr - ss - tt + (ss * mt + ONE) * (-rr - ss - ONE) + ONE);
57 basisGradient[7] = K1 * (-rs * mt - rr - ss - tt + (rr * mt + ONE) * (-rr - ss - ONE) + ONE);
58 basisGradient[8] = K1 * (-rs * m2t + ONE) * (-rr - ss - ONE);
59 
60 basisGradient[9] = K1 * (-rs * mt - rr + ss + tt + (-ss * mt - ONE) * (rr - ss - ONE) - ONE);
61 basisGradient[10] = K1 * (rs * mt + rr - ss - tt + (-rr * mt + ONE) * (rr - ss - ONE) + ONE);
62 basisGradient[11] = K1 * (rs * m2t + ONE) * (rr - ss - ONE);
63 
64 basisGradient[12] = ZERO;
65 basisGradient[13] = ZERO;
66 basisGradient[14] = K5 * (FOUR * tt - ONE);
67 
68 basisGradient[15] = K6 * (-TWO * rs * mt + TWO * rr);
69 basisGradient[16] = K6 * (-r2 * mt + tt - ONE);
70 basisGradient[17] = K6 * (r2s * m2t + ss - TWO * tt + TWO);
71 
72 basisGradient[18] = K6 * (s2 * mt - tt + ONE);
73 basisGradient[19] = K6 * (TWO * rs * mt + TWO * ss);
74 basisGradient[20] = K6 * (-rs2 * m2t - rr - TWO * tt + TWO);
75 
76 basisGradient[21] = K6 * (TWO * rs * mt + TWO * rr);
77 basisGradient[22] = K6 * (r2 * mt - tt + ONE);
78 basisGradient[23] = K6 * (-r2s * m2t - ss - TWO * tt + TWO);
79 
80 basisGradient[24] = K6 * (-s2 * mt + tt - ONE);
81 basisGradient[25] = K6 * (-TWO * rs * mt + TWO * ss);
82 basisGradient[26] = K6 * (rs2 * m2t + rr - TWO * tt + TWO);
83 
84 basisGradient[27] = K10 * (ss + ss * mt - tt);
85 basisGradient[28] = K10 * (rr + rr * mt - tt);
86 basisGradient[29] = K10 * (-rs * m2t - rr - ss + TWO * tt - ONE);
87 
88 basisGradient[30] = K10 * (-ss - ss * mt + tt);
89 basisGradient[31] = K10 * (-rr - rr * mt - tt);
90 basisGradient[32] = K10 * (rs * m2t + rr - ss + TWO * tt - ONE);
91 
92 basisGradient[33] = K10 * (ss + ss * mt + tt);
93 basisGradient[34] = K10 * (rr + rr * mt + tt);
94 basisGradient[35] = K10 * (-rs * m2t + rr + ss + TWO * tt - ONE);
95 
96 basisGradient[36] = K10 * (-ss - ss * mt - tt);
97 basisGradient[37] = K10 * (-rr - rr * mt + tt);
98 basisGradient[38] = K10 * (rs * m2t - rr + ss + TWO * tt - ONE);
99 
100 basisGradient[39] = K14 * (TWO * rs2 * m2t - TWO * rr);
101 basisGradient[40] = K14 * (TWO * r2s * m2t - TWO * ss);
102 basisGradient[41] = K14 * (-TWO * r2s2 * m3t + TWO * tt - TWO);
103 
104 basisGradient[42] = K15A * (TWO * rs + TWO * rs * mt - TWO * rs2 * mt - TWO * rs2 * m2t);
105 basisGradient[43] = K15A * (-TWO * r2s * mt - TWO * r2s * m2t + r2 + r2 * mt + TWO * st + tt - t2);
106 basisGradient[44] =
107  K15A * (-r2s * m2t - r2s2 * (-TWO * tt + TWO) * m4t + r2s2 * m2t - TWO * st + ss + s2);
108 
109 basisGradient[45] = K15B * (TWO * rs2 * mt + TWO * rs2 * m2t - TWO * rt + s2 + s2 * mt + tt - t2);
110 basisGradient[46] = K15B * (TWO * rs + TWO * rs * mt + TWO * r2s * mt + TWO * r2s * m2t);
111 basisGradient[47] =
112  K15B * (-rs2 * m2t - TWO * rt + rr + r2s2 * (-TWO * tt + TWO) * m4t - r2s2 * m2t - r2);
113 
114 basisGradient[48] = K15B * (TWO * rs + TWO * rs * mt + TWO * rs2 * mt + TWO * rs2 * m2t);
115 basisGradient[49] = K15B * (TWO * r2s * mt + TWO * r2s * m2t + r2 + r2 * mt - TWO * st + tt - t2);
116 basisGradient[50] =
117  K15B * (-r2s * m2t + r2s2 * (-TWO * tt + TWO) * m4t - r2s2 * m2t - TWO * st + ss - s2);
118 
119 basisGradient[51] = K15A * (-TWO * rs2 * mt - TWO * rs2 * m2t + TWO * rt + s2 + s2 * mt + tt - t2);
120 basisGradient[52] = K15A * (TWO * rs + TWO * rs * mt - TWO * r2s * mt - TWO * r2s * m2t);
121 basisGradient[53] =
122  K15A * (-rs2 * m2t - TWO * rt + rr - r2s2 * (-TWO * tt + TWO) * m4t + r2s2 * m2t + r2);
123 
124 basisGradient[54] = K19 * (TWO * rs2 * m2t + TWO * rs2 * m3t - TWO * rr - TWO * rr * mt);
125 basisGradient[55] = K19 * (TWO * r2s * m2t + TWO * r2s * m3t - TWO * ss - TWO * ss * mt);
126 basisGradient[56] =
127  K19 * (-TWO * r2s2 * m3t - THREE * r2s2 * m4t + r2 * m2t + s2 * m2t + TWO * tt - ONE);
128 
129 // MODIFICATIONS TO d/dr(basis)
130 
140  NINTH * (basisGradient[42] + basisGradient[45] + basisGradient[48] + basisGradient[51]);
146  FOURNINTHS * (-basisGradient[42] - basisGradient[51]);
148  FOURNINTHS * (-basisGradient[42] - basisGradient[45]);
150  FOURNINTHS * (-basisGradient[45] - basisGradient[48]);
152  FOURNINTHS * (-basisGradient[48] - basisGradient[51]);
154 
155 // MODIFICATIONS TO d/ds(basis)
156 
166  NINTH * (basisGradient[43] + basisGradient[46] + basisGradient[49] + basisGradient[52]);
172  FOURNINTHS * (-basisGradient[43] - basisGradient[52]);
174  FOURNINTHS * (-basisGradient[43] - basisGradient[46]);
176  FOURNINTHS * (-basisGradient[46] - basisGradient[49]);
178  FOURNINTHS * (-basisGradient[49] - basisGradient[52]);
180 
181 // MODIFICATIONS TO d/dt(basis)
182 
192  NINTH * (basisGradient[44] + basisGradient[47] + basisGradient[50] + basisGradient[53]);
198  FOURNINTHS * (-basisGradient[44] - basisGradient[53]);
200  FOURNINTHS * (-basisGradient[44] - basisGradient[47]);
202  FOURNINTHS * (-basisGradient[47] - basisGradient[50]);
204  FOURNINTHS * (-basisGradient[50] - basisGradient[53]);
const RealT K15B
Definition: PyrF2Gradient.h:24
const RealT ZERO
Definition: PyrF2Gradient.h:3
RealT tm
Definition: PyrF2Gradient.h:37
RealT tm4
Definition: PyrF2Gradient.h:40
const RealT EIGHTH
Definition: PyrF2Gradient.h:13
RealT rt
Definition: PyrF2Gradient.h:31
RealT rs
Definition: PyrF2Gradient.h:30
RealT st
Definition: PyrF2Gradient.h:32
const RealT TWENTYSEVEN
Definition: PyrF2Gradient.h:9
const RealT TWO
Definition: PyrF2Gradient.h:4
RealT m2t
Definition: PyrF2Gradient.h:44
const RealT FOURTH
Definition: PyrF2Gradient.h:10
const RealT ONE
Definition: PyrF2Gradient.h:2
RealT mt
Definition: PyrF2Gradient.h:43
const RealT FOUR
Definition: PyrF2Gradient.h:6
const RealT K19
Definition: PyrF2Gradient.h:25
const RealT K14
Definition: PyrF2Gradient.h:22
RealT m4t
Definition: PyrF2Gradient.h:46
const RealT NINESIXTEENTHS
Definition: PyrF2Gradient.h:16
RealT s2
Definition: PyrF2Gradient.h:28
basisGradient[0]
Definition: PyrF2Gradient.h:48
const RealT K1
Definition: PyrF2Gradient.h:18
RealT r2
Definition: PyrF2Gradient.h:27
const RealT THREE
Definition: PyrF2Gradient.h:5
RealT r2s2
Definition: PyrF2Gradient.h:35
const RealT SIXTEENTHIRDS
Definition: PyrF2Gradient.h:7
const RealT FOURNINTHS
Definition: PyrF2Gradient.h:14
RealT tm2
Definition: PyrF2Gradient.h:38
RealT m3t
Definition: PyrF2Gradient.h:45
const RealT K5
Definition: PyrF2Gradient.h:19
RealT rs2
Definition: PyrF2Gradient.h:34
const RealT THREESIXTYFOURTHS
Definition: PyrF2Gradient.h:12
const RealT NINTH
Definition: PyrF2Gradient.h:11
const RealT K15A
Definition: PyrF2Gradient.h:23
RealT t2
Definition: PyrF2Gradient.h:29
const RealT K6
Definition: PyrF2Gradient.h:20
const RealT THREESIXTEENTHS
Definition: PyrF2Gradient.h:15
RealT r2s
Definition: PyrF2Gradient.h:33
RealT tm3
Definition: PyrF2Gradient.h:39
const RealT HALF
Definition: PyrF2Gradient.h:1
const RealT K10
Definition: PyrF2Gradient.h:21
const RealT EIGHT
Definition: PyrF2Gradient.h:8