VTK  9.4.20241010
PyrC2Basis.h
Go to the documentation of this file.
1const RealT ZERO = 0.;
2const RealT HALF = 0.5;
3const RealT FOURTH = 0.25;
4const RealT NINTH = 1. / 9.;
5const RealT FOURNINTHS = 4. / 9.;
6const RealT ONE = 1.;
7const RealT TWO = 2.;
8const RealT EIGHT = 9.;
9const RealT TWENTYSEVEN = 27.;
10
11const RealT K1 = -FOURTH;
12const RealT K5 = ONE;
13const RealT K6 = -HALF;
14const RealT K10 = -ONE;
15const RealT K14 = ONE;
16const RealT K15A = TWENTYSEVEN / EIGHT;
17const RealT K15B = -TWENTYSEVEN / EIGHT;
18
19// Evaluate common rr,ss,tt multiplication terms
20RealT r2 = rr * rr;
21RealT s2 = ss * ss;
22RealT t2 = tt * tt;
23RealT rs = rr * ss;
24RealT rt = rr * tt;
25RealT st = ss * tt;
26RealT r2s = r2 * ss;
27RealT r2t = r2 * tt;
28RealT rs2 = rr * s2;
29RealT s2t = s2 * tt;
30RealT rt2 = rr * t2;
31RealT st2 = ss * t2;
32RealT r2s2 = r2 * s2;
33
34// Evaluate numerical values of (tt-1), (tt-1)^2, (tt-1)^3, and (tt-1)^4
35RealT tm = tt - ONE;
36RealT tm2 = tm * tm;
37
38// Evaluate numerical value of 1/(tt-1)
39RealT mt = abs(tm) > eps ? ONE / tm : ZERO;
40RealT m2t = abs(tm2) > eps ? ONE / tm2 : ZERO;
41
42// Baseline shape functions:
43basis[0] = K1 * (rr + ss - ONE) * (rs * mt - rr - ss + tt - ONE);
44basis[1] = K1 * (-rr + ss - ONE) * (-rs * mt + rr - ss + tt - ONE);
45basis[2] = K1 * (-rr - ss - ONE) * (rs * mt + rr + ss + tt - ONE);
46basis[3] = K1 * (rr - ss - ONE) * (-rs * mt - rr + ss + tt - ONE);
47basis[4] = K5 * (-tt + TWO * t2);
48basis[5] = K6 * (-r2s * mt + r2 + st - ss - tm2);
49basis[6] = K6 * (rs2 * mt - rt + rr + s2 - tm2);
50basis[7] = K6 * (r2s * mt + r2 - st + ss - tm2);
51basis[8] = K6 * (-rs2 * mt + rt - rr + s2 - tm2);
52basis[9] = K10 * (rs + rs * mt - rt - st - tt + t2);
53basis[10] = K10 * (-rs - rs * mt + rt - st - tt + t2);
54basis[11] = K10 * (rs + rs * mt + rt + st - tt + t2);
55basis[12] = K10 * (-rs - rs * mt - rt + st - tt + t2);
56basis[13] = K14 * (r2s2 * m2t - r2 - s2 + tm2);
57basis[14] = K15A * (r2s + r2s * mt - r2s2 * mt - r2s2 * m2t + st - st2 + s2t);
58basis[15] = K15B * (rs2 + rs2 * mt + rt - rt2 + r2s2 * mt + r2s2 * m2t - r2t);
59basis[16] = K15B * (r2s + r2s * mt + r2s2 * mt + r2s2 * m2t + st - st2 - s2t);
60basis[17] = K15A * (rs2 + rs2 * mt + rt - rt2 - r2s2 * mt - r2s2 * m2t + r2t);
61
62// MODIFICATIONS TO H
63
64basis[0] = basis[0] + FOURTH * basis[13] + NINTH * (basis[14] + basis[17]);
65basis[1] = basis[1] + FOURTH * basis[13] + NINTH * (basis[14] + basis[15]);
66basis[2] = basis[2] + FOURTH * basis[13] + NINTH * (basis[15] + basis[16]);
67basis[3] = basis[3] + FOURTH * basis[13] + NINTH * (basis[16] + basis[17]);
68basis[4] = basis[4] + NINTH * (basis[14] + basis[15] + basis[16] + basis[17]);
69basis[5] = basis[5] - FOURNINTHS * basis[14] - basis[13] * HALF;
70basis[6] = basis[6] - FOURNINTHS * basis[15] - basis[13] * HALF;
71basis[7] = basis[7] - FOURNINTHS * basis[16] - basis[13] * HALF;
72basis[8] = basis[8] - FOURNINTHS * basis[17] - basis[13] * HALF;
73basis[9] = basis[9] - FOURNINTHS * (basis[14] + basis[17]);
74basis[10] = basis[10] - FOURNINTHS * (basis[14] + basis[15]);
75basis[11] = basis[11] - FOURNINTHS * (basis[15] + basis[16]);
76basis[12] = basis[12] - FOURNINTHS * (basis[16] + basis[17]);
const RealT K1
Definition PyrC2Basis.h:11
RealT r2
Definition PyrC2Basis.h:20
const RealT K14
Definition PyrC2Basis.h:15
RealT m2t
Definition PyrC2Basis.h:40
RealT rt2
Definition PyrC2Basis.h:30
RealT st
Definition PyrC2Basis.h:25
const RealT K5
Definition PyrC2Basis.h:12
RealT r2s2
Definition PyrC2Basis.h:32
const RealT NINTH
Definition PyrC2Basis.h:4
const RealT EIGHT
Definition PyrC2Basis.h:8
const RealT K15A
Definition PyrC2Basis.h:16
const RealT FOURTH
Definition PyrC2Basis.h:3
RealT t2
Definition PyrC2Basis.h:22
RealT tm
Definition PyrC2Basis.h:35
RealT rs2
Definition PyrC2Basis.h:28
RealT tm2
Definition PyrC2Basis.h:36
const RealT TWENTYSEVEN
Definition PyrC2Basis.h:9
const RealT TWO
Definition PyrC2Basis.h:7
RealT r2s
Definition PyrC2Basis.h:26
const RealT ONE
Definition PyrC2Basis.h:6
basis[0]
Definition PyrC2Basis.h:43
const RealT K15B
Definition PyrC2Basis.h:17
RealT s2
Definition PyrC2Basis.h:21
RealT s2t
Definition PyrC2Basis.h:29
RealT st2
Definition PyrC2Basis.h:31
const RealT ZERO
Definition PyrC2Basis.h:1
RealT r2t
Definition PyrC2Basis.h:27
RealT mt
Definition PyrC2Basis.h:39
const RealT K6
Definition PyrC2Basis.h:13
const RealT HALF
Definition PyrC2Basis.h:2
const RealT FOURNINTHS
Definition PyrC2Basis.h:5
RealT rt
Definition PyrC2Basis.h:24
const RealT K10
Definition PyrC2Basis.h:14
RealT rs
Definition PyrC2Basis.h:23