Finite element discretization¶
Editor: Weipeng XU
Last modified: 28/08/2025
The standard Galerkin method employs the same shape functions to interpolate both the trial solution and the test functions: $$ \boldsymbol{u}^h(\boldsymbol{x}) = \sum_{i=1}^n \mathbf{N}_i(\boldsymbol{x}) \boldsymbol{u}_i,\quad \boldsymbol{v}^h(\boldsymbol{x}) = \sum_{i=1}^n \mathbf{N}_i(\boldsymbol{x}) \boldsymbol{v}_i $$ which can be written in a global matrix form: $$ \boldsymbol{u}^h(\boldsymbol{x}) = \mathbf{N}(\boldsymbol{x}) \boldsymbol{U},\quad \boldsymbol{v}^h(\boldsymbol{x}) = \mathbf{N}(\boldsymbol{x}) \boldsymbol{V} $$ where $\boldsymbol{U} = \begin{bmatrix} \boldsymbol{u}_1^T & \boldsymbol{u}_2^T & \cdots & \boldsymbol{u}_n^T \end{bmatrix}^T$ and $\boldsymbol{V}=\begin{bmatrix} \boldsymbol{v}_1^T & \boldsymbol{v}_2^T & \cdots & \boldsymbol{v}_n^T \end{bmatrix}^T$ are the global vectors of nodal vectors and test function coefficients. The global shape function matrix $\mathbf{N}(\boldsymbol{x})$ is assembled from nodal blocks: $$ \mathbf{N}(\boldsymbol{x}) = \begin{bmatrix} \mathbf{N}_1(\boldsymbol{x}) & \mathbf{N}_2(\boldsymbol{x}) & \cdots & \mathbf{N}_n(\boldsymbol{x}) \end{bmatrix} $$
For 1D problems:
$$ \boldsymbol{u}_i = u_i $$
$$ \mathbf{N}_i(\boldsymbol{x}) = N_i(x) $$
For 2D problems:
$$ \boldsymbol{u}_i = \begin{bmatrix} u_{i,x} & u_{i,y} \end{bmatrix}^T $$
$$ \mathbf{N}_i(\boldsymbol{x}) = \begin{bmatrix} N_i(\boldsymbol{x}) & 0 \\ 0 & N_i(\boldsymbol{x}) \end{bmatrix} $$
For 3D problems:
$$ \boldsymbol{u}_i = \begin{bmatrix} u_{i,x} & u_{i,y} & u_{i,z} \end{bmatrix}^T $$
$$ \mathbf{N}_i(\boldsymbol{x}) = \begin{bmatrix} N_i(\boldsymbol{x}) & 0 & 0 \\ 0 & N_i(\boldsymbol{x}) & 0 \\ 0 & 0 & N_i(\boldsymbol{x}) \end{bmatrix} $$
In this notebook, we foucs on the treatment of the neumann boudnary condition term in the weak form: $$ \int_{\Gamma_N} \boldsymbol{v} \cdot \boldsymbol{t} \, d\Gamma $$ Substitute $\boldsymbol{v}$ with $\boldsymbol{v}^h$ and consider that $\mathbf{A}\boldsymbol{c}\cdot\boldsymbol{b}=\boldsymbol{c}\cdot(\boldsymbol{A}^{\textrm{T}}\boldsymbol{b})$ we have: $$ \int_{\Gamma_N} \boldsymbol{v} \cdot \boldsymbol{t} \, d\Gamma = \int_{\Gamma_N} (\mathbf{N}(\boldsymbol{x})\boldsymbol{V}) \cdot \boldsymbol{t} \, d\Gamma = \int_{\Gamma_N} \boldsymbol{V} \cdot \mathbf{N}^{\textrm{T}}(\boldsymbol{x})\boldsymbol{t} \, d\Gamma $$ where the constant vector $\boldsymbol{V}$ can be extracted from the integral: $$ \boldsymbol{V} \cdot \int_{\Gamma_N} \mathbf{N}^{\textrm{T}}(\boldsymbol{x})\boldsymbol{t} d\Gamma $$ Then we can identify the expression for the traction force vector contribution to the right-hand side vector: $$ \mathbf{F}_{\text{traction}} = \int_{\Gamma_N} \mathbf{N}^{\textrm{T}}(\boldsymbol{x})\boldsymbol{t} d\Gamma $$