Application of the Grid-Operator Approach for Efficient Implementation of Explicit Finite Difference Schemes

Autor: Evgenii Borisovich Savenkov, Vladislav Aleksandrovich Balashov, M. M. Krasnov
Rok vydání: 2021
Předmět:
Zdroj: Mathematical Models and Computer Simulations. 13:831-843
ISSN: 2070-0490
2070-0482
DOI: 10.1134/s2070048221050148
Popis: This study is devoted to the description of the application of the grid-operator approach to programming, which allows, on the one hand, concisely writing mathematical formulas over grid functions in program texts through the use of programmed grid operators similar to mathematical operators and, on the other hand, easily transferring programs to CUDA graphics accelerators by almost simple recompilation. The grid-operator approach to programming makes extensive use of expression templates, based on metaprogramming of the C++ language templates, for the programmatic implementation of grid operators. Grid operators can be applied to grid expressions to create new grid expressions. This approach allows recursively constructing grid expressions of any complexity. In fact, calculations are started only when the grid expression is assigned to the grid function; before that, the chain of calculations is simply stored in the grid expression. Thus, the concept of lazy computation is implemented. This paper shows how this approach can be used to implement a rather complex algorithm that uses mesh functions on different mesh elements (cells, vertices, faces). Due to the use of grid operators, the software implementation of rather complex formulas becomes as transparent as the corresponding mathematical expressions.
Databáze: OpenAIRE