
تعداد نشریات | 21 |
تعداد شمارهها | 610 |
تعداد مقالات | 9,028 |
تعداد مشاهده مقاله | 67,082,918 |
تعداد دریافت فایل اصل مقاله | 7,656,372 |
روشی کارآمد برای تعریف توابع چندمتغیره با الگوهای عبارت برای آرایهها در زبان سیپلاسپلاس و کودا | ||
مدل سازی در مهندسی | ||
مقاله 10، دوره 16، شماره 55، دی 1397، صفحه 113-131 اصل مقاله (1.3 M) | ||
نوع مقاله: مقاله کامپیوتر | ||
شناسه دیجیتال (DOI): 10.22075/jme.2018.10901.1045 | ||
نویسنده | ||
حسین محمودی داریان* | ||
دانشکده علوم مهندسی، دانشگاه تهران، تهران، ایران | ||
تاریخ دریافت: 04 فروردین 1396، تاریخ بازنگری: 13 بهمن 1396، تاریخ پذیرش: 17 بهمن 1396 | ||
چکیده | ||
در این مقاله یک روش کارآمد برای تعریف توابع چندمتغیره با الگوهای عبارت برای محاسبات آرایهای در زبان برنامه نویسی سیپلاسپلاس جهت استفاده در شبیهسازیهای دینامیک سیالات محاسباتی معرفی میشود. پیادهسازی روش با استفاده از الگوهای متغیر که از قابلیتهای جدید زبان سیپلاسپلاس است، صورت میگیرد. سادگی استفاده برای کاربران در زمینههای محاسباتی، از مزایای روش میباشد، طوری که کاربر بدون نیاز به اطلاع از مفاهیم برنامه نویسی با الگوها به راحتی میتواند تابع خود را با هر تعداد آرگومان ورودی تعریف و سپس استفاده نماید. روش حاضر میتواند جایگزین الگوهای عبارت مرسوم در توسعه کتابخانههای عددی باشد. برای سه تابع مختلف، شامل عملیات حسابی و توابع مثلثاتی، کارایی روش ارائه شده با روش الگوهای عبارت مرسوم، دو نحو مختلف زبان سیپلاسپلاس و زبان فرترن برای آرایههایی با اندازههای مختلف، مقایسه میشود. به علاوه کارایی روش از لحاظ زمان ترجمه و حجم فایل اجرایی با مترجمهای مختلف نشان داده میشود. مقایسه مشابهی روی پردازندههای گرافیکی با زبان کودا صورت میگیرد و کارایی روش نشان داده میشود. نتایج بیانگر آن است که روش حاضر برای هر تعداد درایه به لحاظ زمان محاسبات، زمان ترجمه و حجم فایل اجرایی کارایی بسیار خوبی دارد. در نهایت به عنوان کاربردی از روش پیشنهادی یک شبیهسازی عددی انجام میگیرد. | ||
کلیدواژهها | ||
الگوهای عبارت؛ الگوهای متغیر؛ سیپلاسپلاس؛ پردازندههای گرافیکی؛ کودا | ||
عنوان مقاله [English] | ||
An Efficient Method for Defining Multivariate Functions Using Expression Templates for Arrays in C++ and CUDA | ||
نویسندگان [English] | ||
Hossein Mahmoodi Darian | ||
Faculty of Engineering Science, University of Tehran, Tehran, Iran | ||
چکیده [English] | ||
In this paper an efficient method for defining multi-variable functions using expression templates for array computations in computational fluid dynamics simulations in C++ is introduced. The method is implemented using variadic templates which is a new feature in C++. One of the advantages of the method is its easy of use for users of computational fields. The user can define and use his own function with any number of input arguments without having knowledge of templates programming concepts. The present method may replace conventional expression templates in developing numerical libraries. For three different functions, including arithmetic operations and trigonometric functions, the efficiency of the proposed method for arrays of different sizes is compared with that of the conventional expression templates, two different C++ syntax and Fortran language. Furthermore, the performance of the method in terms of the compilation time and executable file size is demonstrated. A similar comparison on Graphic Processing Units (GPU) using CUDA is made and the efficiency of the method is shown. The results indicate that, for any array size, the present method has a very good performance in terms of computational time, compilation time and executable file size. Finally, as an application of the proposed method, a numerical simulation is done. | ||
کلیدواژهها [English] | ||
Expression templates, Variadic templates, C++, Graphics processing unit, CUDA | ||
مراجع | ||
[ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [17] Schildt, H. (2012). “C++ The Complete Reference”. 5th Edition, McGraw-Hill Education. [18] Hemmat Esfe, M., Sadodin, S. (2012). “Flow Behavior and Thermal Performance of Double Lid-Driven Cavity Subjected to Nanofluid with Variable Properties”. Journal of Modeling in Engineering, Vol. 10, Issue 30, pp. 43-60. [19] Abbasian Arani, A. A., Aghaee, A., Ehteram, H. (2013). “Numerical Investigation of Brownian Motion Effect on Nanofluid Mixed Convection on Enclosure with a Hot Central Heat Source”. Journal of Modeling in Engineering, Vol. 11. Issue 34, pp. 15-29. [20] Sadodin, S., Hemmat Esfe, M., Noroozi, M. J. (2011). “Numerical Simulation of Mixed Convection of Fluid Flow and Heat Transfer within Car Radiator with an Inside Hot Obstacle Filled with Nanofluid”. Journal of Modeling in Engineering, Vol. 9, Issue 25, pp. 33-46. [21] Iglberger, K., Hager, G., Treibig, J., Rde, U. (2012). “Expression templates revisited: A performance analysis of current methodologies”. SIAM Journal on Scientific Computing, Vol. 34, Issue 2, pp. C42–C69. [22] Esfahanian, V., Mahmoodi Darian, H., Gohari, S.M.I. (2013). “Assessment of weno schemes for numerical simulation of some hyperbolic equations using gpu”. Computers and Fluids, Vol. 80, pp. 260–268. [23] Mahmoodi Darian, H., Esfahanian, V. (2014). “Assessment of weno schemes for multi-dimensional euler equations using gpu”. International Journal for Numerical Methods in Fluids, Vol. 76, Issue 12, pp. 961–981. [24] Hoffmann, K. A., Chiang, S. T. (2000). “Computational Fluid Dynamics”. 4th Edition, Engineering Education System. | ||
آمار تعداد مشاهده مقاله: 743 تعداد دریافت فایل اصل مقاله: 265 |