VTK  9.7.20261001
QuadCnBasis.h
Go to the documentation of this file.
1// Arbitrary-order Lagrange interpolants on the reference quadrilateral.
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- and s-axes need not match.
6RealT invspcR = RealT(order[0]) / 2.;
7RealT invspcS = RealT(order[1]) / 2.;
8
9WORKSPACE(RealT, rtmp, order[0] + 1);
10WORKSPACE(RealT, stmp, order[1] + 1);
11
12for (int ll = 0; ll <= order[0]; ++ll)
13{
14 rtmp[ll] = 1.;
15 for (int oo = 0; oo <= order[0]; ++oo)
16 {
17 if (oo == ll)
18 {
19 continue;
20 }
21 rtmp[ll] *= (rr * invspcR - (RealT(oo) - invspcR)) / RealT(ll - oo);
22 }
23}
24
25for (int mm = 0; mm <= order[1]; ++mm)
26{
27 stmp[mm] = 1.;
28 for (int oo = 0; oo <= order[1]; ++oo)
29 {
30 if (oo == mm)
31 {
32 continue;
33 }
34 stmp[mm] *= (ss * invspcS - (RealT(oo) - invspcS)) / RealT(mm - oo);
35 }
36}
37
38// Compute the tensor product of the 1-dimensional basis functions:
39int idx = 0;
40for (int mm = 0; mm <= order[1]; ++mm)
41{
42 for (int ll = 0; ll <= order[0]; ++ll)
43 {
44 basis[idx++] = rtmp[ll] * stmp[mm];
45 }
46}
int idx
Definition HexCnBasis.h:79
WORKSPACE(RealT, rtmp, order[0]+1)
basis[0]
Definition CellC0Basis.h:1
RealT invspcR
Definition HexCnBasis.h:6
RealT invspcS
Definition HexCnBasis.h:7
@ order
Definition vtkX3D.h:441