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