VTK  9.7.20261001
WdgCnBasis.h
Go to the documentation of this file.
1// Arbitrary-order Lagrange interpolants on the reference wedge.
2//
3// A wedge is the product of a triangle (the r- and s-axes) with an edge (the
4// t-axis), so its basis is the product of the triangle's Silvester polynomials
5// (see TriCnBasis.h) with the edge's 1-d Lagrange interpolants (see
6// EdgeCnBasis.h. The two factors may have different orders, but the triangle
7// has a single total degree shared by its two axes: order[0] is the order of
8// the triangular cross-section and order[2] the order along t.
9//
10// The degrees of freedom are enumerated with the r-axis varying fastest and t
11// slowest, so the triangle's degrees of freedom repeat once per t-node.
12RealT nn = RealT(order[0]);
13RealT invspcT = RealT(order[2]) / 2.;
14
15WORKSPACE(RealT, bary, 3);
16bary[0] = 1. - rr - ss;
17bary[1] = rr;
18bary[2] = ss;
19
20WORKSPACE(RealT, pval, 3 * (order[0] + 1));
21for (int kk = 0; kk < 3; ++kk)
22{
23 int base = kk * (order[0] + 1);
24 pval[base] = 1.;
25 for (int mm = 1; mm <= order[0]; ++mm)
26 {
27 RealT rmm = RealT(mm);
28 pval[base + mm] = pval[base + mm - 1] * (nn * bary[kk] - (rmm - 1.)) / rmm;
29 }
30}
31
32WORKSPACE(RealT, ttmp, order[2] + 1);
33for (int ll = 0; ll <= order[2]; ++ll)
34{
35 ttmp[ll] = 1.;
36 for (int oo = 0; oo <= order[2]; ++oo)
37 {
38 if (oo == ll)
39 {
40 continue;
41 }
42 ttmp[ll] *= (tt * invspcT - (RealT(oo) - invspcT)) / RealT(ll - oo);
43 }
44}
45
46int idx = 0;
47for (int it = 0; it <= order[2]; ++it)
48{
49 for (int i2 = 0; i2 <= order[0]; ++i2)
50 {
51 for (int i1 = 0; i1 <= order[0] - i2; ++i1)
52 {
53 int i0 = order[0] - i1 - i2;
54 basis[idx++] =
55 pval[i0] * pval[(order[0] + 1) + i1] * pval[2 * (order[0] + 1) + i2] * ttmp[it];
56 }
57 }
58}
int idx
Definition HexCnBasis.h:79
bary[0]
Definition TetCnBasis.h:15
WORKSPACE(RealT, bary, 3)
basis[0]
Definition CellC0Basis.h:1
RealT invspcT
Definition HexCnBasis.h:8
RealT nn
Definition TetCnBasis.h:7