Abstract This paper deals with the efficient implementation of the finite element method with continuous piecewise linear functions (P1-FEM) in R d \mathbb{R}^{d} ( d ∈ N d\in\mathbb{N} ). Although at present there does not seem to be a very high practical demand for finite element methods that use higher-dimensional simplicial partitions, there are some advantages in studying the efficient implementation of the method independent of the dimension. For instance, it provides additional insights into necessary data structures and the complexity of implementations. Throughout, the focus is on an efficient realization using Matlab built-in functions and vectorization. The fast and vectorized Matlab function can be easily implemented in many other vector languages and is provided in Julia, too. The complete implementation of the adaptive FEM is given, including assembling stiffness matrix, building load vector, error estimation, and adaptive mesh-refinement. Numerical experiments underline the efficiency of our freely available code which is observed to be of a slightly more than linear complexity with respect to the number of elements when memory limits are not exceeded.
Read full abstract