VTK  9.7.20260922
TetCnBasis.h
Go to the documentation of this file.
1// Bernstein-Bezier basis functions of arbitrary order on the reference
2// tetrahedron.
3//
4// This is the three-dimensional case of the construction described in
5// TriCnBasis.h: n! times a product of lambda_t^{b_t} / b_t! over the four
6// barycentric coordinates, selected by a multi-index summing to the order n and
7// enumerated with b1 (the r-axis) varying fastest.
8RealT nfact = 1.;
9for (int mm = 2; mm <= order[0]; ++mm)
10{
11 nfact *= RealT(mm);
12}
13
14WORKSPACE(RealT, bary, 4);
15bary[0] = 1. - rr - ss - tt;
16bary[1] = rr;
17bary[2] = ss;
18bary[3] = tt;
19
20WORKSPACE(RealT, wval, 4 * (order[0] + 1));
21for (int kk = 0; kk < 4; ++kk)
22{
23 int base = kk * (order[0] + 1);
24 wval[base] = 1.;
25 for (int mm = 1; mm <= order[0]; ++mm)
26 {
27 wval[base + mm] = wval[base + mm - 1] * bary[kk] / RealT(mm);
28 }
29}
30
31int idx = 0;
32for (int i3 = 0; i3 <= order[0]; ++i3)
33{
34 for (int i2 = 0; i2 <= order[0] - i3; ++i2)
35 {
36 for (int i1 = 0; i1 <= order[0] - i2 - i3; ++i1)
37 {
38 int i0 = order[0] - i1 - i2 - i3;
39 basis[idx++] = nfact * wval[i0] * wval[(order[0] + 1) + i1] * wval[2 * (order[0] + 1) + i2] *
40 wval[3 * (order[0] + 1) + i3];
41 }
42 }
43}
int idx
Definition HexCnBasis.h:79
WORKSPACE(RealT, bary, 4)
RealT nfact
Definition TetCnBasis.h:8
bary[0]
Definition TetCnBasis.h:15
basis[0]
Definition CellC0Basis.h:1