conspire/domain/fem/block/element/linear/wedge/
mod.rs

1const G: usize = 6;
2const N: usize = 6;
3
4pub type Wedge = Element<G, N>;
5
6crate::fem::block::element::linear::implement!(Wedge);
7
8use super::FRAC_1_SQRT_3;
9
10impl Wedge {
11    const fn integration_points() -> [[Scalar; M]; G] {
12        [
13            [1.0 / 6.0, 1.0 / 6.0, -FRAC_1_SQRT_3],
14            [2.0 / 3.0, 1.0 / 6.0, -FRAC_1_SQRT_3],
15            [1.0 / 6.0, 2.0 / 3.0, -FRAC_1_SQRT_3],
16            [1.0 / 6.0, 1.0 / 6.0, FRAC_1_SQRT_3],
17            [2.0 / 3.0, 1.0 / 6.0, FRAC_1_SQRT_3],
18            [1.0 / 6.0, 2.0 / 3.0, FRAC_1_SQRT_3],
19        ]
20    }
21    const fn integration_weight() -> Scalars<G> {
22        Scalars::<G>::const_from([1.0 / 6.0; G])
23    }
24    const fn reference() -> ElementNodalReferenceCoordinates<N> {
25        ElementNodalReferenceCoordinates::<N>::const_from([
26            [0.0, 0.0, 0.0],
27            [1.0, 0.0, 0.0],
28            [0.0, 1.0, 0.0],
29            [0.0, 0.0, 1.0],
30            [1.0, 0.0, 1.0],
31            [0.0, 1.0, 1.0],
32        ])
33    }
34    #[cfg(test)]
35    const fn shape_functions([xi_1, xi_2, xi_3]: [Scalar; M]) -> [Scalar; N] {
36        [
37            (1.0 - xi_1 - xi_2) * (1.0 - xi_3) / 2.0,
38            xi_1 * (1.0 - xi_3) / 2.0,
39            xi_2 * (1.0 - xi_3) / 2.0,
40            (1.0 - xi_1 - xi_2) * (1.0 + xi_3) / 2.0,
41            xi_1 * (1.0 + xi_3) / 2.0,
42            xi_2 * (1.0 + xi_3) / 2.0,
43        ]
44    }
45    const fn shape_functions_gradients([xi_1, xi_2, xi_3]: [Scalar; M]) -> [[Scalar; M]; N] {
46        [
47            [
48                -(1.0 - xi_3) / 2.0,
49                -(1.0 - xi_3) / 2.0,
50                -(1.0 - xi_1 - xi_2) / 2.0,
51            ],
52            [(1.0 - xi_3) / 2.0, 0.0, -xi_1 / 2.0],
53            [0.0, (1.0 - xi_3) / 2.0, -xi_2 / 2.0],
54            [
55                -(1.0 + xi_3) / 2.0,
56                -(1.0 + xi_3) / 2.0,
57                (1.0 - xi_1 - xi_2) / 2.0,
58            ],
59            [(1.0 + xi_3) / 2.0, 0.0, xi_1 / 2.0],
60            [0.0, (1.0 + xi_3) / 2.0, xi_2 / 2.0],
61        ]
62    }
63}