A grid-operator framework for efficient implementation of explicit finite difference schemes
Matematičeskoe modelirovanie, Tome 33 (2021) no. 2, pp. 20-40.

Voir la notice de l'article provenant de la source Math-Net.Ru

Current paper is devoted to the description of the mesh-operator programming technique. The approach allows for short implementation of mathematical formulas in source code using programming language operators similar to mathematical ones and, at the same moment, provides portable implementation suitable for both CPU and CPU/GPGPU hardware. Mesh-operator programming is based on expression templates metaprogramming technique to construct C++ expression to implement mesh operators. In turn, mesh operators can be applied to mesh data structures to construct more complex mesh operators. Such an approach allows to perform an arbitrarily complex computations with the mesh functions. In fact, computations are performed in the delayed fashion, i.e., the actual numerical values are computed only when the mesh expression is assigned to the mesh function. In this paper we show how such an approach can be applied to the efficient implementation of the relatively complex algorithm which utilizes mesh functions defined on different elements of the mesh, i.e., cells, faces, etc. Using mesh-operator technique, the implementation is kept simple and formulas in the code looks practically as simple as in mathematical notation.
Mots-clés : C++
Keywords: template metaprogramming, finite difference schemes, operator library, stencil computations.
@article{MM_2021_33_2_a1,
     author = {M. M. Krasnov and V. A. Balashov and E. B. Savenkov},
     title = {A grid-operator framework for efficient implementation of explicit finite difference schemes},
     journal = {Matemati\v{c}eskoe modelirovanie},
     pages = {20--40},
     publisher = {mathdoc},
     volume = {33},
     number = {2},
     year = {2021},
     language = {ru},
     url = {http://geodesic.mathdoc.fr/item/MM_2021_33_2_a1/}
}
TY  - JOUR
AU  - M. M. Krasnov
AU  - V. A. Balashov
AU  - E. B. Savenkov
TI  - A grid-operator framework for efficient implementation of explicit finite difference schemes
JO  - Matematičeskoe modelirovanie
PY  - 2021
SP  - 20
EP  - 40
VL  - 33
IS  - 2
PB  - mathdoc
UR  - http://geodesic.mathdoc.fr/item/MM_2021_33_2_a1/
LA  - ru
ID  - MM_2021_33_2_a1
ER  - 
%0 Journal Article
%A M. M. Krasnov
%A V. A. Balashov
%A E. B. Savenkov
%T A grid-operator framework for efficient implementation of explicit finite difference schemes
%J Matematičeskoe modelirovanie
%D 2021
%P 20-40
%V 33
%N 2
%I mathdoc
%U http://geodesic.mathdoc.fr/item/MM_2021_33_2_a1/
%G ru
%F MM_2021_33_2_a1
M. M. Krasnov; V. A. Balashov; E. B. Savenkov. A grid-operator framework for efficient implementation of explicit finite difference schemes. Matematičeskoe modelirovanie, Tome 33 (2021) no. 2, pp. 20-40. http://geodesic.mathdoc.fr/item/MM_2021_33_2_a1/

[1] NVidia CUDA http://www.nvidia.com/object/cuda_home_new.html

[2] A. N. Andrianov, T. P. Baranova, A. B. Bugerya, K. N. Efimkin, “Raspredelenie vychislenij v gibridnyh vychislitel'nyh sistemah pri translyacii programm na yazyke NORMA”, Vych. met. programmirovanie, 20:3 (2019), 224–236 | DOI

[3] YAzyk programmirovaniya NORMA

[4] DVM sistema

[5] Blitz++ Library on SourceForge.net http://sourceforge.net/projects/blitz/

[6] Luis M. de la Cruz, Eduardo Ramos, “General template units for the finite volume method in boxshaped domains”, ACM Trans. Math. Softw., 43:1 (2016), 1, 32 pp. | DOI | MR

[7] M. M. Krasnov, “Operator library for solving multidimensional mathematical physics problems on CUDA”, Mat. Model., 27:3 (2015), 109–120 | Zbl

[8] M. M. Krasnov, Setochno-operatornyj podhod k programmirovaniyu zadach matematicheskoj fiziki, Avtoref. kand. diss.

[9] B. Stroustrup, The C++ Programming Language, v. 2, Fourth Edition, Addison-Wesley, 2013, 1368 pp.

[10] D. Abrahams, A. Gurtovoy, C++ Template Metaprogramming, Addison-Wesley, 2004, 388 pp.

[11] M. M. Krasnov, Metaprogrammirovanie shablonov C++ v zadachah matematicheskoj fiziki, IPM im. M.V. Keldysha, M., 2017, 84 pp. | MR

[12] T. Veldhuizen, “Expression Templates”, C++ Report, 7:5 (1995), 26–31

[13] J. O. Coplien, “Curiously Recurring Template Patterns”, C++ Report, 1995, 24–27 https://sites.google.com/a/gertrudandcope.com/info/Publications/InheritedTemplate.pdf

[14] D. Vandevoorde, N. M. Josuttis, C++ Templates: The Complete Guide, Addison-Wesley Professional, 2002, 560 pp.

[15] V. Balashov, A. Zlotnik, E. Savenkov, “Analysis of a regularized model for the isothermal two-component mixture with the diffuse interface”, Russian Journal on Numerical Analysis and Mathematical Modelling, 32:6 (2017), 347–358 | DOI | MR | Zbl

[16] V. Balashov, A. Zlotnik, “An energy dissipative spatial discretization for the regularized comp-ressible Navier-Stokes-Cahn-Hilliard system of equations”, Mathematical Modelling and Analysis, 25:1 (2020), 110–129 | DOI | MR

[17] gridmath on GitHub, https://github.com/kmm1965/mathlib