Theory contents

Gradient and divergence

On this page

How do derivatives connect displacement, strain, stress and equilibrium?

A field varies from point to point. A gradient records that variation; a divergence measures its net outward flow. We use a fixed Cartesian basis with x1=​x, x2=​y and x3=​z, following the index convention. The polynomial examples below use dimensionless coordinates and values unless units are shown. They illustrate operators, not solved models.

Gradient of a scalar

The gradient turns a scalar field q into a 3-vector of slopes. A component gives the change per unit distance along that coordinate axis:

(∇q)i=∂q∂xi,∇q=(∂q/∂x,∂q/∂y,∂q/∂z)T.

For q=​x2+3y, the derivatives are (2x,3,0). At (2,1,0), q=​7 and ∇q=​(4,3,0)T. A small step h along x changes q by approximately 4h; a step along z does not change it. The gradient points toward the steepest local increase.

Elliptical contour lines of a scalar field phi. Blue arrows at points on one contour show the gradient, perpendicular to the contour and pointing outwards towards larger phi.
Level sets of a scalar field φ and its gradient at points on one of them. The gradient is normal to the level set and points towards larger values; its length is the rate of increase.

Units divide by length: a pressure gradient has units MPa/mm. In FEM, the gradient of a dimensionless shape function Na has units 1/mm. These derivatives turn nodal displacements into strain.

Gradient of a vector

A 3-vector field v has three slopes for each of its three components. Its gradient is a 3 × 3 tensor. Row i identifies the vector component; column j identifies the differentiation direction.

(∇v)ij=∂vi∂xj.

Take the displacement field

u=(0.001x+0.002y,−0.004x+0.003y,0.005z)T,

with coordinates and displacement both measured in mm. Its dimensionless gradient is constant:

∇u=[0.0010.0020−0.0040.0030000.005]

The xy entry is ∂ux/∂y=​0.002; the yx entry is ∂uy/∂x=​−0.004. Some texts transpose this convention. Check the component definition before transferring a formula. In an element, differentiating uih=​∑aNadai gives (∇uh)ij=​∑adai∂Na/∂xj: each nodal coefficient multiplies a shape-function slope.

Small strain and shear

The gradient includes both deformation and local rotation. Its symmetric part gives the infinitesimal strain tensor, a symmetric 3 × 3 output:

εij(u)=12((∇u)ij+(∇u)ji).
ε(u)=[0.001−0.0010−0.0010.0030000.005]

Here εxy=​(0.002−0.004)/2=​−0.001. The engineering shear is γxy=​2εxy=​−0.002. With shear modulus μ=​80000 MPa, σxy=​2μεxy=​μγxy=​−160 MPa. See why shear appears twice in tensor work.

As a check, u=​(−θy,θx,0)T has opposite xy and yx derivatives, so its symmetric gradient is zero. This is an infinitesimal rigid rotation. Small-strain kinematics neglect quadratic gradient terms; finite rotations need a different strain measure.

Divergence of a vector

The divergence maps a 3-vector field to a scalar by adding its outward directional changes:

∇·v=∂vx∂x+∂vy∂y+∂vz∂z=tr(∇v).

For v=​(x2,xy,z)T, ∇·v=​2x+x+1=​3x+1, giving 7 at x=​2. Positive divergence means a small region has more outgoing than incoming flow. For displacement, ∇·u=​trε gives first-order relative volume change: the example above gives 0.009.

Divergence of stress

Stress is a tensor field, so its divergence is a 3-vector. Using the traction convention ti=​σijnj, differentiate and sum across each row:

(∇·σ)i=∑j=13∂σij∂xj.
σ=[x2xy0xy2y0003z]

The x component is 2x+x+0=​3x; the y component is y+2+0; the z component is 3. At (2,1,0), ∇·σ=​(6,3,3)T. This is different from taking the gradient of trσ.

In physical units, differentiating stress (N/mm²) gives N/mm³, matching body force per volume b. Static equilibrium is ∇·σ+b=​0. The weak form transfers this derivative to a test displacement so neighbouring FEM elements need not share a pointwise stress derivative.

Sources and further reading

  1. MIT OpenCourseWare: Multivariable Calculus, gradient, divergence and flux.
  2. MIT OpenCourseWare: Structural Mechanics, infinitesimal strain and stress equilibrium.
  3. KoFEM’s solid stress recovery obtains the displacement gradient ∂ui/∂xj, symmetrises it and applies the deviatoric part of the Lamé law, which is all von Mises needs. The mixed solid–shell solve uses the same recovery. The calculations here verify the operators, not a full solver or shell formulation.