Journals / Turkish Journal of Electrical Engineering and Computer Sciences / 2018 / Cilt: 26 - Sayı: 6

Rapid translation of finite-element theory into computer implementation based on a descriptive object-oriented programming approach

Pages
3367–3382
DOI
—

Abstract

In this study, we present a framework for rapid prototyping of finite element (FE) theory for computerimplementations. For this purpose, we propose an object-oriented (OO) application programming interface in the formof a domain-specific modeling language (DSML). In contrast to the traditional OO approach, the proposed frameworkdeliberately avoids the use of subclassing for concrete implementations of node and element classes; it uses externalobjects, namely descriptors, instead. The descriptive design of the DSML provides developers with generic programmingsupport for the construction and solution of discretization schemes, in the context of partial differential equations, ina self-explanatory syntax. We take advantage of Python’s descriptor protocol to make descriptors behave like naturaldependencies of their owner class. We propose several descriptors to account for both theoretical and implementationspecific aspects of FE programming. By using concrete examples, we demonstrate that enhancing these descriptorswith both symbolic and numerical computational utilities results in a concise and customizable code base for analysisand pre/postprocessing purposes. We select Python as the base programming language because of its support foressential programming features such as customizable classes, dynamic code, arbitrary arguments, method decoration,and descriptor protocol.