
2D FEM solution for a magnetostatic configuration (lines denote the direction of calculated
flux density and colour - its magnitude)

2D mesh for the image above (mesh is denser around the object of interest)
Mathematically, the 'finite element method (FEM)' is used for finding approximate solution of
partial differential equations (PDE) as well as of
integral equations such as the
heat transport equation. The solution approach is based either on eliminating the differential equation completely (steady state problems), or rendering the PDE into an equivalent
ordinary differential equation, which is then solved using standard techniques such as
finite differences, etc.
In solving
partial differential equations, the primary challenge is to create an equation that approximates the equation to be studied, but is
numerically stable, meaning that errors in the input data and intermediate calculations do not accumulate and cause the resulting output to be meaningless. There are many ways of doing this, all with advantages and disadvantages. The Finite Element Method is a good choice for solving partial differential equations over complex domains (like cars and oil pipelines), when the domain changes (as during a solid state reaction with a moving boundary), or when the desired precision varies over the entire domain. For instance, in simulating the weather pattern on Earth, it is more important to have accurate predictions over land than over the wide-open sea, a demand that is achievable using the finite element method.
History
The finite-element method originated from the needs for solving complex
elasticity,
structural analysis problems in
civil engineering and
aeronautical engineering. Its development can be traced back to the work by
Alexander Hrennikoff (1941) and
Richard Courant (1942). While the approaches used by these pioneers are dramatically different, they share one essential characteristic:
mesh discretization of a continuous domain into a set of discrete sub-domains. Hrennikoff's work discretizes the domain by using a lattice analogy while Courant's approach divides the domain into finite triangular subregions for solution of second order elliptic partial differential equations (PDEs) that arise from the problem of
torsion of a
cylinder. Courant's contribution was evolutionary, drawing on a large body of earlier results for PDEs developed by
Rayleigh,
Ritz, and
Galerkin. Development of the finite element method began in earnest in the middle to late
1950s for
airframe and
structural analysis and picked up a lot of steam at the
University of Stuttgart through the work of
John Argyris and at
Berkeley (see
Early Finite Element Research at Berkeley) through the work of
Ray W. Clough in the
1960s for use in
civil engineering. The method was provided with a rigorous mathematical foundation in
1973 with the publication of
Strang and Fix's ''An Analysis of The Finite Element Method'', and has since been generalized into a branch of applied mathematics for numerical modeling of physical systems in a wide variety of
engineering disciplines, e.g.,
electromagnetism and
fluid dynamics.
The development of the
finite element method in structural mechanics is often based on an energy principle, e.g., the
virtual work principle or the
minimum total potential energy principle, which provides a general, intuitive and physical basis that has a great appeal to structural engineers.
Technical discussion
We will illustrate the finite element method using two sample problems from which the general method can be extrapolated. We assume that the reader is familiar with
calculus and
linear algebra. We will use the one-dimensional
:
where
is given and
is an unknown function of
, and
is the second derivative of
with respect to
.
The two-dimensional sample problem is the
Dirichlet problem
:
where
is a connected open region in the
plane whose boundary
is "nice" (e.g., a
smooth manifold or a
polygon), and
and
denote the second derivatives with respect to
and
, respectively.
The problem P1 can be solved "directly" by computing
antiderivatives. However, this method of solving the
boundary value problem works only when there is only one spatial dimension and does not generalize to higher-dimensional problems or to problems like
. For this reason, we will develop the finite element method for P1 and outline its generalization to P2.
Our explanation will proceed in two steps, which mirror two essential steps one must take to solve a boundary value problem (BVP) using the FEM. In the first step, one rephrases the original BVP in its weak, or
variational form. Little to no computation is usually required for this step, the transformation is done by hand on paper. The second step is the discretization, where the weak form is discretized in a finite dimensional space. After this second step, we have concrete formulae for a large but finite dimensional linear problem whose solution will approximately solve the original BVP. This finite dimensional problem is then implemented on a
computer.
Variational formulation
The first step is to convert P1 and P2 into their
variational equivalents. If
solves P1, then for any smooth function
that satisfies the displacement boundary conditions, i.e.
at
and
,we have
(1)
Conversely, if for a given
, (1) holds for every smooth function
then one may show that this
will solve P1. (The proof is nontrivial and uses
Sobolev spaces.)
By using
integration by parts on the right-hand-side of (1), we obtain
(2)
where we have used the assumption that
.
A proof outline of existence and uniqueness of the solution
We can define
to be the
absolutely continuous functions of
that are
at
and
. Such function are "once differentiable" and it turns out that the symmetric
bilinear map then defines an
inner product which turns
into a
Hilbert space (a detailed proof is nontrivial.) On the other hand, the left-hand-side
is also an inner product, this time on the
Lp space . An application of the
Riesz representation theorem for Hilbert spaces shows that there is a unique
solving (2) and therefore P1.
The variational form of P2
If we integrate by parts using a form of
Green's theorem, we see that if
solves P2, then for any
,
:
where
denotes the
gradient and
denotes the
dot product in the two-dimensional plane. Once more
can be turned into an inner product on a suitable space
of "once differentiable" functions of
that are zero on
. We have also assumed that
. The space
can no longer be defined in terms of absolutely continuous functions, but see
Sobolev spaces. Existence and uniqueness of the solution can also be shown.
Discretization

A function in ''H''10, with zero values at the endpoints (blue), and a piecewise linear approximation (red).

A piecewise linear function in two dimensions.

Basis functions ''v''''k'' (blue) and a linear combination of them, which is piecewise linear (red).
The basic idea is to replace the infinite dimensional linear problem:
:Find
such that
:
with a finite dimensional version:
:(3) Find
such that
:
where
is a finite dimensional
subspace of
. There are many possible choices for
(one possibility leads to the
spectral method). However, for the finite element method we take
to be a space of piecewise linear functions.
For problem P1, we take the interval
, choose
values