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

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...

Full description

Saved in:
Bibliographic Details
Published in:Mathematical models and computer simulations Vol. 13; no. 5; pp. 831 - 843
Main Authors: Krasnov, M. M., Balashov, V. A., Savenkov, E. B.
Format: Journal Article
Language:English
Published: Moscow Pleiades Publishing 2021
Springer Nature B.V
Subjects:
Online Access:Get full text
Tags: Add Tag
No Tags, Be the first to tag this record!
Description
Summary: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.
ISSN:2070-0482
2070-0490
DOI:10.1134/S2070048221050148