arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2107.04121cs.MScs.NAmath.NA
收藏

使用Python张量压缩包快速计算有限元弱形式

Fast Evaluation of Finite Element Weak Forms Using Python Tensor Contraction Packages

Robert Cimrman

摘要:

在有限元计算中,积分形式通常使用元素上的嵌套循环和求积点来计算。许多这样的形式(例如线性或多线性)可以用一种紧凑的方式表示,没有显式循环,使用单个张量收缩表达式,采用爱因斯坦求和约定。为了自动化这个过程,并利用现有的高性能代码,我们首先介绍了一个符号,允许平凡的多线性有限元形式的差异。在此基础上,我们提出并描述了一个新的转译器从爱因斯坦求和为基础的表达式,扩大到允许定义多线性有限元弱形式,定期张量收缩表达式。得到的表达式与许多Python科学计算包兼容,这些包实现、优化并在某些情况下并行化一般张量收缩。我们评估这些软件包的性能,以及操作数内存布局和张量收缩路径优化对所用时间和内存要求的有限元形式评估的影响。我们还比较了编译的弱形式实现的效率,以C为基础的功能,在有限元包SfePy。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑