conspire/domain/fem/block/element/cohesive/linear/hexahedron/
mod.rs1#[cfg(test)]
2pub mod test;
3
4use crate::{
5 fem::block::element::{
6 ElementNodalCoordinates, ElementNodalEitherCoordinates, ElementNodalReferenceCoordinates,
7 FiniteElement, ParametricCoordinate, ParametricCoordinates, ParametricReference,
8 ShapeFunctions, ShapeFunctionsGradients,
9 cohesive::{
10 CohesiveFiniteElement, M, Separations,
11 linear::{LinearCohesiveElement, LinearCohesiveFiniteElement},
12 },
13 surface::linear::Quadrilateral,
14 },
15 math::ScalarList,
16 mechanics::NormalGradients,
17};
18
19const G: usize = 4;
20const N: usize = 8;
21const P: usize = 4;
22
23pub type Hexahedron = LinearCohesiveElement<G, N>;
24
25impl FiniteElement<G, M, N, P> for Hexahedron {
26 fn integration_points() -> ParametricCoordinates<G, M> {
27 Quadrilateral::integration_points()
28 }
29 fn integration_weights(&self) -> &ScalarList<G> {
30 &self.integration_weights
31 }
32 fn parametric_reference() -> ParametricReference<M, N> {
33 Quadrilateral::parametric_reference()
34 .into_iter()
35 .chain(Quadrilateral::parametric_reference())
36 .collect()
37 }
38 fn parametric_weights() -> ScalarList<G> {
39 Quadrilateral::parametric_weights()
40 }
41 fn scaled_jacobians<const I: usize>(
42 nodal_coordinates: ElementNodalEitherCoordinates<I, N>,
43 ) -> ScalarList<P> {
44 Quadrilateral::scaled_jacobians(Self::nodal_mid_surface(&nodal_coordinates))
45 }
46 fn shape_functions(parametric_coordinate: ParametricCoordinate<M>) -> ShapeFunctions<P> {
47 Quadrilateral::shape_functions(parametric_coordinate)
48 }
49 fn shape_functions_gradients(
50 parametric_coordinate: ParametricCoordinate<M>,
51 ) -> ShapeFunctionsGradients<M, P> {
52 Quadrilateral::shape_functions_gradients(parametric_coordinate)
53 }
54}
55
56impl From<ElementNodalReferenceCoordinates<N>> for Hexahedron {
57 fn from(reference_nodal_coordinates: ElementNodalReferenceCoordinates<N>) -> Self {
58 Self::from_linear(reference_nodal_coordinates)
59 }
60}
61
62impl CohesiveFiniteElement<G, N, P> for Hexahedron {
63 fn nodal_mid_surface<const I: usize>(
64 nodal_coordinates: &ElementNodalEitherCoordinates<I, N>,
65 ) -> ElementNodalEitherCoordinates<I, P> {
66 Self::nodal_mid_surface_linear(nodal_coordinates)
67 }
68 fn nodal_separations(nodal_coordinates: &ElementNodalCoordinates<N>) -> Separations<P> {
69 Self::nodal_separations_linear(nodal_coordinates)
70 }
71 fn normal_gradients_full(
72 nodal_mid_surface: &ElementNodalCoordinates<P>,
73 ) -> NormalGradients<N, G> {
74 Self::normal_gradients_full_linear(nodal_mid_surface)
75 }
76 fn signs() -> ScalarList<N> {
77 Self::signs_linear()
78 }
79}
80
81impl LinearCohesiveFiniteElement<G, N, P> for Hexahedron {}