In finite element calculations, the integral forms are usually evaluated using nested loops over elements, and over quadrature points. Many such forms (e.g. linear or multi-linear) can be expressed in a compact way, without the explicit loops, using a single tensor contraction expression by employing the Einstein summation convention. To automate this process and leverage existing high performance codes, we first introduce a notation allowing trivial differentiation of multi-linear finite element forms. Based on that we propose and describe a new transpiler from Einstein summation based expressions, augmented to allow defining multi-linear finite element weak forms, to regular tensor contraction expressions. The resulting expressions are compatible with a number of Python scientific computing packages, that implement, optimize and in some cases parallelize the general tensor contractions. We assess the performance of those packages, as well as the influence of operand memory layouts and tensor contraction paths optimizations on the elapsed time and memory requirements of the finite element form evaluations. We also compare the efficiency of the transpiled weak form implementations to the C-based functions available in the finite element package SfePy.
翻译:在有限元素计算中,集成形式通常使用元素和二次点的嵌套环状来评估。许多此类形式(如线性或多线性)可以通过使用爱因斯坦总和公约,使用单一的发压收缩表达式,在不显眼的环状下,使用单一的发压收缩表达式,使用爱因斯坦总和表达式上嵌入的圆圈来表示。为了使这一过程自动化并利用现有的高性能代码,我们首先引入一个标记,允许对多线性元素的多线性元素形式进行细微的区分。根据我们提议和描述一种基于爱因斯坦总和度的表达式的新的转移入器,加以扩充,以便定义多线性有限元素的弱形式,到普通的发音缩缩缩表达式。由此产生的表达式与若干Python科学计算包是兼容的,这些套件是执行、优化的,有时是将一般的发缩缩缩缩。我们评估这些套件的性,以及软质记忆布局和收缩路径优化对时间和缩式形式评价的记忆要求的影响。我们还比较了变弱形式执行效率与限制元素包SfePy中可用的C基于功能的功能的功能的功能。