Nodes, Elements & Shape Functions
In the previous lesson, we saw that the weak form transforms a differential equation into an integral equation. But to solve it numerically, we need to discretize — break the continuous domain into manageable pieces. This is where nodes, elements, and shape functions come in.
Discretization: From Continuous to Discrete
A continuous domain has infinitely many points. We can't compute values at infinite points, so we:
- Select key points called nodes where we'll compute the solution
- Connect nodes to form elements — small regions where we'll approximate the physics
- Interpolate the solution within each element using shape functions
Nodes: Where We Compute the Solution
Nodes are discrete points in the domain where:- The primary variable (displacement, temperature, etc.) is computed
- Boundary conditions can be applied
- Forces or fluxes can be specified
Each node has degrees of freedom (DOFs) — the unknown values we solve for:
- 1D structural: 1 DOF per node (axial displacement $u$)
- 2D structural: 2 DOFs per node ($u_x$, $u_y$)
- 3D structural: 3 DOFs per node ($u_x$, $u_y$, $u_z$)
- 3D shell: 6 DOFs per node (3 translations + 3 rotations)
Node Numbering
Nodes are numbered sequentially. The numbering scheme affects:
- Bandwidth of the stiffness matrix
- Solver efficiency — good numbering reduces fill-in
- Modern software auto-optimizes numbering (Cuthill-McKee, etc.)
Elements: Where Physics Happens
An element is a region bounded by nodes where we approximate the field variable. Elements are defined by:
- Type: Bar, beam, triangle, quadrilateral, tetrahedron, hexahedron
- Order: Linear (straight edges), quadratic (curved edges)
- Connectivity: Which nodes belong to this element
1D Elements
| Element | Nodes | Shape | Application |
|---|---|---|---|
| 2-node bar | 2 | Linear | Truss members, axial loading |
| 3-node bar | 3 | Quadratic | Higher accuracy, curved geometry |
| 2-node beam | 2 | Cubic (Hermite) | Bending problems |
2D Elements
| Element | Nodes | Shape | Application |
|---|---|---|---|
| 3-node triangle (CST) | 3 | Linear | Simple meshing, constant strain |
| 6-node triangle (LST) | 6 | Quadratic | Better accuracy, curved edges |
| 4-node quad (Q4) | 4 | Bilinear | Structured meshes |
| 8-node quad (Q8) | 8 | Serendipity quadratic | Good all-around choice |
3D Elements
| Element | Nodes | Shape | Application |
|---|---|---|---|
| 4-node tetrahedron | 4 | Linear | Auto-meshing complex geometry |
| 10-node tetrahedron | 10 | Quadratic | Standard for accuracy |
| 8-node hexahedron | 8 | Trilinear | Best accuracy/cost ratio |
| 20-node hexahedron | 20 | Serendipity quadratic | High accuracy |
Shape Functions: The Interpolation Magic
Shape functions (also called interpolation functions or basis functions) define how the field variable varies within an element.For a 1D element with nodes at positions $x_1$ and $x_2$:
$$u(x) = N_1(x) \cdot u_1 + N_2(x) \cdot u_2$$
Where:
- $u_1$, $u_2$ = nodal values (what we solve for)
- $N_1(x)$, $N_2(x)$ = shape functions (known polynomials)
Linear Shape Functions (2-Node Element)
For an element from $x = 0$ to $x = L$:
$$N_1(x) = 1 - \frac{x}{L} = \frac{L-x}{L}$$
$$N_2(x) = \frac{x}{L}$$
Properties:- At $x = 0$: $N_1 = 1$, $N_2 = 0$ → $u = u_1$ ✓
- At $x = L$: $N_1 = 0$, $N_2 = 1$ → $u = u_2$ ✓
- Linear variation between nodes
Quadratic Shape Functions (3-Node Element)
Adding a mid-node allows quadratic variation:
$$N_1(\xi) = \frac{\xi(\xi-1)}{2}$$
$$N_2(\xi) = 1 - \xi^2$$
$$N_3(\xi) = \frac{\xi(\xi+1)}{2}$$
Where $\xi \in [-1, 1]$ is the natural coordinate (normalized position).
Why quadratic?- Better approximation of curved fields
- Essential for bending problems
- Captures stress gradients more accurately
Key Properties of Shape Functions
Every valid set of shape functions must satisfy:
1. Partition of Unity
$$\sum_{i=1}^{n} N_i(x) = 1 \quad \text{for all } x$$
Physical meaning: If all nodes have the same value $u_0$, the interpolated field equals $u_0$ everywhere. The element can represent a constant field.2. Kronecker Delta Property
$$N_i(x_j) = \delta_{ij} = \begin{cases} 1 & \text{if } i = j \\ 0 & \text{if } i \neq j \end{cases}$$
Physical meaning: At node $j$, only shape function $N_j$ is non-zero (and equals 1). This ensures nodal values are exactly recovered at node locations.3. Completeness
Shape functions must be able to represent:
- Rigid body motion (constant displacement)
- Constant strain states
These are the minimum requirements for convergence.
4. Compatibility
At element boundaries, the field must be continuous. For $C^0$ continuity:
- Displacement is continuous across elements
- Strain may be discontinuous (acceptable for most problems)
Natural Coordinates
Instead of using physical coordinates $(x, y, z)$, we often use natural coordinates $(\xi, \eta, \zeta)$ that range from $-1$ to $+1$.
- Shape functions have the same form for all elements
- Integration limits are always $-1$ to $+1$
- Numerical integration (Gauss quadrature) is standardized
Mapping Example (1D)
Physical coordinate: $x \in [x_1, x_2]$
Natural coordinate: $\xi \in [-1, +1]$
$$x(\xi) = \frac{1-\xi}{2} x_1 + \frac{1+\xi}{2} x_2$$
This is the isoparametric mapping — the same shape functions interpolate both geometry and field variables.
From Shape Functions to Strain
Once we have displacement, we can compute strain. For 1D:
$$\varepsilon = \frac{du}{dx} = \frac{d}{dx}\left(\sum_i N_i u_i\right) = \sum_i \frac{dN_i}{dx} u_i$$
In matrix form:
$$\varepsilon = [B]\{u\}$$
Where $[B]$ is the strain-displacement matrix:
$$[B] = \begin{bmatrix} \frac{dN_1}{dx} & \frac{dN_2}{dx} & \cdots \end{bmatrix}$$
For a 2-node linear element:
$$[B] = \begin{bmatrix} -\frac{1}{L} & \frac{1}{L} \end{bmatrix}$$
Note: For a linear element, strain is constant throughout the element (derivatives of linear functions are constants).Choosing the Right Element
| Situation | Recommended Element | Why |
|---|---|---|
| Axial loading (truss) | 2-node bar | Simple, exact for uniform stress |
| Bending (beam) | 2-node beam (cubic) | Captures bending curvature |
| Plane stress/strain | 8-node quad (Q8) | Good accuracy, handles curves |
| Complex 3D geometry | 10-node tet | Easy to mesh, quadratic accuracy |
| Regular 3D geometry | 20-node hex | Best accuracy per DOF |
| Thin structures | Shell elements | Efficient for plates/shells |
Common Mistakes
- Using linear tets for bending: Linear tetrahedra are too stiff in bending — use quadratic (10-node) instead
- Insufficient mesh density: At least 2-3 elements through thickness for bending
- Ignoring aspect ratio: Highly distorted elements give poor results
- Stress concentration without refinement: Always refine mesh at sharp corners, holes, notches
The B-Matrix and Stiffness
The $[B]$ matrix connects displacement to strain. Combined with the material matrix $[D]$:
$$[\sigma] = [D][\varepsilon] = [D][B]\{u\}$$
The element stiffness matrix comes from:
$$[K_e] = \int_V [B]^T [D] [B] \, dV$$
We'll derive this explicitly in the next lesson.
Key Takeaways
- Discretization converts infinite-dimensional problems to finite-dimensional
- Nodes are points where we compute the solution; each has DOFs
- Elements connect nodes and define regions where physics is approximated
- Shape functions interpolate values between nodes: $u(x) = \sum N_i u_i$
- Key properties: Partition of unity, Kronecker delta, completeness, compatibility
- Natural coordinates $(\xi, \eta)$ standardize element formulations
- B-matrix relates nodal displacements to strains: $\varepsilon = [B]\{u\}$
- Element choice matters: Linear elements are stiff in bending; use quadratic for accuracy
What's Next
Now that we understand shape functions and how they interpolate the field, we're ready to derive the element stiffness matrix — the key ingredient that relates nodal forces to nodal displacements.