# Accelerating Electromagnetic Field Simulations Based on Memory-Optimized CPML-FDTD with OpenACC
## 4 Simulation Settings and Results
### Coplanar Nano-Waveguide  
The propagation of electromagnetic field with operating frequencies along the THz band is under study in this section. Waveguides are commonly used as a microwave device where information travels in various communication systems; it is necessary to correctly describe the propagation of waves within them to determine their filtering effects, as well as their limitations on electric field intensity [38]. The structure of the Coplanar Nanowaveguide consists of three silver rectangular parallel plates, the central one fixed and two equidistantly separated at its sides. Figure 20 shows the described configuration of this experiment, which is simulated at a frequency of 100 THz. Such plates are located over a squared dielectric substrate of side \(6\times 10^{-5}\) m, with plates of \(4.15\times 10^{-5}\) m long by \(7.50\times 10^{-6}\) m width. The distance between plates is \(9.375^{-6}\) m. Sources of field (orange dots) are located at a distance of \(2.537\times 10^{-5}\) from  
Figure 19: Comparison of the solution along the time obtained in the GPU vs. CPU in viewer 3. Very similar solutions were obtained for all other viewers. The solution can only be compared when the information is transferred to the CPU. Figure 18: Absolute error between the CPU (double precision in serial) vs. the GPU (single precision) for the parabolic plate experiment at the last Time-step at 2.45 (**A**), 5.00 GHz (**B**), and 20.00 GHz (**C**). \begin{table}
\begin{tabular}{c c} \hline \hline
**Version** & **100.00 Thz** \\ \hline GPU-MD (double) RTX 3060 & 00:49 \\ GPU-VD (double) RTX 3060 & 01:56 \\ GPU-MS (single) RTX 3060 & 00:22 \\ GPU-VS (single) RTX 3060 & 01:10 \\ GPU-MD (double) Titan RTX & 00:46 \\ GPU-VD (double) Titan RTX & 02:10 \\ GPU-MS (single) Titan RTX & 00:21 \\ GPU-VS (single) Titan RTX & 01:00 \\ \hline \hline \end{tabular}
\end{table} 
Table 18: Execution times obtained using the RTX 3060 and Titan RTX, expressed in mm:ss, for the open space propagation. \begin{table}
\begin{tabular}{c c} \hline \hline
**Version** & **2.45 Ghz** \\ \hline CPU-MD (double) RTX 3060 & 1.00X \\ CPU-VD (double) RTX 3060 & 0.90X \\ GPU-MD (double) RTX 3060 & 5.06X \\ GPU-VD (double) RTX 3060 & 2.05X \\ GPU-MS (single) RTX 3060 & 11.61X \\ GPU-VS (single) RTX 3060 & 4.03X \\ GPU-MD (double) Titan RTX & 5.60X \\ GPU-VD (double) Titan RTX & 2.05X \\ GPU-MS (single) Titan RTX & 11.61X \\ GPU-VS (single) & 4.03X \\ \hline \hline \end{tabular}
\end{table} 
Table 19: Speed-up factors calculated using as a base the utilized execution time by CPU-MD, for the nano wave guide simulation. Figure 21: The nanowaveguide experiment’s electric field distribution (\(E_{2}\)) is depicted. Snapshots at 500 (**A**), 1500 (**B**) and 3000 (**C**) time steps are shown. \begin{table}
\begin{tabular}{c c} \hline \hline
**Version** & **2.45 Ghz** \\ \hline CPU-MD (double) RTX 3060 & 1.00X \\ CPU-VD (double) RTX 3060 & 0.90X \\ GPU-MD (double) RTX 3060 & 5.06X \\ GPU-VD (double) RTX 3060 & 2.05X \\ GPU-MS (single) RTX 3060 & 11.61X \\ GPU-VS (single) RTX 3060 & 4.03X \\ GPU-MD (double) Titan RTX & 5.60X \\ GPU-VD (double) Titan RTX & 2.05X \\ GPU-MS (single) Titan RTX & 11.61X \\ GPU-VS (single) & 4.03X \\ \hline \hline \end{tabular}
\end{table} 
Table 17: Execution times obtained using the CPU in serial form, expressed in mm:ss, for the nanowaveguide propagation. In Table 20 are shown the calculated mean squared error between the control points values of the CPU in double precision versus the fastest GPU execution (single precision). Figure 23, shown the absolute error for the last snapshot of the simulation, the errors are in the expected range of \(10^{-6}\sim 10^{-7}\). \begin{table}
\begin{tabular}{l l} \hline \hline
**Control Points** & **100 THz** \\ \hline Point 1 & \(3.09058\times 10^{-7}\) \\ Point 2 & \(1.02595\times 10^{-7}\) \\ Point 3 & \(1.02590\times 10^{-7}\) \\ Point 4 & \(1.29402\times 10^{-7}\) \\ Point 5 & \(1.29402\times 10^{-7}\) \\ \hline \hline \end{tabular}
\end{table}