doi: 10.17586/2226-1494-2022-22-1-193-205


Vectorized numerical algorithms for the solution of continuum mechanics problems
 

N. A. Brykov, K. N. Volkov, V. N. Emelyanov


Read the full article  ';
Article in Russian

For citation:
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, vol. 22, no. 1, pp. 193–205 (in Russian). doi: 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.


Keywords: mathematical modeling, vectorization, numerical algorithm, mechanics of continuum medium

Acknowledgements. The research was supported by the Russian Science Foundation (project No. 21-19-00657), https://rscf.ru/en/project/21-19-00657/.

References
  1. KozelkovA.S., DeriuginIu.N., ZelenskiiD.K., GlazunovV.A., GolubevA.A., DenisovaO.V., LashkinS.V., ZhuchkovR.N., TarasovaN.V., SizovaM.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. EmelyanovV.N., BrykovN.A., EfremovA.V. Application of vectorized algorithms for solving problems of continuum mechanics. Journa lof Physics: ConferenceSeries, 2021, vol. 2094, pp. 022047. https://doi.org/10.1088/1742-6596/2094/2/022047
  4. EmelianovV.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 finite-difference 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, vol. 20, no. 1-2, pp. 117–137. https://doi.org/10.1023/A:1019155918070
  10. Persson P.-O., Strang G. A simple mesh generation in MATLAB. SIAM Review, 2004, vol. 46, no. 2, pp. 329–345. https://doi.org/10.1137/S0036144503429121
  11. Koko J. Vectorized MATLAB codes for linear two-dimensional elasticity. Scientific Programming, 2007, vol. 15, no. 3, pp. 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, vol. 11, no. 4, pp. 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, vol. 219, no. 13, pp. 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, vol. 267, pp. 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, vol. 7, no. 2, pp. 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, vol. 40, no. 2, pp. 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, vol. 355, pp. 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, vol. 1, no. 3, pp. 117–131. http://dx.doi.org/10.18576/ncmsel/010302
  19. Godunov S.K., Zabrodin A.V., Ivanov M.Ia., Kraiko A.N., Prokopov G.P. Numerical Solutions of Multidimensional Problems of Gas Dynamics. Moscow, Nauka Publ., 1976, 400 p. (in Russian)
  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)


Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License
Copyright 2001-2024 ©
Scientific and Technical Journal
of Information Technologies, Mechanics and Optics.
All rights reserved.

Яндекс.Метрика