Comparison between FEniCSx and MFEM

Hello FEniCSx community,

I am wondering what you think about MFEM. At first glance, it looks like a very powerful open source finite element software. Their website contains many examples, that are generally split between serial and multithreading. They don’t seem much more complicated than their FEniCS counterparts.

Apparently it also uses the GPU. As well as many types of different kinds of finite elements. It seems very modern and powerful. The syntax doesn’t seem too complicated either, but it is c plus plus only, whereas FEniCSx has a nicer Python interface.

It apparently also has a meshing support, but I’m not sure how it compared to gmsh. I think it can handle mesh files generated by gmsh, too, like FEniCSx.

Do you have an idea if/when it is better suited to use MFEM compared to FEniCSx? I haven’t found any comparison between the two, on the Internet.

Just having a quick look at it, their weak form is constructed from predefined Integrator terms, MFEM - Finite Element Discretization Library . From my perspective that restricts the generality of the toolkit, making it harder to apply to a system that’s not already in the list. It also obfuscates the presentation of the weak form a little, making it harder to align with the pure mathematical description.

1 Like

See FEniCS vs. MOOSE - #3 by garth

5 Likes

Thanks and sorry, I do not want to spark anything impolite. I just wanted an objective comparison. If not by the devs then, by the users, like dparsons provided, his answer is very informative, to me at least.

2 Likes

I agree, I used MFEM for some time. I like C++ and, for me, the fact that MFEM is based on this language is not a drawback, it is almost a plus.

But we were researching in new Galerkin schemes, some of them not simple at all (like those in GitHub - danielacos/Papers-src: Open source code used for the simulations shown in the published papers that I have co-authored. and others). They did not fit any of the predefined examples in MFEM and we found that introducing important variations in these examples is not easy.

On the other hand, like to @deparsons, I like the sintaxis of Fenics because it is close to the mathematical description of the PDE.

1 Like

Note that DOLFINx is also based on C++ and has a Python interface. MFEM also has a Python interface, GitHub - mfem/PyMFEM: Python wrapper for MFEM

I am not going to dive into any further comparison of the two frameworks for the reasons sketched out in Comparison between FEniCSx and MFEM - #3 by nate

2 Likes