I am looking for a good Julia FEM package. I have found the Gridap and Ferrite packages. What are the pros and cons of using either of these packages?
I am particularly interested in doing calculations in the mechanical field and the customisability of some of the functionalities.
first a disclaimer: I am one of the devs involved in Ferrite, so my view is biased.
Right now the biggest difference between Gridap and Ferrite is the abstraction level. Ferrite is a low-level framework delivering the building blocks to develop grid-based discretizations and it is designed to be hackable. Gridap on the other side has a very nice high level interface to specify forms for your problem, which is more like FEniCS (but still distinct from FEniCS). Furthermore, since this also might be important, Gridap has objectively better support for distributed assembly right now , but Ferrite is catching up. It should also be noted that having this higher level of abstraction comes at a cost: It can make the customization of some aspects more complicated. So I think this breaks down to which exact functionality you want to customize.
Another difference which can be immediately notices is that Gridap.jl is closer to the mathematical formulation of the problems while Ferrite.jl is closer to the algorithmic treatment of the problems.
Finally, if you want to focus in mechanical problems, a starter might be to take a look at the hyperelasticity examples (both on the dev branches).
From my very subjective perspective, having the manual element and material routines (and the tight Tensors.jl integration) feels more natural for problems in mechanics.
I also want to highlight that (taken from the note) the Gridap example seems to be a work in progress. It would be nice if one of the Gridap devs could comment on this (and maybe supplement if I missed something). Anyway, I think both example could be more polished. Which of these things are actual “pro” and “contra” (or irrelevant) for the user is subjective to what they want to do and what their preferences regarding the view on finite elements is.
From what I can see, Ferrite is a classical “deal.ii-like” Julia implementation of FEM.
Gridap design is different, it relies on lazy maps applied to cell arrays, which is what you need in FEM. You can find more on the design in this article Some of the benefits of this is the ability to leverage the JIT Julia compiler to create a powerful high-level API, i.e., not exposing the cell loop in the driver, etc.
Just one correction: Gridap is completely hackable by design. As an example, you can take a look at Tutorial 13. When you understand the abstractions, you can access Gridap at multiple levels, not just the highest-level API.
The hyperelasticity solver is fully functional, the missing part is the text, but I think it is very easy to understand what it is doing. I think the best approach is to compare the two drivers mentioned above and check which one better fits your purpose.
What kind of problems do you want to solve? Material nonlinearities? …