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

Find $u\in V$ such that

for all $v \in V$ where $a(\cdot, \cdot)$ is a bilinear form and $b(\cdot)$ is a linear form.

We define the discretization of $u$ as

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

We then have

Using the linearity properties,

we obtain

For arbitrary test function values $v^I$, we can express \eqref{eq:femlinear2} as a system of $\nnode$ equations

for $I = 1,2,\dots,\nnode$. If we expand the summations as

we can see that the terms with $a$ constitute a matrix $\BA$ and the terms with $b$ constitute a vector $\Bb$, allowing us to write

where we chose to express the unknown coefficients $u^I$ as a vector $\Bu = [u^1,u^2,\dots,u^{\nnode}]\tra$.

\It can be seen that the components of the $\BA$ and $\Bb$ are defined as

we can express the linear system as

Note that with the given definitions, \eqref{eq:femlinear3} becomes

## Example: Poisson’s Equation

In the weak form of Poisson’s equation

Find $u\in V$ such that

for all $v\in V$ where $V=H^1_0(\Omega)$.

Applying integration by parts and divergence theorem on the left-hand side

We have the following variational forms:

Following \eqref{eq:femlinear3}, we can calculate the stiffness matrix $\BA$ as

where we have defined the gradient of the basis functions as

Similarly, we integrate the force term into a vector $\Bb$ as