Nonlinear energy functionals appearing in the calculus of variations can be discretized by the finite element (FE) method and formulated as a sum of energy contributions from local elements. A fast evaluation of energy functionals containing the first order gradient terms is a central part of this contribution. We describe a vectorized implementation using the simplest P1 elements in which all energy contributions are evaluated all at once without the loop over triangular or tetrahedral elements. Furthermore, in connection to the first-order optimization methods, the discrete gradient of the energy functional is assembled in a way that gradient components are evaluated over all degrees of freedom all at once. The key ingredient is the vectorization of exact or approximate energy gradients over nodal patches. It leads to a time-efficient implementation at higher memory-cost. Provided codes in MATLAB related to 2D/3D hyperelasticity and 2D p-Laplacian problem are available for download and structured in a way it can be easily extended to other types of vector or scalar forms of energies.
翻译:在变异微分中出现的非线性能源功能可以通过有限元素(FE)方法分解,并以当地元素的能量贡献总和来拟订。快速评估含有第一顺序梯度术语的能源功能是这一贡献的一个核心部分。我们用简单的P1元素描述矢量化实施,其中所有能量贡献都一次性评价,而没有三角或四面形元素的循环。此外,在第一阶优化方法方面,能源功能的离子梯度的组装方式是,对梯度组件进行一次性评估,对所有自由度的所有度进行评估。关键成分是节点段的精确或近似能量梯度进行矢量化,导致在更高的记忆成本下实现时间效率化。在MATLAB中提供了与2D/3D超弹性和2D p-placeacian 问题有关的代码,可以下载,并可以很容易地将其扩展至其他类型的矢量或量度形式的能源。