Pub Date : 2024-11-15DOI: 10.1016/j.cpc.2024.109431
Tiago E.C. Magalhães
<div><div>PyWolf is an open-source software with a graphical user interface that performs numerical simulations of the cross-spectral density function propagation of planar sources using parallel computation through PyOpenCL. In the previous versions of PyWolf, the user could select the OpenCL devices and platforms to perform the parallel computations on several tasks, except for that related to the two-dimensional (2D) fast Fourier transform (FFT) algorithm. The latter task can have a large computation time since one has to perform a large amount of 2D FFTs over 2D slices of a four-dimensional array. The option of using multithread-based computation on these loops and other tasks can be an advantage for multi-core CPUs and can significantly decrease the computation time. Here, I present version 3.0.0 of PyWolf, which adds a multithreading option to be used for the 2D FFT computations. This multithreading option can also be easily implemented in other time-consuming tasks.</div></div><div><h3>New version program summary</h3><div><em>Program Title:</em> PyWolf</div><div><em>CPC Library link to program files:</em> <span><span>https://doi.org/10.17632/frjscxypkd.3</span><svg><path></path></svg></span></div><div><em>Developer's repository link:</em> <span><span>https://github.com/tiagoecmagalhaes/PyWolf</span><svg><path></path></svg></span></div><div><em>Licensing provisions:</em> GPLv3</div><div><em>Programming language:</em> Python</div><div><em>Supplementary material:</em> Overview of the main changes with performance results.</div><div><em>Journal reference of previous version:</em> Comput. Phys. Commun. 294 (2024) 108899.</div><div><em>Reasons for the new version:</em> In the original paper of PyWolf <span><span>[1]</span></span> and in the previous version <span><span>[2]</span></span>, parallel computation was performed only using PyOpenCL. However, in some cases where multiple cores are available in the CPU, multithreading <span><span>[3]</span></span> can significantly decrease the computation time of some tasks, for instance, the loops of 2D fast Fourier transforms (FFTs). This new version includes a built-in option for multithreading, enabling users to select the number of threads to be used in the numerical simulation.</div><div><em>Summary of revisions:</em> Multithreading support was added to PyWolf and users can now select this feature in PyWolf's graphical user interface and choose the number of available threads to be used in the simulation. In the current version, multithreading is only used for the loops of 2D FFTs but can be easily extended to other tasks. Other small features have been added and some issues have been corrected, namely: (i) a requirements file has been added listing all the libraries used; (ii) some errors associated with file paths have been corrected.</div><div><em>Nature of problem:</em> Propagation of partially coherent light from planar sources in the Fresnel or far field approximations using four-dimensional
PyWolf 是一款图形用户界面的开源软件,通过 PyOpenCL 并行计算,对平面光源的交叉谱密度函数传播进行数值模拟。在 PyWolf 以前的版本中,用户可以选择 OpenCL 设备和平台来执行多项任务的并行计算,但与二维(2D)快速傅立叶变换(FFT)算法相关的任务除外。后一项任务的计算时间较长,因为需要在四维阵列的二维切片上执行大量的二维 FFT。对于多核 CPU 而言,在这些循环和其他任务中使用基于多线程的计算是一个优势,可以显著减少计算时间。在此,我介绍 PyWolf 的 3.0.0 版本,它为二维 FFT 计算添加了一个多线程选项。新版本程序摘要程序标题:PyWolfCPC Library 程序文件链接:https://doi.org/10.17632/frjscxypkd.3Developer's repository 链接:https://github.com/tiagoecmagalhaes/PyWolfLicensing provisions:GPLv3 编程语言:Python补充材料:上一版本的期刊参考文献:Comput.Phys.294 (2024) 108899.Reasons for the new version:在 PyWolf 最初的论文[1]和之前的版本[2]中,并行计算只使用 PyOpenCL 进行。然而,在某些情况下,如果 CPU 有多个内核,多线程[3]可以显著减少某些任务的计算时间,例如二维快速傅立叶变换(FFT)的循环。新版本内置了多线程选项,用户可以选择数值模拟中使用的线程数量:PyWolf 增加了对多线程的支持,用户现在可以在 PyWolf 的图形用户界面中选择该功能,并在仿真中选择可用线程的数量。在当前版本中,多线程仅用于 2D FFT 的循环,但可以很容易地扩展到其他任务。问题的本质:使用四维阵列[4]、[5]以菲涅尔或远场近似的方式传播来自平面光源的部分相干光需要大量内存和计算时间。PyWolf 使用 PyOpenCL 进行并行计算,以减少跨谱密度函数传播过程中耗时的计算[4],内存容量是主要限制因素:解决方法:使用开源工具包 PyOpenCL 和多线程来减少计算时间。用户可以修改和添加 PyWolf 的更多功能,如源、传播和几何模型。用户还可以添加定制的光学元件(如透镜和光圈)。基于 PyQt5 的图形用户界面可让用户轻松设置输入参数以模拟其光学设置,绘制和导出模拟结果,以及保存或加载模拟会话。
{"title":"An improved version of PyWolf with multithread-based parallelism support","authors":"Tiago E.C. Magalhães","doi":"10.1016/j.cpc.2024.109431","DOIUrl":"10.1016/j.cpc.2024.109431","url":null,"abstract":"<div><div>PyWolf is an open-source software with a graphical user interface that performs numerical simulations of the cross-spectral density function propagation of planar sources using parallel computation through PyOpenCL. In the previous versions of PyWolf, the user could select the OpenCL devices and platforms to perform the parallel computations on several tasks, except for that related to the two-dimensional (2D) fast Fourier transform (FFT) algorithm. The latter task can have a large computation time since one has to perform a large amount of 2D FFTs over 2D slices of a four-dimensional array. The option of using multithread-based computation on these loops and other tasks can be an advantage for multi-core CPUs and can significantly decrease the computation time. Here, I present version 3.0.0 of PyWolf, which adds a multithreading option to be used for the 2D FFT computations. This multithreading option can also be easily implemented in other time-consuming tasks.</div></div><div><h3>New version program summary</h3><div><em>Program Title:</em> PyWolf</div><div><em>CPC Library link to program files:</em> <span><span>https://doi.org/10.17632/frjscxypkd.3</span><svg><path></path></svg></span></div><div><em>Developer's repository link:</em> <span><span>https://github.com/tiagoecmagalhaes/PyWolf</span><svg><path></path></svg></span></div><div><em>Licensing provisions:</em> GPLv3</div><div><em>Programming language:</em> Python</div><div><em>Supplementary material:</em> Overview of the main changes with performance results.</div><div><em>Journal reference of previous version:</em> Comput. Phys. Commun. 294 (2024) 108899.</div><div><em>Reasons for the new version:</em> In the original paper of PyWolf <span><span>[1]</span></span> and in the previous version <span><span>[2]</span></span>, parallel computation was performed only using PyOpenCL. However, in some cases where multiple cores are available in the CPU, multithreading <span><span>[3]</span></span> can significantly decrease the computation time of some tasks, for instance, the loops of 2D fast Fourier transforms (FFTs). This new version includes a built-in option for multithreading, enabling users to select the number of threads to be used in the numerical simulation.</div><div><em>Summary of revisions:</em> Multithreading support was added to PyWolf and users can now select this feature in PyWolf's graphical user interface and choose the number of available threads to be used in the simulation. In the current version, multithreading is only used for the loops of 2D FFTs but can be easily extended to other tasks. Other small features have been added and some issues have been corrected, namely: (i) a requirements file has been added listing all the libraries used; (ii) some errors associated with file paths have been corrected.</div><div><em>Nature of problem:</em> Propagation of partially coherent light from planar sources in the Fresnel or far field approximations using four-dimensional","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"307 ","pages":"Article 109431"},"PeriodicalIF":7.2,"publicationDate":"2024-11-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142652954","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"OA","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Pub Date : 2024-11-09DOI: 10.1016/j.cpc.2024.109426
A. Braz, L.G.S. Duarte, H.S. Ferreira, A.C.S. Guabiraba, L.A.C.P. da Mota, I.S.S. Nascimento
Finding first integrals of second-order nonlinear ordinary differential equations (nonlinear 2ODEs) is a very difficult task. In very complicated cases, where we cannot find Darboux polynomials (to construct an integrating factor) or a Lie symmetry (that allows us to simplify the equations), we sometimes can solve the problem by using a nonlocal symmetry. In [1], [2], [3] we developed (and improved) a method (S-function method) that is successful in finding nonlocal Lie symmetries to a large class of nonlinear rational 2ODEs. However, even with the nonlocal symmetry, we still need to solve a 1ODE (which can be very difficult to solve) to find the first integral. In this work we present a novel way of using the nonlocal symmetry to compute the first integral with a very efficient linear procedure.
New version program summary
Program Title: InSyDE – Invariants and Symmetries of (rational second order ordinary) Differential Equations.
CPC Library link to program files:https://doi.org/10.17632/4ytft6zgk7.3
Licensing provisions: CC by NC 3.0
Programming language: Maple
Supplementary material: Theoretical results and revision of the S-function method.
Journal reference of previous version: Comput. Phys. Comm. Volume 234, January 2019, Pages 302-314 - https://doi.org/10.1016/j.cpc.2018.05.009
Does the new version supersede the previous version?: Yes.
Nature of problem: Determining first integrals of rational second order ordinary differential equations.
Solution method: The method is explained in the Summary of revisions and Supplementary material.
Reasons for the new version: The InSyDE package after determining the S-function still needs to solve a first-order ordinary differential equation (1ODE) associated with the nonlocal symmetry (the so-called associated 1ODE – see [2]). The problem is that, for very complicated 1ODEs, this may not be practically feasible. We have developed an new and more efficient method that uses the nonlocal symmetry to (for a large class of 1ODEs) determine the first integral in a linear way.
Summary of revisions: In order to implement the new method just mentioned above we have made modifications to the command (Sfunction) and introduced a new one: command (Darlin).
寻找二阶非线性常微分方程(非线性 2ODEs )的初等积分是一项非常困难的任务。在非常复杂的情况下,如果我们找不到达布多项式(用于构造积分因子)或 Lie 对称性(允许我们简化方程),有时我们可以利用非局部对称性来解决问题。在 [1]、[2]、[3] 中,我们开发(并改进)了一种方法(S 函数法),成功地为一大类非线性有理 2ODE 找到了非局部 Lie 对称性。然而,即使有了非局部对称性,我们仍然需要求解 1ODE (可能非常难以求解)以找到第一积分。在这项工作中,我们提出了一种利用非局部对称性的新方法,通过非常高效的线性过程计算第一积分:InSyDE - Invariants and Symmetries of (rational second order ordinary) Differential Equations.CPC Library link to program files: https://doi.org/10.17632/4ytft6zgk7.3Licensing provisions:CC by NC 3.0编程语言:Maple 补充材料:Theoretical results and revision of the S-function method.Journal reference of previous version:Comput.Phys.第 234 卷,2019 年 1 月,第 302-314 页 - https://doi.org/10.1016/j.cpc.2018.05.009Does 新版本是否取代旧版本?是.问题性质:确定有理二阶常微分方程的第一次积分.求解方法:问题性质:求有理二阶常微分方程的初等积分:InSyDE 软件包在确定 S 函数后仍需要求解与非局部对称性相关的一阶常微分方程(1ODE)(即所谓的相关 1ODE - 参见 [2])。问题是,对于非常复杂的 1ODE 而言,这在实践中可能并不可行。我们开发了一种新的、更有效的方法,利用非局部对称性(对于一大类 1ODEs 来说)以线性方式确定第一积分:为了实现上述新方法,我们修改了指令 (Sfunction),并引入了一个新指令:指令 (Darlin)。
{"title":"A new way to use nonlocal symmetries to determine first integrals of second-order nonlinear ordinary differential equations","authors":"A. Braz, L.G.S. Duarte, H.S. Ferreira, A.C.S. Guabiraba, L.A.C.P. da Mota, I.S.S. Nascimento","doi":"10.1016/j.cpc.2024.109426","DOIUrl":"10.1016/j.cpc.2024.109426","url":null,"abstract":"<div><div>Finding first integrals of second-order nonlinear ordinary differential equations (nonlinear 2ODEs) is a very difficult task. In very complicated cases, where we cannot find Darboux polynomials (to construct an integrating factor) or a Lie symmetry (that allows us to simplify the equations), we sometimes can solve the problem by using a nonlocal symmetry. In <span><span>[1]</span></span>, <span><span>[2]</span></span>, <span><span>[3]</span></span> we developed (and improved) a method (S-function method) that is successful in finding nonlocal Lie symmetries to a large class of nonlinear rational 2ODEs. However, even with the nonlocal symmetry, we still need to solve a 1ODE (which can be very difficult to solve) to find the first integral. In this work we present a novel way of using the nonlocal symmetry to compute the first integral with a very efficient linear procedure.</div></div><div><h3>New version program summary</h3><div><em>Program Title: InSyDE</em> – Invariants and Symmetries of (rational second order ordinary) Differential Equations.</div><div><em>CPC Library link to program files:</em> <span><span>https://doi.org/10.17632/4ytft6zgk7.3</span><svg><path></path></svg></span></div><div><em>Licensing provisions:</em> CC by NC 3.0</div><div><em>Programming language:</em> Maple</div><div><em>Supplementary material:</em> Theoretical results and revision of the S-function method.</div><div><em>Journal reference of previous version:</em> Comput. Phys. Comm. Volume 234, January 2019, Pages 302-314 - <span><span>https://doi.org/10.1016/j.cpc.2018.05.009</span><svg><path></path></svg></span></div><div><em>Does the new version supersede the previous version?:</em> Yes.</div><div><em>Nature of problem:</em> Determining first integrals of rational second order ordinary differential equations.</div><div><em>Solution method:</em> The method is explained in the Summary of revisions and Supplementary material.</div><div><em>Reasons for the new version:</em> The <em>InSyDE</em> package after determining the S-function still needs to solve a first-order ordinary differential equation (1ODE) associated with the nonlocal symmetry (the so-called associated 1ODE – see <span><span>[2]</span></span>). The problem is that, for very complicated 1ODEs, this may not be practically feasible. We have developed an new and more efficient method that uses the nonlocal symmetry to (for a large class of 1ODEs) determine the first integral in a linear way.</div><div><em>Summary of revisions:</em> In order to implement the new method just mentioned above we have made modifications to the command (<span>Sfunction</span>) and introduced a new one: command (<span>Darlin</span>).</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"307 ","pages":"Article 109426"},"PeriodicalIF":7.2,"publicationDate":"2024-11-09","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142652953","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Pub Date : 2024-11-08DOI: 10.1016/j.cpc.2024.109429
Zhentong Wang, Oskar J. Haidn, Xiangyu Hu
The finite volume method (FVM) is widely recognized as a computationally efficient and accurate mesh-based technique. However, it has notable limitations, particularly in mesh generation and handling complex boundary interfaces or conditions. In contrast, the smoothed particle hydrodynamics (SPH) method, a popular meshless alternative, inherently circumvents the challenges of mesh generation and yields smoother numerical outcomes. Nevertheless, this approach comes at the cost of reduced computational efficiency. Consequently, researchers have strategically combined the strengths of both methods to investigate complex flow phenomena, producing precise and computationally efficient outcomes. However, algorithms involving the weak coupling of these two methods tend to be intricate and face challenges regarding versatility, implementation, and mutual adaptation to hardware and coding structures. Thus, achieving a robust and strong coupling of FVM and SPH within a unified framework is essential. A mesh-based FVM has recently been integrated into the SPH-based library SPHinXsys. However, due to the differing boundary algorithms between these methods, the crucial step for establishing a strong coupling of both methods within a unified SPH framework is to incorporate the FVM boundary algorithm into the Eulerian SPH method. In this paper, we propose a straightforward algorithm within the Eulerian SPH method, which is algorithmically equivalent to that in FVM and based on the principle of zero-order consistency. Moreover, several numerical examples, including compressible and incompressible flows with various boundary conditions in the Eulerian SPH method, demonstrate the stability and accuracy of the proposed algorithm.
{"title":"An algorithm for the incorporation of relevant FVM boundary conditions in the Eulerian SPH framework","authors":"Zhentong Wang, Oskar J. Haidn, Xiangyu Hu","doi":"10.1016/j.cpc.2024.109429","DOIUrl":"10.1016/j.cpc.2024.109429","url":null,"abstract":"<div><div>The finite volume method (FVM) is widely recognized as a computationally efficient and accurate mesh-based technique. However, it has notable limitations, particularly in mesh generation and handling complex boundary interfaces or conditions. In contrast, the smoothed particle hydrodynamics (SPH) method, a popular meshless alternative, inherently circumvents the challenges of mesh generation and yields smoother numerical outcomes. Nevertheless, this approach comes at the cost of reduced computational efficiency. Consequently, researchers have strategically combined the strengths of both methods to investigate complex flow phenomena, producing precise and computationally efficient outcomes. However, algorithms involving the weak coupling of these two methods tend to be intricate and face challenges regarding versatility, implementation, and mutual adaptation to hardware and coding structures. Thus, achieving a robust and strong coupling of FVM and SPH within a unified framework is essential. A mesh-based FVM has recently been integrated into the SPH-based library SPHinXsys. However, due to the differing boundary algorithms between these methods, the crucial step for establishing a strong coupling of both methods within a unified SPH framework is to incorporate the FVM boundary algorithm into the Eulerian SPH method. In this paper, we propose a straightforward algorithm within the Eulerian SPH method, which is algorithmically equivalent to that in FVM and based on the principle of zero-order consistency. Moreover, several numerical examples, including compressible and incompressible flows with various boundary conditions in the Eulerian SPH method, demonstrate the stability and accuracy of the proposed algorithm.</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"307 ","pages":"Article 109429"},"PeriodicalIF":7.2,"publicationDate":"2024-11-08","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142652951","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"OA","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Computational resources have experienced exponential growth in the last decades enabling the simulation of complex physical problems at the cost of a massive increase in data storage. This is especially true for N-body simulations now reaching billions or trillions particles in certain cases. To overcome the drawbacks of data storage on disk for post-processing purposes, on-the-fly analysis has gained momentum but still represents a challenge in both its implementation and efficiency without impacting the simulation engine performances. This work provides a new in-situ procedure for features detection in massive N-body simulations, leveraging state-of-the-art techniques from various fields. Based on a discrete-to-continuum paradigm shift, particles and their respective physical quantities are projected onto a 3D regular grid before applying image analysis algorithms to group voxels based on specific user-defined criteria. A significant extension to the hybrid parallelism of connected component analysis within the image processing community is also introduced in the present study. Traditionally operating in shared memory parallelism, this extension now incorporates both distributed and shared memory approaches. The implementation is carried out within the exaStamp classical Molecular Dynamics code, a variant of the open-source exaNBody platform [39]. This adaptation allows for the on-the-fly analysis of multi-billion atoms samples with at most a 1.3% overhead. In addition, the entire framework is benchmarked up to 32768 cores. The applicability of the present approach is demonstrated on the case of a spall fracture in a tantalum sample as well as high velocity impact of a tin droplets on a rigid surface.
{"title":"On-the-fly clustering for exascale molecular dynamics simulations","authors":"Killian Babilotte , Alizée Dubois , Thierry Carrard , Paul Lafourcade , Laurent Videau , Jean-François Molinari , Laurent Soulard","doi":"10.1016/j.cpc.2024.109427","DOIUrl":"10.1016/j.cpc.2024.109427","url":null,"abstract":"<div><div>Computational resources have experienced exponential growth in the last decades enabling the simulation of complex physical problems at the cost of a massive increase in data storage. This is especially true for N-body simulations now reaching billions or trillions particles in certain cases. To overcome the drawbacks of data storage on disk for post-processing purposes, <em>on-the-fly</em> analysis has gained momentum but still represents a challenge in both its implementation and efficiency without impacting the simulation engine performances. This work provides a new <em>in-situ</em> procedure for features detection in massive N-body simulations, leveraging state-of-the-art techniques from various fields. Based on a <em>discrete-to-continuum</em> paradigm shift, particles and their respective physical quantities are projected onto a 3D regular grid before applying image analysis algorithms to group voxels based on specific user-defined criteria. A significant extension to the hybrid parallelism of connected component analysis within the image processing community is also introduced in the present study. Traditionally operating in shared memory parallelism, this extension now incorporates both distributed and shared memory approaches. The implementation is carried out within the exaStamp classical Molecular Dynamics code, a variant of the open-source exaNBody platform <span><span>[39]</span></span>. This adaptation allows for the <em>on-the-fly</em> analysis of multi-billion atoms samples with at most a 1.3% overhead. In addition, the entire framework is benchmarked up to 32768 cores. The applicability of the present approach is demonstrated on the case of a spall fracture in a tantalum sample as well as high velocity impact of a tin droplets on a rigid surface.</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"307 ","pages":"Article 109427"},"PeriodicalIF":7.2,"publicationDate":"2024-11-08","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142652952","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"OA","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Pub Date : 2024-11-08DOI: 10.1016/j.cpc.2024.109410
Felix Wilms , Gabriele Merlo , Facundo Sheffield , Tobias Görler , Alejandro Bañón Navarro , Frank Jenko
The global tokamak code GENE has been extended including the effect of magnetic compression caused by turbulent fluctuations of the magnetic field parallel to the equilibrium one. This paper outlines the basic structure of the algorithm, valid at arbitrary wavelengths of the gyrokinetic fluctuations, with emphasis on the numerical construction of the so-called “gyrodisk-integral” operators necessary for the model. The numerical implementation is successfully verified against radially local simulations, recovering excellent agreement. Global tokamak simulations are presented as well. The upgrade enables studying a large variety of new physical scenarios at high plasma-β, such as kinetic ballooning modes, MHD-like modes or the interaction of with fast particle modes, reducing the gap between gyrokinetic models and physically realistic systems.
{"title":"Implementation of magnetic compressional effects at arbitrary wavelength in the global version of GENE","authors":"Felix Wilms , Gabriele Merlo , Facundo Sheffield , Tobias Görler , Alejandro Bañón Navarro , Frank Jenko","doi":"10.1016/j.cpc.2024.109410","DOIUrl":"10.1016/j.cpc.2024.109410","url":null,"abstract":"<div><div>The global tokamak code GENE has been extended including the effect of magnetic compression caused by <span><math><msub><mrow><mi>B</mi></mrow><mrow><mn>1</mn><mo>,</mo><mo>|</mo><mo>|</mo></mrow></msub></math></span> turbulent fluctuations of the magnetic field parallel to the equilibrium one. This paper outlines the basic structure of the algorithm, valid at arbitrary wavelengths of the gyrokinetic fluctuations, with emphasis on the numerical construction of the so-called “gyrodisk-integral” operators necessary for the model. The numerical implementation is successfully verified against radially local simulations, recovering excellent agreement. Global tokamak simulations are presented as well. The upgrade enables studying a large variety of new physical scenarios at high plasma-<em>β</em>, such as kinetic ballooning modes, MHD-like modes or the interaction of <span><math><msub><mrow><mi>B</mi></mrow><mrow><mn>1</mn><mo>,</mo><mo>|</mo><mo>|</mo></mrow></msub></math></span> with fast particle modes, reducing the gap between gyrokinetic models and physically realistic systems.</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"307 ","pages":"Article 109410"},"PeriodicalIF":7.2,"publicationDate":"2024-11-08","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142653005","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"OA","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Pub Date : 2024-11-06DOI: 10.1016/j.cpc.2024.109428
Jun Zhang , Chensen Ding
Physics-informed neural networks (PINNs) gained widespread advancements in solving differential equations, where the performance tightly hinges on the choice of activation functions that are inefficient when selected manually. To tackle this issue, we propose two straightforward yet powerful adaptive activation functions: a weighted average function that adjusts activation functions by directly manipulating their weights, and a L2-normalization function that compresses learnable parameters. These methods ensure a consistent sum of weights for each activation function, thereby enhancing optimization efficiency. We assess the performance of these approaches across a range of differential equation problems, encompassing Poisson equation, Wave equation, Burgers equation, Navier-Stokes equation, and linear/nonlinear solid mechanics problems. Through comparisons with exact solutions, we demonstrate significant improvements in convergence rate and solution accuracy. Our results underscore the efficacy of these techniques, providing a simple yet promising pathway for augmenting PINNs performance across diverse applications. The source codes and software implementation are available at https://github.com/jzhange/AAF-for-PINNs.
{"title":"Simple yet effective adaptive activation functions for physics-informed neural networks","authors":"Jun Zhang , Chensen Ding","doi":"10.1016/j.cpc.2024.109428","DOIUrl":"10.1016/j.cpc.2024.109428","url":null,"abstract":"<div><div>Physics-informed neural networks (PINNs) gained widespread advancements in solving differential equations, where the performance tightly hinges on the choice of activation functions that are inefficient when selected manually. To tackle this issue, we propose two straightforward yet powerful adaptive activation functions: a weighted average function that adjusts activation functions by directly manipulating their weights, and a <em>L<sub>2</sub></em>-normalization function that compresses learnable parameters. These methods ensure a consistent sum of weights for each activation function, thereby enhancing optimization efficiency. We assess the performance of these approaches across a range of differential equation problems, encompassing Poisson equation, Wave equation, Burgers equation, Navier-Stokes equation, and linear/nonlinear solid mechanics problems. Through comparisons with exact solutions, we demonstrate significant improvements in convergence rate and solution accuracy. Our results underscore the efficacy of these techniques, providing a simple yet promising pathway for augmenting PINNs performance across diverse applications. The source codes and software implementation are available at <span><span>https://github.com/jzhange/AAF-for-PINNs</span><svg><path></path></svg></span>.</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"307 ","pages":"Article 109428"},"PeriodicalIF":7.2,"publicationDate":"2024-11-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142652956","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Pub Date : 2024-11-06DOI: 10.1016/j.cpc.2024.109422
Franz M. Rohrhofer , Stefan Posch , Clemens Gößnitzer , Bernhard C. Geiger
This paper employs physics-informed neural networks (PINNs) to solve Fisher's equation, a fundamental reaction-diffusion system with both simplicity and significance. The focus is on investigating Fisher's equation under conditions of large reaction rate coefficients, where solutions exhibit steep traveling waves that often present challenges for traditional numerical methods. To address these challenges, a residual weighting scheme is introduced in the network training to mitigate the difficulties associated with standard PINN approaches. Additionally, a specialized network architecture designed to capture traveling wave solutions is explored. The paper also assesses the ability of PINNs to approximate a family of solutions by generalizing across multiple reaction rate coefficients. The proposed method demonstrates high effectiveness in solving Fisher's equation with large reaction rate coefficients and shows promise for meshfree solutions of generalized reaction-diffusion systems.
{"title":"Approximating families of sharp solutions to Fisher's equation with physics-informed neural networks","authors":"Franz M. Rohrhofer , Stefan Posch , Clemens Gößnitzer , Bernhard C. Geiger","doi":"10.1016/j.cpc.2024.109422","DOIUrl":"10.1016/j.cpc.2024.109422","url":null,"abstract":"<div><div>This paper employs physics-informed neural networks (PINNs) to solve Fisher's equation, a fundamental reaction-diffusion system with both simplicity and significance. The focus is on investigating Fisher's equation under conditions of large reaction rate coefficients, where solutions exhibit steep traveling waves that often present challenges for traditional numerical methods. To address these challenges, a residual weighting scheme is introduced in the network training to mitigate the difficulties associated with standard PINN approaches. Additionally, a specialized network architecture designed to capture traveling wave solutions is explored. The paper also assesses the ability of PINNs to approximate a family of solutions by generalizing across multiple reaction rate coefficients. The proposed method demonstrates high effectiveness in solving Fisher's equation with large reaction rate coefficients and shows promise for meshfree solutions of generalized reaction-diffusion systems.</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"307 ","pages":"Article 109422"},"PeriodicalIF":7.2,"publicationDate":"2024-11-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142652955","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Pub Date : 2024-11-06DOI: 10.1016/j.cpc.2024.109425
Rui Zhang , Jun Jiang , Alec Mishkin , James N. Fry , Hai-Ping Cheng
We present a reformulated algorithm for ab initio calculations of Raman spectra for large systems by applying an external electric field, and complement it by a code implementation we name RASCBEC. With the RASCBEC code, we have successfully benchmark crystalline materials and compute Raman spectra of large molecules, and amorphous oxides. Our results demonstrate a remarkable level of agreement with the results from other commonly used codes as well as the experimental data. The electric field approach for Raman spectra calculation is designed to overcome the computational challenges associated with the conventional method, which requires calculating the macroscopic dielectric tensor at numerous molecular geometries. This approach is favored because it can significantly reduce computational time. We reformulated this method by obtaining the Raman intensity from the first-order derivative of the Born Effective Charge (BEC), which is computed directly from vasp (the Vienna Ab Initio Simulation Package). This differs from other electric field-based methods that calculate Raman intensities as the second-order derivative of force with respect to the electric field. By reducing the order of derivatives, we can avoid numerical noise and accuracy concerns. Additionally, since forces are often very small numbers, taking the derivative of BEC is numerically more stable, allowing our method to be applied to a broader range of material parameters. This advantage makes RASCBEC particularly beneficial for large molecules and extensive amorphous systems.
我们提出了一种通过施加外部电场重新制定的大系统拉曼光谱 ab initio 计算算法,并辅以我们命名为 RASCBEC 的代码实现。利用 RASCBEC 代码,我们成功地以晶体材料为基准,计算了大分子和无定形氧化物的拉曼光谱。我们的结果表明,与其他常用代码的结果以及实验数据的吻合程度非常高。计算拉曼光谱的电场方法旨在克服与传统方法相关的计算难题,传统方法需要计算众多分子几何形状下的宏观介电张量。这种方法之所以受到青睐,是因为它能显著缩短计算时间。我们重新制定了这一方法,从博恩有效电荷(BEC)的一阶导数中获得拉曼强度,而博恩有效电荷是直接从 vasp(维也纳 Ab Initio 仿真软件包)中计算出来的。这不同于其他基于电场的方法,后者将拉曼强度作为力相对于电场的二阶导数来计算。通过减少导数阶数,我们可以避免数值噪声和精度问题。此外,由于力通常是非常小的数字,因此采用 BEC 的导数在数值上更加稳定,从而使我们的方法能够应用于更广泛的材料参数。这一优势使得 RASCBEC 特别适用于大分子和广泛的无定形系统。
{"title":"RASCBEC: Raman spectroscopy calculation via born effective charge","authors":"Rui Zhang , Jun Jiang , Alec Mishkin , James N. Fry , Hai-Ping Cheng","doi":"10.1016/j.cpc.2024.109425","DOIUrl":"10.1016/j.cpc.2024.109425","url":null,"abstract":"<div><div>We present a reformulated algorithm for <em>ab initio</em> calculations of Raman spectra for large systems by applying an external electric field, and complement it by a code implementation we name RASCBEC. With the RASCBEC code, we have successfully benchmark crystalline materials and compute Raman spectra of large molecules, and amorphous oxides. Our results demonstrate a remarkable level of agreement with the results from other commonly used codes as well as the experimental data. The electric field approach for Raman spectra calculation is designed to overcome the computational challenges associated with the conventional method, which requires calculating the macroscopic dielectric tensor at numerous molecular geometries. This approach is favored because it can significantly reduce computational time. We reformulated this method by obtaining the Raman intensity from the first-order derivative of the Born Effective Charge (BEC), which is computed directly from <span>vasp</span> (the Vienna Ab Initio Simulation Package). This differs from other electric field-based methods that calculate Raman intensities as the second-order derivative of force with respect to the electric field. By reducing the order of derivatives, we can avoid numerical noise and accuracy concerns. Additionally, since forces are often very small numbers, taking the derivative of BEC is numerically more stable, allowing our method to be applied to a broader range of material parameters. This advantage makes RASCBEC particularly beneficial for large molecules and extensive amorphous systems.</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"307 ","pages":"Article 109425"},"PeriodicalIF":7.2,"publicationDate":"2024-11-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142653007","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Pub Date : 2024-11-05DOI: 10.1016/j.cpc.2024.109423
Mohammad Ghazizadeh , Alexander Rey , Abolghasem Pilechi , Richard Burcher , Simon St-Onge Drouin , Philippe Lamontagne
In this study, we present a high-performance Particle Tracking Model (PTM) designed for simulating any type of particles, with a focus on microplastics. The PTM is efficient compared to existing models, parallelized, and utilizes a ray tracing algorithm incorporating both ray reflection and ray refraction in order to traverse particles as well as find the location of each particle over three-dimensional unstructured grids. Various numerical corrections are implemented in the model to address computational round-off errors and discontinuities in the water surface level of the input hydrodynamic models. To increase the accuracy of the model, partially reflective boundary conditions are imposed as well as the capability to simulate microplastics beaching and washout in very shallow areas or dry computational cells. Several tests are conducted to study the performance, scalability, and accuracy of the model. The proposed model is tested with over 3.88 billion double-precision particles on three-dimensional computational grids with up to approximately one million cells. The tests show that the ray tracing approach is efficient, achieves over 17× faster runtime, and offers greater accuracy compared to using an auxiliary grid for particle location finding. For larger timesteps, the ray tracing PTM with refraction shows improved accuracy compared to the ray tracing PTM without refraction. The model's capabilities are tested in a real-world case study over the Saguenay Fjord, Quebec, Canada. The model is utilized to reproduce the paths of five surface drifters. A second numerical test is conducted in the Fjord and high particle concentration areas are identified.
{"title":"A high-performance ray tracing particle tracking model for the simulation of microplastics in inland and coastal aquatic environments","authors":"Mohammad Ghazizadeh , Alexander Rey , Abolghasem Pilechi , Richard Burcher , Simon St-Onge Drouin , Philippe Lamontagne","doi":"10.1016/j.cpc.2024.109423","DOIUrl":"10.1016/j.cpc.2024.109423","url":null,"abstract":"<div><div>In this study, we present a high-performance Particle Tracking Model (PTM) designed for simulating any type of particles, with a focus on microplastics. The PTM is efficient compared to existing models, parallelized, and utilizes a ray tracing algorithm incorporating both ray reflection and ray refraction in order to traverse particles as well as find the location of each particle over three-dimensional unstructured grids. Various numerical corrections are implemented in the model to address computational round-off errors and discontinuities in the water surface level of the input hydrodynamic models. To increase the accuracy of the model, partially reflective boundary conditions are imposed as well as the capability to simulate microplastics beaching and washout in very shallow areas or dry computational cells. Several tests are conducted to study the performance, scalability, and accuracy of the model. The proposed model is tested with over 3.88 billion double-precision particles on three-dimensional computational grids with up to approximately one million cells. The tests show that the ray tracing approach is efficient, achieves over 17× faster runtime, and offers greater accuracy compared to using an auxiliary grid for particle location finding. For larger timesteps, the ray tracing PTM with refraction shows improved accuracy compared to the ray tracing PTM without refraction. The model's capabilities are tested in a real-world case study over the Saguenay Fjord, Quebec, Canada. The model is utilized to reproduce the paths of five surface drifters. A second numerical test is conducted in the Fjord and high particle concentration areas are identified.</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"307 ","pages":"Article 109423"},"PeriodicalIF":7.2,"publicationDate":"2024-11-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142653006","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"OA","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Pub Date : 2024-11-04DOI: 10.1016/j.cpc.2024.109421
Anton Glazkov , Miguel Fosas de Pando , Peter J. Schmid , Li He
This paper demonstrates a methodology for time-domain and time-accurate nonlinear, direct and adjoint simulations of unsteady flows and aeroacoustics for multi-component systems in relative motion. Here, the principal effort is directed towards mitigating the problem of distortion and contamination of the adjoint field at the moving interface, through a computationally lightweight, high-order sliding plane approach for which the adjoint equivalent is simple to obtain. This effort requires an attentive treatment of the interface conditions that surpasses the requirements of the more common forward (primary) problem. Sensitivity of a given quantity of interest from a time-varying flow with respect to a large number of parameters is then obtained through the adjoint operator, which is evaluated using nonlinear-adjoint looping. This technique is implemented using checkpointing and the PETSc TSAdjoint library and, after validation, applications including a rotor–stator interaction problem are presented.
{"title":"Sliding plane formalism for aeroacoustic and adjoint-based sensitivity calculations","authors":"Anton Glazkov , Miguel Fosas de Pando , Peter J. Schmid , Li He","doi":"10.1016/j.cpc.2024.109421","DOIUrl":"10.1016/j.cpc.2024.109421","url":null,"abstract":"<div><div>This paper demonstrates a methodology for time-domain and time-accurate nonlinear, direct and adjoint simulations of unsteady flows and aeroacoustics for multi-component systems in relative motion. Here, the principal effort is directed towards mitigating the problem of distortion and contamination of the <em>adjoint</em> field at the moving interface, through a computationally lightweight, high-order sliding plane approach for which the adjoint equivalent is simple to obtain. This effort requires an attentive treatment of the interface conditions that surpasses the requirements of the more common forward (primary) problem. Sensitivity of a given quantity of interest from a time-varying flow with respect to a large number of parameters is then obtained through the adjoint operator, which is evaluated using nonlinear-adjoint looping. This technique is implemented using checkpointing and the PETSc <span>TSAdjoint</span> library and, after validation, applications including a rotor–stator interaction problem are presented.</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"307 ","pages":"Article 109421"},"PeriodicalIF":7.2,"publicationDate":"2024-11-04","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142652950","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}