用向量语言汇编有限元矩阵的一种有效方法
An efficient way to assemble finite element matrices in vector languages
摘要:
最近已经提出了有效的Matlab代码在2D和3D组装有限元矩阵。在本文中,我们提出了简单,紧凑和有效的矢量化算法,这是这些代码的变体,在任意维,而不使用任何较低级别的语言。它们可以很容易地在许多矢量语言中实现(例如Matlab,Octave,Python,Scilab,R,Julia,C++ with STL,...)。这些技术的原理是普遍的,我们提出了它的组装的几个有限元矩阵在任意维,在P1有限元的情况下。我们还提供了一个扩展的算法的情况下,系统的偏微分方程的。然后我们给出了高阶分段多项式的一个推广。我们数值比较了这些算法在Matlab,Octave和Python中的性能,在FreeFEM++和编译语言如C中的性能。实例表明,与通常认为的不同,性能并没有从根本上比C更差:在最好/最坏的情况下,所选择的矢量语言在标量和矢量情况下分别比C慢2.3/3.5和2.9/4.1倍。我们还提出了数值结果,说明这些算法的计算成本相比,标准算法和其他最近的。
英文摘要:
Efficient Matlab codes in 2D and 3D have been proposed recently to assemble finite element matrices. In this paper we present simple, compact and efficient vectorized algorithms, which are variants of these codes, in arbitrary dimension, without the use of any lower level language. They can be easily implemented in many vector languages (e.g. Matlab, Octave, Python, Scilab, R, Julia, C++ with STL,...). The principle of these techniques is general, we present it for the assembly of several finite element matrices in arbitrary dimension, in the P1 finite element case. We also provide an extension of the algorithms to the case of a system of PDE's. Then we give an extension to piecewise polynomials of higher order. We compare numerically the performance of these algorithms in Matlab, Octave and Python, with that in FreeFEM++ and in a compiled language such as C. Examples show that, unlike what is commonly believed, the performance is not radically worse than that of C : in the best/worst cases, selected vector languages are respectively 2.3/3.5 and 2.9/4.1 times slower than C in the scalar and vector cases. We also present numerical results which illustrate the computational costs of these algorithms compared to standard algorithms and to other recent ones.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。