VTK
9.7.20261001
Main Page
Related Pages
Topics
Namespaces
Classes
Files
File List
File Members
Filters
CellGrid
Basis
HGrad
TriCnBasis.h
Go to the documentation of this file.
1
// Arbitrary-order Lagrange interpolants on the reference triangle.
2
//
3
// The Lagrange points form the principal lattice: those whose barycentric
4
// coordinates are all multiples of 1/n. Each interpolant is a product of
5
// Silvester polynomials, one per barycentric coordinate,
6
//
7
// P_m(x) = ∏_{a=0}^{m-1} (n x - a) / (m - a),
8
//
9
// selected by a multi-index (i0, i1, i2) of non-negative integers summing to
10
// the order n. P_m has degree m, so each interpolant has total degree n, and
11
// P_m(j/n) is 1 when j == m and 0 when j < m, which gives the Kronecker delta
12
// property, since two distinct multi-indices summing to n must have some
13
// component where the first is the larger.
14
//
15
// The multi-index is enumerated with i1 (the r-axis) varying fastest, matching
16
// the lexicographic convention the prismatic Cn bases use.
17
RealT
nn
= RealT(order[0]);
18
19
WORKSPACE
(RealT,
bary
, 3);
20
bary
[0] = 1. - rr - ss;
21
bary
[1] = rr;
22
bary
[2] = ss;
23
24
// Tabulate P_m for every barycentric coordinate and every degree up to n,
25
// using P_m(x) = P_{m-1}(x) * (n x - (m - 1)) / m.
26
WORKSPACE
(RealT, pval, 3 * (order[0] + 1));
27
for
(
int
kk = 0; kk < 3; ++kk)
28
{
29
int
base = kk * (order[0] + 1);
30
pval[base] = 1.;
31
for
(
int
mm = 1; mm <= order[0]; ++mm)
32
{
33
RealT rmm = RealT(mm);
34
pval[base + mm] = pval[base + mm - 1] * (
nn
*
bary
[kk] - (rmm - 1.)) / rmm;
35
}
36
}
37
38
int
idx
= 0;
39
for
(
int
i2 = 0; i2 <= order[0]; ++i2)
40
{
41
for
(
int
i1 = 0; i1 <= order[0] - i2; ++i1)
42
{
43
int
i0 = order[0] - i1 - i2;
44
basis
[
idx
++] = pval[i0] * pval[(order[0] + 1) + i1] * pval[2 * (order[0] + 1) + i2];
45
}
46
}
idx
int idx
Definition
HexCnBasis.h:79
bary
bary[0]
Definition
TetCnBasis.h:15
WORKSPACE
WORKSPACE(RealT, bary, 3)
basis
basis[0]
Definition
CellC0Basis.h:1
nn
RealT nn
Definition
TetCnBasis.h:7
Generated on
for VTK by
1.16.1