Lesson 3 of 13 20 min

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
Click on the bar to add nodes. Watch how elements form between adjacent nodes and DOFs are numbered.

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

ElementNodesShapeApplication
2-node bar2LinearTruss members, axial loading
3-node bar3QuadraticHigher accuracy, curved geometry
2-node beam2Cubic (Hermite)Bending problems

2D Elements

ElementNodesShapeApplication
3-node triangle (CST)3LinearSimple meshing, constant strain
6-node triangle (LST)6QuadraticBetter accuracy, curved edges
4-node quad (Q4)4BilinearStructured meshes
8-node quad (Q8)8Serendipity quadraticGood all-around choice

3D Elements

ElementNodesShapeApplication
4-node tetrahedron4LinearAuto-meshing complex geometry
10-node tetrahedron10QuadraticStandard for accuracy
8-node hexahedron8TrilinearBest accuracy/cost ratio
20-node hexahedron20Serendipity quadraticHigh 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)
Drag the nodal values to see how the interpolated field changes. Toggle between linear and quadratic elements.

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$.

Hover over the parent element to see how points map to the physical element. Drag corner nodes to distort the physical element.
Advantages:
  • 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

SituationRecommended ElementWhy
Axial loading (truss)2-node barSimple, exact for uniform stress
Bending (beam)2-node beam (cubic)Captures bending curvature
Plane stress/strain8-node quad (Q8)Good accuracy, handles curves
Complex 3D geometry10-node tetEasy to mesh, quadratic accuracy
Regular 3D geometry20-node hexBest accuracy per DOF
Thin structuresShell elementsEfficient 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.

Strong & Weak Forms