elasticity
Elasticity constitutive matrices
Elasticity helpers for 2D and 3D vector FEM problems.
Provides constitutive matrices (D), strain-displacement matrices (B), and element stiffness computation for plane stress, plane strain, and full 3D isotropic linear elasticity using Voigt notation.
plane_stress_D(E, nu)
Constitutive matrix for plane stress (thin plates). Voigt ordering: [σ_xx, σ_yy, τ_xy]^T = D [ε_xx, ε_yy, γ_xy]^T D = E/(1-ν²) [[1, ν, 0], [ν, 1, 0], [0, 0, (1-ν)/2]]
plane_strain_D(E, nu)
Constitutive matrix for plane strain (thick/constrained bodies). Voigt ordering: [σ_xx, σ_yy, τ_xy]^T = D [ε_xx, ε_yy, γ_xy]^T D = E/((1+ν)(1-2ν)) [[1-ν, ν, 0], [ν, 1-ν, 0], [0, 0, (1-2ν)/2]]
isotropic_3d_D(E, nu)
Full 3D isotropic constitutive matrix (6×6). Voigt ordering: [σ_xx, σ_yy, σ_zz, τ_yz, τ_xz, τ_xy]^T = D [ε_xx, ε_yy, ε_zz, γ_yz, γ_xz, γ_xy]^T
B_matrix_triangle_2d(dN_dx, dN_dy)
Build the 2D strain-displacement matrix B for a triangle element. For n_nodes nodes with physical-space shape function derivatives, the B matrix maps nodal displacements [u1, v1, u2, v2, …]^T to Voigt strains [ε_xx, ε_yy, γ_xy]^T. B is 3 × (2 * n_nodes): B = [[dN1/dx, 0, dN2/dx, 0, …], [0, dN1/dy, 0, dN2/dy, …], [dN1/dy, dN1/dx, dN2/dy, dN2/dx, …]] Parameters ———- dN_dx, dN_dy : list of sp.Expr Physical-space partial derivatives of shape functions.
B_matrix_tetra_3d(dN_dx, dN_dy, dN_dz)
Build the 3D strain-displacement matrix B for a tetrahedral element. Maps nodal displacements [u1, v1, w1, u2, v2, w2, …]^T to Voigt strains [ε_xx, ε_yy, ε_zz, γ_yz, γ_xz, γ_xy]^T. B is 6 × (3 * n_nodes).
element_stiffness_BtDB(B, D, volume_or_area, thickness)
Compute element stiffness K_e = (t) * |Ω_e| * B^T D B. For constant-strain elements (P1 triangle, P1 tet) where B and D are constant over the element, the integral reduces to a simple product. Parameters ———- B : sp.Matrix Strain-displacement matrix. D : sp.Matrix Constitutive matrix. volume_or_area : sp.Expr Element area (2D) or volume (3D). thickness : sp.Expr or None Plate thickness for 2D problems (defaults to 1 if omitted).