We present the software design of Gridap, a novel finite element library written exclusively in the Julia programming language, which is being used by several research groups world-wide to simulate complex physical phenomena such as magnetohydrodynamics, photonics, weather modeling, non-linear solid mechanics, and fluid-structure interaction problems. The library provides a feature-rich set of discretization techniques for the numerical approximation of a wide range of PDEs, including linear, nonlinear, single-field, and multi-field equations. An expressive API allows users to define PDEs in weak form by a syntax close to the mathematical notation. While this is also available in previous codes, the main novelty of Gridap is that it implements this API without introducing a DSL plus a compiler of variational forms. Instead, it leverages the Julia just-in-time compiler to build efficient code, specialized for the concrete problem at hand. As a result, there is no need to use different languages for the computational back-end and the user front-end anymore, thus eliminating the so-called two-language problem. Gridap also provides a low-level API that is modular and extensible via the multiple-dispatch paradigm of Julia and provides easy access to the main building blocks of the library. The main contribution of this paper is the detailed presentation of the novel software abstractions behind the Gridap design that leverages the new software possibilities provided by the Julia language. The second main contribution of the article is a performance comparison against FEniCS. We measure CPU times needed to assemble discrete systems of linear equations for different problem types and show that the performance of Gridap is comparable to FEniCS, demonstrating that the new software design does not compromise performance. Gridap is freely available at Github and distributed under an MIT license.
翻译:我们展示了Gridap的软件设计,Gridap是专门用Julia编程语言书写的新颖的有限元素库,全世界一些研究团体正在使用Gridap的软件设计来模拟复杂的物理现象,例如磁力动力学、光子、气象模型、非线性固态机械学和流体结构互动问题。图书馆提供了一套内容丰富的离散技术,用于大量PDE的数值近似,包括线性、非线性、单字段和多域方程式。一个直观的API使用户能够通过接近数学符号的同步税来以弱的形式定义PDEs。虽然在以往的代码中也有这一功能,但Gridap的主要创新是,它实施API,而没有引入 DSL,而是利用 Julia 即时的编程编程来建立高效的代码,专门处理眼前的具体问题。因此,不需要使用不同的语言来进行计算后端和用户前端的计算,从而消除所谓的二种直径直线性能的版本。Gripalal-lial dreal lialalalal lial lial lial deal deal ex ex ex ex ex laut the laut the laut the laut the lax lax lift lip lip lip lip lip lip lipaldaldald lip lip lax lipald lipaldaldaldal labildaldaldaldaltisteut li a lip lade lipaldaldaldaldaldaldaldaldaldaldaldaldaldaldaldaldaldaldaldal madaldaldaldaldalds lads ladaldalds labaldaldaldal ladaldaldaldaldaldal lautdaldaldaldaldaldaldaldaldaldaldaldaldaldaldaldaldaldaldaldaldaldaldaldal