JefiGPU: Jefimenko's equations on GPU

Jun-Jie Zhang,Jian-Nan Chen,Guo-Liang Peng,Tai-Jiao Du,Hai-Yan Xie
DOI: https://doi.org/10.1016/j.cpc.2022.108328
IF: 4.717
2022-07-01
Computer Physics Communications
Abstract:We have implemented a GPU version of the Jefimenko's equations — JefiGPU. Given the proper distributions of the source terms ρ (charge density) and J (current density) in the source volume, the algorithm gives the electromagnetic fields in the observational region (not necessarily overlaps the vicinity of the sources). To verify the accuracy of the GPU implementation, we have compared the obtained results with that of the theoretical ones. Our results show that the deviations of the GPU results from the theoretical ones are around 5%. Meanwhile, we have also compared the performance of the GPU implementation with a CPU version. Finally, we have studied the parameter dependence of the execution time and memory consumption on one NVIDIA Tesla V100 card. Our code can be consistently coupled to RBG (Relativistic Boltzmann equations on GPUs) and many other GPU-based algorithms in physics.Program summaryProgram Title: JefiGPUCPC Library link to program files: https://doi.org/10.17632/6vnghzknx4.1Developer's repository link: https://github.com/Juenjie/CRBMGCode Ocean capsule: https://codeocean.com/capsule/9007956Licensing provisions: Apache-2.0Programming language: PythonNature of problem: Jefimenko's equations are numerically stable with given sources ρ (charge density) and J (current density). Providing proper sources, Jefimenko's equations can give the electromagnetic fields without boundary conditions. However, the relevant integrations of the Jefimenko's equations involve a 4D space-time which is both memory and time consuming. With the help of the state-of-art GPU technique, these integrations can be evaluated with acceptable accuracy and execution time. In the present work, we have implemented a GPU version of the Jefimenko's equations and tested the accuracy and the performance of the code.Solution method: The GPU code mainly deals with the implementation of the integrations in Jefimenko's equations. Each CUDA kernel corresponds to a spatial point of E and B. The integrations involving the source region and the retarded time are performed in each CUDA kernel. Ray, Numba and Cupy packages are used to manipulate the scaling of GPU allocation and evaluation.
physics, mathematical,computer science, interdisciplinary applications
What problem does this paper attempt to address?