<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.3 20210610//EN" "JATS-journalpublishing1-3.dtd">
<article article-type="research-article" dtd-version="1.3" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="ru"><front><journal-meta><journal-id journal-id-type="publisher-id">ntv</journal-id><journal-title-group><journal-title xml:lang="ru">Научно-технический вестник информационных технологий, механики и оптики</journal-title><trans-title-group xml:lang="en"><trans-title>Scientific and Technical Journal of Information Technologies, Mechanics and Optics</trans-title></trans-title-group></journal-title-group><issn pub-type="ppub">2226-1494</issn><issn pub-type="epub">2500-0373</issn><publisher><publisher-name>Университет ИТМО</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.17586/2226-1494-2022-22-1-193-205</article-id><article-id custom-type="elpub" pub-id-type="custom">ntv-295</article-id><article-categories><subj-group subj-group-type="heading"><subject>Research Article</subject></subj-group><subj-group subj-group-type="section-heading" xml:lang="ru"><subject>МАТЕМАТИЧЕСКОЕ И КОМПЬЮТЕРНОЕ МОДЕЛИРОВАНИЕ</subject></subj-group><subj-group subj-group-type="section-heading" xml:lang="en"><subject>MODELING AND SIMULATION</subject></subj-group></article-categories><title-group><article-title>Использование векторизованных структур данных при реализации вычислительных алгоритмов решения задач механики сплошной среды</article-title><trans-title-group xml:lang="en"><trans-title>Vectorized numerical algorithms for the solution of continuum mechanics  problems</trans-title></trans-title-group></title-group><contrib-group><contrib contrib-type="author" corresp="yes"><contrib-id contrib-id-type="orcid">https://orcid.org/0000-0002-3568-7522</contrib-id><name-alternatives><name name-style="eastern" xml:lang="ru"><surname>Брыков</surname><given-names>Н. А.</given-names></name><name name-style="western" xml:lang="en"><surname>Brykov</surname><given-names>N. A.</given-names></name></name-alternatives><bio xml:lang="ru"><p>Брыков Никита Александрович — кандидат технических наук, доцент, доцент</p><p>sc 57209849110</p><p>Санкт-Петербург, 190005</p></bio><bio xml:lang="en"><p>Nikita A. Brykov — PhD, Associate Professor, Associate Professor</p><p>sc 57209849110</p><p>Saint Petersburg, 190005</p></bio><email xlink:type="simple">brykovna@yandex.ru</email><xref ref-type="aff" rid="aff-1"/></contrib><contrib contrib-type="author" corresp="yes"><contrib-id contrib-id-type="orcid">https://orcid.org/0000-0001-6055-2323</contrib-id><name-alternatives><name name-style="eastern" xml:lang="ru"><surname>Волков</surname><given-names>К. Н.</given-names></name><name name-style="western" xml:lang="en"><surname>Volkov</surname><given-names>K. N.</given-names></name></name-alternatives><bio xml:lang="ru"><p>Волков Константин Николаевич — доктор физико-математических наук, ведущий научный сотрудник</p><p>sc 8663950000</p><p>Санкт-Петербург, 190005</p></bio><bio xml:lang="en"><p>Konstantin N. Volkov — D.Sc., Leading Researcher</p><p>sc 8663950000</p><p>Saint Petersburg, 190005</p></bio><email xlink:type="simple">k.volkov@kingston.ac.uk</email><xref ref-type="aff" rid="aff-1"/></contrib><contrib contrib-type="author" corresp="yes"><contrib-id contrib-id-type="orcid">https://orcid.org/0000-0002-7039-9948</contrib-id><name-alternatives><name name-style="eastern" xml:lang="ru"><surname>Емельянов</surname><given-names>В. Н.</given-names></name><name name-style="western" xml:lang="en"><surname>Emelyanov</surname><given-names>V. N.</given-names></name></name-alternatives><bio xml:lang="ru"><p>Емельянов Владислав Николаевич — доктор технических наук, профессор, профессор</p><p>sc 7004697417</p><p>Санкт-Петербург, 190005</p></bio><bio xml:lang="en"><p>Vladislav N. Emelyanov — D.Sc., Full Professor</p><p>sc 7004697417</p><p>Saint Petersburg, 190005</p></bio><email xlink:type="simple">vlademelyanov@gmail.com</email><xref ref-type="aff" rid="aff-1"/></contrib></contrib-group><aff-alternatives id="aff-1"><aff xml:lang="ru"><institution>Балтийский государственный технический университет «ВОЕНМЕХ» им. Д.Ф. Устинова</institution><country>Россия</country></aff><aff xml:lang="en"><institution>Baltic State Technical University “VOENMEH” named after D.F. Ustinov</institution><country>Russian Federation</country></aff></aff-alternatives><pub-date pub-type="collection"><year>2022</year></pub-date><pub-date pub-type="epub"><day>17</day><month>12</month><year>2024</year></pub-date><volume>22</volume><issue>1</issue><fpage>193</fpage><lpage>205</lpage><permissions><copyright-statement>Copyright &amp;#x00A9; Брыков Н.А., Волков К.Н., Емельянов В.Н., 2024</copyright-statement><copyright-year>2024</copyright-year><copyright-holder xml:lang="ru">Брыков Н.А., Волков К.Н., Емельянов В.Н.</copyright-holder><copyright-holder xml:lang="en">Brykov N.A., Volkov K.N., Emelyanov V.N.</copyright-holder><license xml:lang="ru" license-type="creative-commons-attribution" xlink:href="https://creativecommons.org/licenses/by/4.0/" xlink:type="simple"><license-p>Данная работа распространяется под лицензией Creative Commons Attribution 4.0.</license-p></license><license xml:lang="en" license-type="creative-commons-attribution" xlink:href="https://creativecommons.org/licenses/by/4.0/" xlink:type="simple"><license-p>This work is licensed under a Creative Commons Attribution 4.0 License.</license-p></license></permissions><self-uri xlink:href="https://ntv.elpub.ru/jour/article/view/295">https://ntv.elpub.ru/jour/article/view/295</self-uri><abstract><p>Предмет исследования. В работе выполнено исследование возможностей, предоставляемых новыми информационными технологиями, средствами объектно-ориентированного программирования и современными операционными системами, для решения краевых задач механики сплошной среды, описываемых дифференциальными уравнениями в частных производных. Для дискретизации основных уравнений применены методы конечных разностей и конечных объемов. Рассмотрена реализация данных методов с векторизованными сеточными структурами, включая обращение к внутренним и граничным ячейкам сетки, а также особенности реализации алгоритмов в особых точках расчетной области. Метод. Для решения краевых задач, описываемых дифференциальными уравнениями в частных производных, разработан подход к построению векторизованных алгоритмов и рассмотрены особенности их программной реализации в пакете MATLAB с использованием средств пользовательского программирования. Векторизация в таких задачах, для исключения вложенных циклов, обеспечена за счет организации данных и использования векторизованных операций обращения к сеточным узлам. Разработанные алгоритмы, с одной стороны, широко используют функции MATLAB, предназначенные для обработки векторов и разреженных матриц, а с другой, отличаются высокой эффективностью и скоростью счета. Основные результаты. Проведено численное решение ряда задач механики сплошной среды, связанных с расчетами напряжений в твердом теле, а также поля скорости и температуры в потоке вязкой несжимаемой жидкости. Показаны особенности дискретизации основных уравнений и реализации конечно-разностных и конечно-объемных алгоритмов. Практическая значимость. Применение системы MATLAB открыло широкие возможности по формализации и реализации конечно-разностных и конечно-объемных методов численного решения краевых задач механики сплошной среды. Несмотря на то, что возможности разработанных алгоритмов иллюстрируются на примере решения достаточно простых задач, они допускают сравнительно простое обобщение на более сложные задачи, например решение уравнений Эйлера и Навье–Стокса. В рамках работы подготовлены расчетные модули, реализованные при помощи средств пользовательского программирования, которые расширяют возможности пакета MATLAB и ориентированы на решение задач механики сплошной среды.</p></abstract><trans-abstract xml:lang="en"><p>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.</p></trans-abstract><kwd-group xml:lang="ru"><kwd>математическое моделирование</kwd><kwd>векторизация</kwd><kwd>численный алгоритм</kwd><kwd>механика сплошной среды</kwd></kwd-group><kwd-group xml:lang="en"><kwd>mathematical modeling</kwd><kwd>vectorization</kwd><kwd>numerical algorithm</kwd><kwd>mechanics of continuum medium</kwd></kwd-group><funding-group><funding-statement xml:lang="ru">Исследование выполнено за счет гранта Российского научного фонда № 21-19-00657, https://rscf.ru/ project/21-19-00657/.</funding-statement><funding-statement xml:lang="en">The research was supported by the Russian Science Foundation (project No. 21-19-00657), https://rscf.ru/en/project/21-19-00657/.</funding-statement></funding-group></article-meta></front><back><ref-list><title>References</title><ref id="cit1"><label>1</label><citation-alternatives><mixed-citation xml:lang="ru">Козелков А.С., Дерюгин Ю.Н., Зеленский Д.К., Глазунов В.А., Голубев А.А., Денисова О.В., Лашкин С.В., Жучков Р.Н., Тарасова Н.В., Сизова М.А. Многофункциональный пакет программ ЛОГОС для расчета задач гидродинамики и тепломассопереноса на суперЭВМ. Базовые технологии и алгоритмы // Труды XII Международного семинара «Супервычисления и математическое моделирование», 11–15 октября 2010 г., Саров. Саров, 2010. С. 215–230.</mixed-citation><mixed-citation xml:lang="en">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)</mixed-citation></citation-alternatives></ref><ref id="cit2"><label>2</label><citation-alternatives><mixed-citation xml:lang="ru">Волков К.Н., Дерюгин Ю.Н., Емельянов В.Н., Карпенко А.Г., Козелков А.С., Смирнов П.Г., Тетерина И.В. Реализация параллельных вычислений на графических процессорах в пакете вычислительной газовой динамики ЛОГОС // Вычислительные методы и программирование. 2013. Т. 14. № 1. С. 334–342.</mixed-citation><mixed-citation xml:lang="en">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)</mixed-citation></citation-alternatives></ref><ref id="cit3"><label>3</label><citation-alternatives><mixed-citation xml:lang="ru">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. V. 2094. P. 022047. https://doi.org/10.1088/1742-6596/2094/2/022047</mixed-citation><mixed-citation xml:lang="en">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</mixed-citation></citation-alternatives></ref><ref id="cit4"><label>4</label><citation-alternatives><mixed-citation xml:lang="ru">Емельянов В.Н. Механика сплошной среды: теория напряжений и основные модели. М.: Юрайт, 2018. 162 с.</mixed-citation><mixed-citation xml:lang="en">Emelianov V.N. Mechanics of Continuous Media: Strain Theory and Main Models. Moscow, Jurait Publ., 2018, 162 p. (in Russian)</mixed-citation></citation-alternatives></ref><ref id="cit5"><label>5</label><citation-alternatives><mixed-citation xml:lang="ru">Емельянов В.Н. Численные методы: введение в теорию разностных схем. М.: Изд-во Юрайт, 2018. 188 с.</mixed-citation><mixed-citation xml:lang="en">Emelianov V.N. Numerical Methods: An Introduction to the Theory of Difference Schemes. Moscow, Jurajt Publ., 2018, 188 p. (in Russian)</mixed-citation></citation-alternatives></ref><ref id="cit6"><label>6</label><citation-alternatives><mixed-citation xml:lang="ru">Гергель В.П. Теория и практика параллельных вычислений. М.: БИНОМ, 2010. 423 с.</mixed-citation><mixed-citation xml:lang="en">Gergel V.P. Theory and Practice of Parallel Computations. Moscow, BINOM Publ., 2010, 432 p. (in Russian)</mixed-citation></citation-alternatives></ref><ref id="cit7"><label>7</label><citation-alternatives><mixed-citation xml:lang="ru">Волков К.Н., Емельянов В.Н. Применение пакета MATLAB для решения краевых задач механики жидкости и газа // Труды всероссийской научной конференции «Проектирование научных и инженерных приложений в среде MATLAB» (25–26 мая 2004, Москва, Россия). М.: Изд-во ИПУ РАН, 2004. С. 92–115.</mixed-citation><mixed-citation xml:lang="en">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)</mixed-citation></citation-alternatives></ref><ref id="cit8"><label>8</label><citation-alternatives><mixed-citation xml:lang="ru">Волков К.Н., Емельянов В.Н. Реализация векторизованных конечно-разностных алгоритмов решения краевых задач механики жидкости и газа в пакете MATLAB // Вычислительные методы и программирование. 2004. Т. 5. № 3. С. 13–29.</mixed-citation><mixed-citation xml:lang="en">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)</mixed-citation></citation-alternatives></ref><ref id="cit9"><label>9</label><citation-alternatives><mixed-citation xml:lang="ru">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</mixed-citation><mixed-citation xml:lang="en">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</mixed-citation></citation-alternatives></ref><ref id="cit10"><label>10</label><citation-alternatives><mixed-citation xml:lang="ru">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</mixed-citation><mixed-citation xml:lang="en">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</mixed-citation></citation-alternatives></ref><ref id="cit11"><label>11</label><citation-alternatives><mixed-citation xml:lang="ru">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</mixed-citation><mixed-citation xml:lang="en">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</mixed-citation></citation-alternatives></ref><ref id="cit12"><label>12</label><citation-alternatives><mixed-citation xml:lang="ru">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</mixed-citation><mixed-citation xml:lang="en">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</mixed-citation></citation-alternatives></ref><ref id="cit13"><label>13</label><citation-alternatives><mixed-citation xml:lang="ru">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</mixed-citation><mixed-citation xml:lang="en">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</mixed-citation></citation-alternatives></ref><ref id="cit14"><label>14</label><citation-alternatives><mixed-citation xml:lang="ru">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</mixed-citation><mixed-citation xml:lang="en">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</mixed-citation></citation-alternatives></ref><ref id="cit15"><label>15</label><citation-alternatives><mixed-citation xml:lang="ru">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</mixed-citation><mixed-citation xml:lang="en">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</mixed-citation></citation-alternatives></ref><ref id="cit16"><label>16</label><citation-alternatives><mixed-citation xml:lang="ru">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</mixed-citation><mixed-citation xml:lang="en">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</mixed-citation></citation-alternatives></ref><ref id="cit17"><label>17</label><citation-alternatives><mixed-citation xml:lang="ru">Č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</mixed-citation><mixed-citation xml:lang="en">Č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</mixed-citation></citation-alternatives></ref><ref id="cit18"><label>18</label><citation-alternatives><mixed-citation xml:lang="ru">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</mixed-citation><mixed-citation xml:lang="en">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</mixed-citation></citation-alternatives></ref><ref id="cit19"><label>19</label><citation-alternatives><mixed-citation xml:lang="ru">Годунов С.К., Забродин А.В., Иванов М.Я., Крайко А.Н., Прокопов Г.П. Численное решение многомерных задач газовой динамики. М.: Наука, 1976. 400 с.</mixed-citation><mixed-citation xml:lang="en">Годунов С.К., Забродин А.В., Иванов М.Я., Крайко А.Н., Прокопов Г.П. Численное решение многомерных задач газовой динамики. М.: Наука, 1976. 400 с.</mixed-citation></citation-alternatives></ref><ref id="cit20"><label>20</label><citation-alternatives><mixed-citation xml:lang="ru">Волков К.Н., Емельянов В.Н. Вычислительные технологии в задачах механики жидкости и газа. М.: Физматлит, 2012. 468 с.</mixed-citation><mixed-citation xml:lang="en">Volkov K.N., Emelianov V.N. Computational Technologies in the Problems of Fluid and Gas Mechanics. Moscow, Fizmatlit Publ., 2012, 468 p. (in Russian)</mixed-citation></citation-alternatives></ref><ref id="cit21"><label>21</label><citation-alternatives><mixed-citation xml:lang="ru">Лурье А.И. Теория упругости. М.: Наука, 1970. 940 с.</mixed-citation><mixed-citation xml:lang="en">Lure A.I. Theory of Elasticity. Moscow, Nauka Publ., 1970, 940 p. (in Russian)</mixed-citation></citation-alternatives></ref></ref-list><fn-group><fn fn-type="conflict"><p>The authors declare that there are no conflicts of interest present.</p></fn></fn-group></back></article>
