How are the displacement field and element integrals approximated?
The weak form
asks for a displacement field in a space of infinitely many functions.
A finite element method picks a finite set of shape functions on each
element and evaluates every integral with a few weighted points.
This page covers static, small-strain, linear-elastic 3D solids; shells
use a different element. Units are N, mm and MPa throughout.
Here is the number of scalar basis functions on the
element. KoFEM’s solid elements are nodal (Lagrange):
equals 1 at its own node and 0 at every other node.
The coefficient is then the displacement of node in
direction . Two further properties matter:
Partition of unity. everywhere.
If every node moves by the same vector, the whole element translates
rigidly and has zero strain.
Continuity. Neighbouring elements share the nodes on
their common face. The displacement is continuous across that face,
but its slope, and hence strain, generally jumps.
On a tetrahedron the natural coordinates are the four barycentric
coordinates , each 1 at one corner and 0 on
the opposite face; they sum to 1. With the
reference coordinates, they are ,, and .
One-dimensional Lagrange shape functions. Each equals 1 at its own node and 0 at every other node, so the coefficient of a shape function is the value at that node. Solid elements use products or barycentric versions of the same idea.
Order 1 (linear): at
the four corners.
Order 2 (quadratic):
at each corner and
at the midpoint of the edge joining corners
and . That gives 4 + 6 = 10 functions.
A complete polynomial of degree is represented exactly. Order 1
therefore reproduces any linear displacement field, including uniform
strain; order 2 also reproduces quadratic fields, such as the
displacement of a beam under constant bending moment.
Solid elements KoFEM solves
The solid solver accepts tetrahedra and hexahedra at order 1 or 2.
The app’s volume mesher creates tetrahedra; hexahedral input is used by
solver-level validation cases. Each scalar basis function carries three
translational coefficients, so an element with functions
has DOFs.
Node layouts of linear and quadratic tetrahedra and hexahedra. Quadratic elements add nodes at the edge midpoints; the 27-node hexahedron also has face and centre nodes. Open circles are hidden behind the element.
Solid elements in KoFEM
Element
Nodes
Element DOFs
Element stiffness
Stiffness rule
Tetrahedron, order 1
4
12
12 × 12
1 point
Tetrahedron, order 2
10
30
30 × 30
4 points
Hexahedron, order 1
8
24
24 × 24
3 × 3 × 3
Hexahedron, order 2
27
81
81 × 81
4 × 4 × 4
An order-2 tetrahedron has nodes at its 4 corners and 6 edge midpoints.
An order-2 hexahedron has 8 corner, 12 edge, 6 face and 1 centre node.
Hexahedral rules are tensor products of Gauss points per direction.
One element order applies to the whole solid solve. Order 2 raises the
polynomial order of the displacement, not of the geometry: every element
is still mapped from its straight-edged corner vertices. A curved CAD
surface is therefore represented by flat element faces at either order.
The mixed solid–shell solve always uses order-1 tetrahedra, and shells
use their own flat-facet element.
From coefficients to strain
Small strain needs first derivatives of displacement. Differentiating the
interpolation moves the derivative onto the shape functions. The
strain–displacement matrix
collects those derivatives. For one basis function it is a 6 × 3
block, using the guide’s
engineering-shear order:
Here means , with units 1/mm.
is the 3-vector of coefficients for basis , and
places the blocks side by side, so it is
. The physical derivatives come from the reference
derivatives through the
inverse-transpose Jacobian.
On a straight-edged linear tetrahedron, every is
constant, so the strain is constant inside the element. This is why it
is often called the constant-strain tetrahedron.
Element stiffness
Substituting the interpolation into internal virtual work gives the
element stiffness matrix.
With the isotropic elasticity matrix (6 × 6, MPa) written in
Lamé parameters and :
and are the reference quadrature points and
dimensionless weights; converts reference volume to mm³. Units:
(1/mm) × MPa × (1/mm) × mm³ = N/mm, a stiffness. is
symmetric. Every rigid-body motion produces zero strain, so it has six
zero-energy modes: three translations and three small rotations.
Worked example: one linear tetrahedron
Place the corners at ,, and with
edge length . Choose and , a soft polymer, because
these give the round values .
Mapping. , so and the
volume is .
Gradients (1/mm): ,
, ,
. They sum to zero, as partition of unity
requires.
Sizes. Each is 6 × 3, is
6 × 12, is 6 × 6 and is 12 × 12.
Quadrature. The integrand is constant, so one point
with weight 1/6 is exact: .
The 3 × 3 block coupling node to node is
. Three blocks, in N/mm, are:
: pulling node 2 along
stretches the element, while moving it along or only shears it.
Checks you can repeat:
is symmetric; for example .
A rigid -translation, at every node, gives zero
nodal force. Each row of therefore sums to zero by
component.
A small rotation about ,
multiplied by a small angle, also gives zero force.
The matrix has rank 6: 12 DOFs minus six rigid-body modes.
Choose the quadrature rule
Quadrature replaces a reference integral by a weighted sum of point
values. A rule of degree integrates every polynomial up to degree
exactly. The cheapest safe choice integrates the stiffness integrand
exactly when it is a polynomial.
Gauss integration points (red) on reference elements. More points integrate higher-degree polynomials exactly.
On a straight-edged order-2 tetrahedron, each entry is linear in ,
so is quadratic. Test a quadratic over the
reference tetrahedron (volume 1/6):
The four-point rule uses weights 1/24 at barycentric points
and permutations, with and
. Too few points underestimate such terms and
can leave non-rigid deformation modes with zero computed energy.
KoFEM uses the stiffness rule MFEM chooses by default: degree
on straight-edged tetrahedra of order , which is exact. For hexahedra
the rule is a tensor product of Gauss points. It is exact for
parallelepipeds; on a distorted hexahedron varies and the integrand
is no longer a polynomial, so any finite rule is approximate.
The point counts are listed in the table above.
Element load vectors
A surface traction (MPa)
enters through boundary work. On a loaded element face , the
element load vector is:
Each entry is a force in N: MPa × mm². For a uniform traction on a
triangular face of area , the shares of the face force are:
Order 1: 1/3 at each corner.
Order 2: 0 at each corner and 1/3 at each edge
midpoint.
The order-2 result is surprising but correct: the corner functions
are negative over part of the face and integrate to zero.
Splitting a face force equally over all six nodes would not be
work-equivalent. KoFEM converts a face force group into a uniform
traction, the total force divided by the loaded area, and integrates it
this way. On a flat triangle with uniform traction these shares are
exact, so KoFEM applies them directly. Quadrilateral hexahedron faces
use a Gauss rule of 2 × 2 points at order 1 and 3 × 3 at order 2. The static solid solve
applies no body force: density is stored but unused. How loads and
supports enter the global system is covered in
Loads and constraints.
A uniform traction on an element edge becomes consistent nodal forces. The shares follow from integrating each shape function along the edge; a quadratic midpoint node takes two thirds of the load.
Mesh size versus element order
Two controls reduce discretisation error: smaller elements
(h-refinement) and higher order (p-refinement). For a smooth solution,
standard error estimates give, as the element size decreases at order :
These are general expectations, not KoFEM measurements. They need
well-shaped elements and a smooth solution. Re-entrant corners, point
loads and point supports create singularities: the local stress never
converges, and rates elsewhere drop. Halving at order 1 should
roughly halve the stress error; at order 2 it should roughly quarter it.
Expected error against element size for a smooth solution, on logarithmic axes: the slope is the convergence rate. A singular peak stress, as at a re-entrant corner, grows instead. Schematic; not a KoFEM measurement.
Order 2 costs more per element: a 30 × 30 instead of a 12 × 12
tetrahedral stiffness, and more unknowns because every edge adds a
node. In a typical tetrahedral mesh there are several edges per vertex,
so the same mesh has several times as many DOFs at order 2. The
cantilever beam example shows a
measured h- and order-study on tetrahedra, solving the same beam at
order 1 and order 2.
KoFEM currently returns solid displacement at element
corners only, and one von Mises stress at each element centre. The
order-2 edge coefficients are solved but are not part of the returned
field; see
Displacement and stress.
Thin walls and linear tetrahedra
A wall in bending has strain that varies linearly through its thickness,
from tension on one side to compression on the other. A linear
tetrahedron has one constant strain. With one or two elements through
the thickness, the mesh can only bend by also producing spurious shear
and volume change. That parasitic energy makes the model too stiff.
This effect is called locking.
Locking also misleads convergence checks. Halving the element size
changes the result only slowly, so two order-1 solutions can agree
closely while both remain far from the converged answer. Agreement
between successive order-1 meshes is not, by itself, evidence of
accuracy.
Measured in KoFEM. An internal study of a 3 mm
sheet-metal bracket found that order 2 on the same tetrahedral mesh about doubled the
maximum displacement. Halving the order-1 element size changed it by
only 2.6%. KoFEM does not currently warn about this case.
For a thin-walled or bending-dominated solid:
compare order 1 with order 2 on the same mesh before trusting the
result;
refine through the thickness, not just along the surface; and
consider a shell idealisation of the wall.
KoFEM implementation
KoFEM’s solid solve runs in its own Rust finite-element module. It
implements the tetrahedra and hexahedra above with the shape functions
and quadrature rules of MFEM 4.7, from which these parts are ported.
The app offers Linear (1st order) and
Quadratic (2nd order); the worker sends that order to the
solid solve
(solver.worker.ts).
The Rust module adds the order-2 edge, face and centre nodes from the
vertices; element geometry comes from vertex positions only
(mesh.rs).
Per-element and are computed from each body’s and , and the
element stiffness is integrated with the rules in the table above
(element.rs;
MFEM default rule).
Surface loads on triangular and quadrilateral faces are integrated
as described above
(surface.rs;
MFEM face rule for quadrilaterals).
The mixed solid–shell solve reuses this solid stiffness at order 1
(coupled_static.rs).
How these element contributions combine into one system is explained in
Assembly.