conspire/domain/fem/block/element/linear/tetrahedron/
mod.rs1const G: usize = 1;
2const N: usize = 4;
3
4pub type Tetrahedron = Element<G, N>;
5
6crate::fem::block::element::linear::implement!(Tetrahedron);
7
8impl Tetrahedron {
9 const fn integration_points() -> [[Scalar; M]; G] {
10 [[0.25; M]]
11 }
12 const fn integration_weight() -> Scalars<G> {
13 Scalars::<G>::const_from([1.0 / 6.0])
14 }
15 const fn reference() -> ElementNodalReferenceCoordinates<N> {
16 ElementNodalReferenceCoordinates::<N>::const_from([
17 [0.0, 0.0, 0.0],
18 [1.0, 0.0, 0.0],
19 [0.0, 1.0, 0.0],
20 [0.0, 0.0, 1.0],
21 ])
22 }
23 #[cfg(test)]
24 const fn shape_functions([xi_1, xi_2, xi_3]: [Scalar; M]) -> [Scalar; N] {
25 [1.0 - xi_1 - xi_2 - xi_3, xi_1, xi_2, xi_3]
26 }
27 const fn shape_functions_gradients([_xi_1, _xi_2, _xi_3]: [Scalar; M]) -> [[Scalar; M]; N] {
28 [
29 [-1.0, -1.0, -1.0],
30 [1.0, 0.0, 0.0],
31 [0.0, 1.0, 0.0],
32 [0.0, 0.0, 1.0],
33 ]
34 }
35}