Beginning with this post, I’ll be publishing about the basics of finite element
formulations, from personal notes that accumulated over the years. This one is
about linear and scalar problems which came to be the “Hello World” for FE.
Details regarding spaces and discretization are omitted for the sake of brevity.
For those who want to delve into theory, I recommend “The Finite Element Method:
Theory, Implementation, and Applications”
by Larson and Bengzon.
The weak formulation of a canonical linear problem reads
The discretization $u_h$ is a linear combination of basis functions
$N^J$ and corresponding scalars $u^J$, $J=1,\dots,\nnode$ so that $V_h$ is a
subset of $V$.
The discretization of \eqref{eq:femlinear1} then reads
\[\begin{equation}
\begin{alignedat}{4}
- \Var u &= f \quad && \text{in} \quad && \Omega \\
u &= 0 \quad && \text{on} \quad && \del\Omega
\end{alignedat}
\end{equation}\]
The weak formulation reads
Find $u\in V$ such that
\[\begin{equation}
- \int_\Omega \Delta(u) v \dv= \int_\Omega f v \dv
\end{equation}\]
for all $v\in V$ where $V=H^1_0(\Omega)$.
Applying integration by parts and divergence theorem on the left-hand side
\[\begin{equation}
\begin{aligned}
\int_\Omega \Delta(u) v \dv
&= \int_\Omega \nabla \dtp (\nabla (u) v) \dv
- \int_\Omega \nabla u\dtp\nabla v \dv \\
&= \underbrace{\int_{\del\Omega} v (\nabla u\dtp\Bn) \da}_{v = 0
\text{ on } \del\Omega}
- \int_\Omega \nabla u\dtp\nabla v \dv \\
\end{aligned}
\end{equation}\]
We have the following variational forms:
\[\begin{equation}
\begin{aligned}
a(u,v) &= \int_{\Omega} \nabla u \dtp \nabla v \dv\\
b(v) &= \int_{\Omega} f \, v \dv\\
\end{aligned}
\end{equation}\]
Following \eqref{eq:femlinear3}, we can calculate the stiffness matrix
$\BA$ as