This integrates the Q4 stiffness matrix exactly for rectangular elements.
3×3 Gauss (Q8 Standard)
9 integration points — needed for quadratic elements.
Triangle Integration
Triangles use different rules based on area coordinates:
Points
Degree
Locations
1
1
Centroid (1/3, 1/3, 1/3)
3
2
Mid-edges
4
3
1 center + 3 interior
7
5
Standard for LST
Full vs Reduced Integration
Full Integration
Use enough Gauss points to integrate the stiffness matrix exactly:
Q4: 2×2 = 4 points
Q8: 3×3 = 9 points
CST: 1 point (constant integrand)
LST: 3 points
Reduced Integration
Use fewer points than "full":
Q4 reduced: 1 point (at center)
Q8 reduced: 2×2 = 4 points
Why use reduced integration?
Computational savings: Fewer evaluations of $[B]^T[D][B]$
Avoids shear locking: Full integration can make elements too stiff in bending
Better accuracy in some cases (counterintuitive!)
The Locking Problem
Shear locking occurs when elements can't represent pure bending without parasitic shear strain.
For a beam in bending:
True behavior: $\gamma_{xy} = 0$ (no shear strain)
Q4 with full integration: Forces $\gamma_{xy} \neq 0$ (artificial stiffness)
Q4 with reduced integration: Can represent $\gamma_{xy} = 0$ correctly
Hourglassing
The downside of reduced integration: hourglass modes.
With 1-point integration, the element can deform in a zero-energy "hourglass" pattern:
The element deforms but strain at the center integration point remains zero — a spurious zero-energy mode.
This deformation produces zero strain at the single integration point!
Solutions:
Hourglass control (artificial stiffness)
Selective reduced integration
Use more elements
Use higher-order elements
Selective Reduced Integration
A clever compromise: Use different integration for different terms.
For Q4 in bending:
Full integration (2×2) for volumetric/normal terms
Reduced integration (1 point) for shear terms
This avoids locking while maintaining stability.
Integration Requirements by Element
Element
Full Integration
Reduced
Notes
CST (3-node tri)
1 point
N/A
Constant strain
LST (6-node tri)
3 points
1 point
Mid-edge rule
Q4 (4-node quad)
2×2
1×1
Watch for hourglassing
Q8 (8-node quad)
3×3
2×2
Best general choice
Hex8 (8-node hex)
2×2×2
1×1×1
Same locking issues
Hex20 (20-node hex)
3×3×3
2×2×2
Standard 3D choice
Computing the Stiffness Matrix
Here's the algorithm for Q4 with 2×2 Gauss:
Initialize K = zeros(8, 8)
# Gauss points and weights
points = [(-1/√3, -1/√3), (1/√3, -1/√3),
(1/√3, 1/√3), (-1/√3, 1/√3)]
weights = [1, 1, 1, 1]
for each Gauss point (ξᵢ, ηᵢ) with weight wᵢ:
# Compute shape function derivatives
dN/dξ, dN/dη = shape_derivatives(ξᵢ, ηᵢ)
# Compute Jacobian
J = compute_jacobian(dN/dξ, dN/dη, node_coords)
detJ = det(J)
# Transform derivatives to physical coordinates
dN/dx, dN/dy = J⁻¹ @ [dN/dξ, dN/dη]
# Build B-matrix
B = build_B_matrix(dN/dx, dN/dy)
# Accumulate stiffness
K += wᵢ * B.T @ D @ B * detJ * thickness
Stress Recovery
After solving for displacements, we compute stresses at integration points:
$$\{\sigma\}_i = [D][B(\xi_i, \eta_i)]\{u_e\}$$
Why at Gauss points?
Stresses are most accurate there (superconvergent)
Extrapolating to nodes can introduce errors
Extrapolation to nodes:
Use shape function interpolation in reverse to get nodal stress values from Gauss point values.
Common Mistakes
Wrong number of points: Using 1-point for Q4 without hourglass control
Negative Jacobian: Check element orientation and shape quality
Mismatched integration: Different rules for stiffness vs mass matrix
Over-integration: Too many points wastes computation without benefit
Stress at nodes: Extrapolated values less accurate than Gauss point values
Key Takeaways
Gauss quadrature approximates integrals as weighted sums at optimal points
n points integrate polynomials up to degree 2n-1 exactly
2D integration: Apply 1D rule in each direction (2×2, 3×3, etc.)
Full integration: Enough points for exact stiffness (2×2 for Q4)
Reduced integration: Fewer points, avoids locking but risks hourglassing
Selective integration: Best of both — full for volumetric, reduced for shear
Stresses most accurate at integration points (superconvergent)
What's Next
We've used natural coordinates $(\xi, \eta)$ and the Jacobian throughout. The next lesson dives deep into isoparametric formulation — the unified framework that makes all this work elegantly for arbitrary element shapes.
Career Growth
3,000+ Engineers Placed in Top Companies
Join the ranks of successful engineers at Bosch, Tata, L&T, and 500+ hiring partners.