VTK  9.7.20261001
HexCnBasis.h
Go to the documentation of this file.
1// Arbitrary-order Lagrange interpolants on the reference hexahedron.
2//
3// The basis is the tensor product of the 1-d interpolants along each
4// parametric axis; see EdgeCnBasis.h for their definition. The order along
5// the r-, s- and t-axes need not match.
6RealT invspcR = RealT(order[0]) / 2.;
7RealT invspcS = RealT(order[1]) / 2.;
8RealT invspcT = RealT(order[2]) / 2.;
9
10WORKSPACE(RealT, rtmp, order[0] + 1);
11WORKSPACE(RealT, stmp, order[1] + 1);
12WORKSPACE(RealT, ttmp, order[2] + 1);
13
14for (int ll = 0; ll <= order[0]; ++ll)
15{
16 rtmp[ll] = 1.;
17 for (int oo = 0; oo <= order[0]; ++oo)
18 {
19 if (oo == ll)
20 {
21 continue;
22 }
23 rtmp[ll] *= (rr * invspcR - (RealT(oo) - invspcR)) / RealT(ll - oo);
24 }
25}
26
27for (int mm = 0; mm <= order[1]; ++mm)
28{
29 stmp[mm] = 1.;
30 for (int oo = 0; oo <= order[1]; ++oo)
31 {
32 if (oo == mm)
33 {
34 continue;
35 }
36 stmp[mm] *= (ss * invspcS - (RealT(oo) - invspcS)) / RealT(mm - oo);
37 }
38}
39
40for (int nn = 0; nn <= order[2]; ++nn)
41{
42 ttmp[nn] = 1.;
43 for (int oo = 0; oo <= order[2]; ++oo)
44 {
45 if (oo == nn)
46 {
47 continue;
48 }
49 ttmp[nn] *= (tt * invspcT - (RealT(oo) - invspcT)) / RealT(nn - oo);
50 }
51}
52
53// Compute the tensor product of the 1-dimensional basis functions:
54int idx = 0;
55for (int nn = 0; nn <= order[2]; ++nn)
56{
57 for (int mm = 0; mm <= order[1]; ++mm)
58 {
59 for (int ll = 0; ll <= order[0]; ++ll)
60 {
61 basis[idx++] = rtmp[ll] * stmp[mm] * ttmp[nn];
62 }
63 }
64}
int idx
Definition HexCnBasis.h:79
WORKSPACE(RealT, rtmp, order[0]+1)
basis[0]
Definition CellC0Basis.h:1
RealT invspcT
Definition HexCnBasis.h:8
RealT invspcR
Definition HexCnBasis.h:6
RealT invspcS
Definition HexCnBasis.h:7
RealT nn
Definition TetCnBasis.h:7
@ order
Definition vtkX3D.h:441