The present paper describes an optimized C++ library for the study of electromagnetics. The implementation is based on the Finite-Difference Time-Domain method for transient analysis, and the Finite Element Method for electrostatics. Both methods share the same core and are optimized for CPU and GPU computing. To illustrate its running, FEM method is applied for solving Laplace’s equation analyzing the relation between surface curvature and electrostatic potential of a long cylindrical conductor, whereas FDTD is applied for analyzing Thin Film Filters at optical wavelengths. Furthermore, a comparison of the performance of both CPU and GPU versions is analyzed as a function of the grid size simulation. This approach allows the study of a wide range of electromagnetic problems taking advantage of the benefits of each numerical method and the computing power of the modern CPUs and GPUs.
We have implemented an unified library for electromagnetic analysis based on the FEM and FDTD method. The FEM method was used for compare the analytical expressions obtained for the analysis of the surface curvature of an infinite cylinder in electrostatics, whereas the FDTD method has been applied in optical wavelengths for analyzing the reflectance of high-reflecting coatings. In both cases, the analytical and numerical results are quite similar, thus validating our implementation.
Moreover, both methods have been developed following a set of rules that benefits the auto-vectorization of modern compilers in order to take advantage of the SSE registers in the CPU. This optimization has revealed that an improvement near of four is achieved with this auto-vectorization in both cases. In addition, FEM and FDTD has been also implemented in a GPU. The benefits of GPU computing in both methods are quite different, since for FEM analysis the SpeeduUp increases with the number of elements, whereas for FDTD computation behaves more constant and in all cases is higher than the CPU auto-vectorized version.
Jorge Francés, Sergio Bleda, Sergi Gallego, Cristian Neipp, Andrés Márquez, Inmaculada Pascual and Augusto Beléndez. Development of a unified FDTD-FEM library for electromagnetic analysis with CPU and GPU computing. The Journal of Supercomputing, 2012. [doi: 10.1007/s11227-012-0803-9] [Free PDF]