Fri. Dec 26th, 2025

Introduction

In the past, I compared computational cost between Skfem(Scikit-fem) and Ngsolve. Without doing experiments, I had already known the superiority of Ngsolve in terms this point, but I was unsure how much difference there is between them. What I found is that Scikit-fem is not so compettive with Ngsolve, but not super bad.

But I felt like, I want to have other option for solving heavier tasks. For sure we can use Ngsolve, but C++ language is NOT user friendly. Even though we have Python interface to access Ngsolve, the flexibility is limited.

To compare with other option, “Gridap” which I introduced before, I implemented script that solve FEM on the same task with Gridap.

Result

This is what I really wanted😊

However, it should be noted that these results correspond to a warm start (i.e., the second and subsequent runs). During the first execution, JIT compilation is performed, which consumes computational resources in addition to the actual numerical calculation. As a result, the first run takes a total of 51.6 seconds, whereas subsequent runs are accelerated to under 2 seconds.

While Gridap already offers advantages such as convenient handling of I/O and integration with various packages, this study shows that it also delivers excellent computational performance.

In addition, I had forgotten to mention that Gridap also supports automatic differentiation.