Vectorized numerical algorithms for the solution of continuum mechanics problems
https://doi.org/10.17586/2226-1494-2022-22-1-193-205
Abstract
The aim of the work is to study the possibilities provided by new information technologies, object-oriented programming tools and modern operating systems for solving boundary value problems of continuum mechanics described by partial differential equations. To discretize the basic equations, we applied the method of finite differences and finite volumes, which are widely used to solve problems in the mechanics of liquids and gases. The paper considers the implementation of the finite difference methods and the finite volume method with vectorized grid structures, including access to the inner and boundary cells of the grid, as well as the features of the implementation of algorithms at singular points of the computational domain. To solve boundary value problems described by partial differential equations, we developed an approach to the construction of vectorized algorithms and considered the features of their software implementation in the MATLAB package. Vectorization in such tasks, excluding nested loops, is ensured by appropriate data organization and the use of vectorized operations. On the one hand, the developed algorithms widely use MATLAB functions designed for processing vectors and sparse matrices, and on the other hand, they are distinguished by high efficiency and computation speed, comparable to those of programs written in C/C++. The main results imply the numerical solution of a number of problems in continuum mechanics associated with the calculation of stresses in a separate body and the calculation of the field of velocity and temperature in the flow of a viscous incompressible fluid. The features of discretization of the basic equations and the implementation of the corresponding finite-difference and finite-volume algorithms are shown. The use of the MATLAB system opens up new possibilities for the formalization and implementation of finite-difference and finite-volume methods for the numerical solution of boundary value problems in continuum mechanics. Despite the fact that the capabilities of the developed algorithms are illustrated by the example of solving fairly simple problems, they admit a relatively simple generalization to more complex problems, for example, solving the Euler equations and Navier–Stokes equations. As part of the work, computational modules were prepared with user programming tools that expand the capabilities of the package and are focused on solving problems in continuum mechanics.
About the Authors
N. A. BrykovRussian Federation
Nikita A. Brykov — PhD, Associate Professor, Associate Professor
sc 57209849110
Saint Petersburg, 190005
K. N. Volkov
Russian Federation
Konstantin N. Volkov — D.Sc., Leading Researcher
sc 8663950000
Saint Petersburg, 190005
V. N. Emelyanov
Russian Federation
Vladislav N. Emelyanov — D.Sc., Full Professor
sc 7004697417
Saint Petersburg, 190005
References
1. Kozelk ov A.S., Deriugin Iu.N., Zelenskii D.K., Glazunov V.A., Golubev A.A., Denisova O.V., Lashkin S.V., Zhuchkov R.N., Tarasova N.V., Sizova M.A. Multifunctional software package LOGOS for the problems of hydrodynamics and heat and mass transfer on a supercomputer. Basic technologies and algorithms. Proc. of the 12th International seminar “Supercomputing and mathematic modeling”. Sarov, 2010, pp. 215–230. (in Russian)
2. Volkov K.N., Derugin Yu.N., Emelyanov V.N., Karpenko A.G., Kozelkov A.S., Smirnov P.G., Teterina I.V. Implementation of parallel calculations on graphics processor units in the LOGOS computational fluid dynamics package. Numerical Methods and Programming, 2013, vol. 14, no. 1, pp. 334–342. (in Russian)
3. Emelyanov V.N., Brykov N.A., Efremov A.V. Application of vectorized algorithms for solving problems of continuum mechanics. Journal of Physics: Conference Series, 2021, vol. 2094, pp. 022047. https://doi.org/10.1088/1742-6596/2094/2/022047
4. Emelianov V.N. Mechanics of Continuous Media: Strain Theory and Main Models. Moscow, Jurait Publ., 2018, 162 p. (in Russian)
5. Emelianov V.N. Numerical Methods: An Introduction to the Theory of Difference Schemes. Moscow, Jurajt Publ., 2018, 188 p. (in Russian)
6. Gergel V.P. Theory and Practice of Parallel Computations. Moscow, BINOM Publ., 2010, 432 p. (in Russian)
7. Volkov K.N., Emelianov V.N. Application of MATLAB for the solution of boundary-value problems of liquid and gas mechanics. Proc. of All-Russian scientific conference “Of Research and Engineering Applications in MATLAB”. Moscow, ICS RAS Publ., 2004, pp. 92–115. (in Russian)
8. Volkov K.N., Emelyanov V.N. Implementation of vectorized finitedifference algorithms for solving boundary value problems of fluid and gas mechanics with MATLAB package. Numerical Methods and Programming, 2004, vol. 5, no. 3, pp. 13–29. (in Russian)
9. Alberty J., Carstensen C., Funken S.A. Remarks around 50 lines of Matlab: short finite element implementation // Numerical Algorithms. 1999. V. 20. N 1-2. P. 117–137. https://doi.org/10.1023/A:1019155918070
10. Persson P.-O., Strang G. A simple mesh generation in MATLAB // SIAM Review. 2004. V. 46. N 2. P. 329–345. https://doi.org/10.1137/S0036144503429121
11. Koko J. Vectorized MATLAB codes for linear two-dimensional elasticity // Scientific Programming. 2007. V. 15. N 3. P. 157–172. https://doi.org/10.1155/2007/838942
12. Funken S., Praetorius D., Wissgott P. Efficient implementation of adaptive P1-FEM in MATLAB // Computational Methods in Applied Mathematics. 2011. V. 11. N 4. P. 460–490. https://doi.org/10.2478/cmam-2011-0026
13. Rahman T., Valdman J. Fast MATLAB assembly of FEM matrices in 2D and 3D: nodal elements // Applied Mathematics and Computation. 2013. V. 219. N 13. P. 7151–7158. https://doi.org/10.1016/j.amc.2011.08.043
14. Anjam I., Valdman J. Fast MATLAB assembly of FEM matrices in 2D and 3D: edge elements // Applied Mathematics and Computation. 2015. V. 267. P. 252–263. https://doi.org/10.1016/j.amc.2015.03.105
15. Koko J. Fast MATLAB assembly of fem matrices in 2D and 3D using cell-array approach // International Journal of Modeling, Simulation, and Scientific Computing. 2016. V. 7. N 2. P. 1650010. https://doi.org/10.1142/S1793962316500100
16. Walker S.W. FELICITY: a MATLAB/C++ toolbox for developing finite element methods and simulation modeling // SIAM Journal on Scientific Computing. 2018. V. 40. N 2. P. 234–257. https://doi.org/10.1137/17M1128745
17. Čermák M., Sysala S., Valdman J. Efficient and flexible MATLAB implementation of 2D and 3D elastoplastic problems // Applied Mathematics and Computation. 2019. V. 355. P. 595–614. https://doi.org/10.1016/j.amc.2019.02.054
18. Tsega E.G. A finite volume solution of unsteady incompressible Navier–Stokes equations using MATLAB // Numerical and Computational Methods in Sciences and Engineering. 2019. V. 1. N 3. P. 117–131. http://dx.doi.org/10.18576/ncmsel/010302
19. Годунов С.К., Забродин А.В., Иванов М.Я., Крайко А.Н., Прокопов Г.П. Численное решение многомерных задач газовой динамики. М.: Наука, 1976. 400 с.
20. Volkov K.N., Emelianov V.N. Computational Technologies in the Problems of Fluid and Gas Mechanics. Moscow, Fizmatlit Publ., 2012, 468 p. (in Russian)
21. Lure A.I. Theory of Elasticity. Moscow, Nauka Publ., 1970, 940 p. (in Russian)
Review
For citations:
Brykov N.A., Volkov K.N., Emelyanov V.N. Vectorized numerical algorithms for the solution of continuum mechanics problems. Scientific and Technical Journal of Information Technologies, Mechanics and Optics. 2022;22(1):193-205. (In Russ.) https://doi.org/10.17586/2226-1494-2022-22-1-193-205