FFT simulations could take times. The first idea to speed up would be to buy a new and powerful computer and hoping that Moore’s law will continue forever.
The second idea would be to decrease the accuracy, a number which determines when we estimate that we have converged to the steady state field. It could be changed as an option to the function using the accelerated converge:
C1 = Calculate_Fields_AC(C1,'accuracy',1E-10);
With C1 an object of class Cavity 1. By default the accuracy is set to 1E-12. Below an empirical table to show the impact of this parameter and the speed gain for a cavity of finesse 30 000 with mirror maps and substantial clipping loss (RTL).
|Accuracy||Cavity gain||RTL [ppm]||Gain speed|
As we can see from the table, the RTL is pretty robust to the accuracy, whereas the cavity gain is more sensitive dropping by 3% when the accuracy is reduced from 1E-12 to 1E-6.
A third option, more obvious is to reduce the grid size. It has the direct drawback to cut part of the highest spatial frequencies of the surface maps. Here an example of possible gain with the same cavity:
|Grid dimension||Cavity gain||RTL [ppm]||Gain speed|
|1064 x 1064||5478.5||180.0||1|
|512 x 512||5493.4||179.4||5.7|
|256 x 256||5484.0||179.8||13.6|
|128 x 128||5551.5||177.4||76|
In a next post, we will explore the benefits of running the code on the GPU.