VTK  9.7.20260922
QuadCnBasis.h
Go to the documentation of this file.
1// Bernstein-Bezier basis functions of arbitrary order on the reference quadrilateral.
2//
3// The basis is the tensor product of the 1-d Bernstein polynomials along each
4// parametric axis; see EdgeCnBasis.h for their definition and for why the
5// powers and binomial coefficients are accumulated rather than computed with
6// pow(). The order along each axis is independent.
7WORKSPACE(RealT, rtmp, order[0] + 1);
8WORKSPACE(RealT, stmp, order[1] + 1);
9
10{
11 RealT xx = 0.5 * (rr + 1.);
12 RealT yy = 1. - xx;
13 WORKSPACE(RealT, xpow, order[0] + 1);
14 WORKSPACE(RealT, ypow, order[0] + 1);
15 xpow[0] = 1.;
16 for (int kk = 1; kk <= order[0]; ++kk)
17 {
18 xpow[kk] = xpow[kk - 1] * xx;
19 }
20 ypow[order[0]] = 1.;
21 for (int kk = order[0] - 1; kk >= 0; --kk)
22 {
23 ypow[kk] = ypow[kk + 1] * yy;
24 }
25 RealT coeff = 1.;
26 for (int kk = 0; kk <= order[0]; ++kk)
27 {
28 rtmp[kk] = coeff * xpow[kk] * ypow[kk];
29 coeff = coeff * RealT(order[0] - kk) / RealT(kk + 1);
30 }
31}
32{
33 RealT xx = 0.5 * (ss + 1.);
34 RealT yy = 1. - xx;
35 WORKSPACE(RealT, xpow, order[1] + 1);
36 WORKSPACE(RealT, ypow, order[1] + 1);
37 xpow[0] = 1.;
38 for (int kk = 1; kk <= order[1]; ++kk)
39 {
40 xpow[kk] = xpow[kk - 1] * xx;
41 }
42 ypow[order[1]] = 1.;
43 for (int kk = order[1] - 1; kk >= 0; --kk)
44 {
45 ypow[kk] = ypow[kk + 1] * yy;
46 }
47 RealT coeff = 1.;
48 for (int kk = 0; kk <= order[1]; ++kk)
49 {
50 stmp[kk] = coeff * xpow[kk] * ypow[kk];
51 coeff = coeff * RealT(order[1] - kk) / RealT(kk + 1);
52 }
53}
54
55// Compute the tensor product of the 1-dimensional basis functions:
56int idx = 0;
57for (int pp = 0; pp <= order[1]; ++pp)
58{
59 for (int oo = 0; oo <= order[0]; ++oo)
60 {
61 basis[idx++] = rtmp[oo] * stmp[pp];
62 }
63}
ypow[order[0]]
Definition EdgeCnBasis.h:27
xpow[0]
Definition EdgeCnBasis.h:22
RealT xx
Definition EdgeCnBasis.h:16
RealT coeff
Definition EdgeCnBasis.h:34
RealT yy
Definition EdgeCnBasis.h:17
int idx
Definition HexCnBasis.h:79
WORKSPACE(RealT, rtmp, order[0]+1)
basis[0]
Definition CellC0Basis.h:1
@ order
Definition vtkX3D.h:441