Table of Contents
Fetching ...

Vectorized implementation of primal hybrid FEM in MATLAB

Harish Nagula Mallesham, Kamana Porwal, Jan Valdman, Sanjib Kumar Acharya

TL;DR

This work delivers a vectorized MATLAB framework for the lowest-order primal hybrid finite element method in 2D, addressing both elliptic and parabolic problems with mixed boundary conditions. By vectorizing edge generation, mesh refinement, and global assembly (including $\mathbb{B}$, $\mathbb{D}$, $\mathbb{M}$, and $\mathbb{C}$), it achieves scalable performance, with Crank-Nicolson time stepping used for parabolic problems. The authors provide detailed algorithmic descriptions and MATLAB implementations ($\texttt{StiffMassConv\_PH.m}$, $\texttt{Lambda\_PH.m}$, $\texttt{load\_t.m}$, etc.), along with numerical results that indicate near-linear time scaling and optimal spatial convergence. This vectorized approach yields a practical, extensible tool for high-performance simulations and sets the stage for extensions to nonlinear problems and 3D domains.

Abstract

We present efficient MATLAB implementations of the lowest-order primal hybrid finite element method (FEM) for linear second-order elliptic and parabolic problems with mixed boundary conditions in two spatial dimensions. We employ the Crank-Nicolson finite difference scheme for the complete discrete setup of the parabolic problem. All the codes presented are fully vectorized using matrix-wise array operations. Numerical experiments are conducted to show the performance of the software.

Vectorized implementation of primal hybrid FEM in MATLAB

TL;DR

This work delivers a vectorized MATLAB framework for the lowest-order primal hybrid finite element method in 2D, addressing both elliptic and parabolic problems with mixed boundary conditions. By vectorizing edge generation, mesh refinement, and global assembly (including , , , and ), it achieves scalable performance, with Crank-Nicolson time stepping used for parabolic problems. The authors provide detailed algorithmic descriptions and MATLAB implementations (, , , etc.), along with numerical results that indicate near-linear time scaling and optimal spatial convergence. This vectorized approach yields a practical, extensible tool for high-performance simulations and sets the stage for extensions to nonlinear problems and 3D domains.

Abstract

We present efficient MATLAB implementations of the lowest-order primal hybrid finite element method (FEM) for linear second-order elliptic and parabolic problems with mixed boundary conditions in two spatial dimensions. We employ the Crank-Nicolson finite difference scheme for the complete discrete setup of the parabolic problem. All the codes presented are fully vectorized using matrix-wise array operations. Numerical experiments are conducted to show the performance of the software.
Paper Structure (19 sections, 59 equations, 7 figures, 5 tables)

This paper contains 19 sections, 59 equations, 7 figures, 5 tables.

Figures (7)

  • Figure 1: A pair of adjacent triangles $(T_+, T_-)$ with a common edge $E=\partial T_+\cap T_-$, initial node $A$, end node $B$ and outward unit normal $\nu_E=\nu_{T_+}$.
  • Figure 2: Depiction of a general numbering of edges in a mesh with two adjacent triangles.
  • Figure 3: Depiction of initial (level 0) triangulation (left) and the corresponding edges generated (right).
  • Figure 4: Geometrical representation of I, J, and S vectors in MATLAB.
  • Figure 10: Example of (level 4, $h=1/16$) red-refined mesh used in computations of both elliptic and parabolic models. Red-colored sides denote $\Gamma_N$.
  • ...and 2 more figures

Theorems & Definitions (6)

  • Example 1
  • Remark 1
  • Definition 3.1
  • Example 2
  • Remark 3
  • Example 3