Questions Regarding Autoshutoff level
When you run a simulation in FDTD the job manager window shows the auto shutoff level, which is a measure of the energy left in the simulation window. This value is used to determine if the calculation can be stopped before the end of the simulation time. In some cases it might happen that the job manager shows the value of the auto shutoff to be 1 or some value smaller than 1 but larger than the minimum from the simulation settings (1e-5 by default) and then the simulation suddenly stops. This does not necessarily mean that the simulation did not reach the condition for early shutoff. If the log file created during the simulation shows the following message:
“Early termination of simulation, the autoshutoff criteria are satisfied.”
your simulation has stopped properly. The reason why you might encounter this unexpected termination is because the condition for ending the simulation was reached before the job manager had time to update the displayed value for the auto shutoff level. This value is updated every ~1% of the simulation time; therefore, if the simulation time (from the simulation settings) is long compared to the time it takes the energy to leave the simulation window, you might not be able to see the shutoff level decreasing nicely to the minimum. This, however, does not mean that there is something wrong with the simulation, it is just a consequence of the way the information in the job manager is updated.
It is not possible to modify the job manager settings for showing the auto shutoff level, for example to be every 0.1% of the simulation time. However, you have control over the internal sample time for the auto shutoff in the “Advanced options” tab of the “Edit FDTD simulation” window. The default setting is to internally check the auto shutoff conditions every 100 time steps of the simulation; usually, this is a very small fraction of the total simulation time, smaller than 1%, and so the program will internally check the condition for autoshutoff more frequently than what you see in the job manager.
Q1. Can we say that all simulations including some metal structures and open boundaries (PML) has to reach the autoshutoff minimum for sufficiently long simulation times? Because I think all energy has to leave the simulation region through open boundaries eventually.
Yes, generally speaking, the simulation time must be long enough to reach the autoshutoff level if there is PML and/or absorbing material involved. There are some exceptions such as high Q cavities and bandstructure calculations where we can get reliable results without reaching the autoshutoff, but those are rather odd cases with very specific methodology discussed here.
Q2. Can we see the autoshutoff level as an indication of reliability of the simulation (because of question 1 above)? What shall I do if the simulation ends when autoshutoff level at 1.2 or 0.8 for example.
Unless this is expected behaviour(e.g. high Q simulation/resonant cavities), this would indicate that your simulation is either too short and you should use longer simulation time or that the PML might not be properly absorbing the incident light(e.g. light entering PML under a steep angle)
Q3. When I check the log files of some simulations I see the autoshutoff level first decreases and then starts to increase. Why the energy inside the simulation region starts to increase? I cannot be sure whether such simulations will diverge if I set the simulation time to a much higher value. Some of my simulations take 20-30 hours and it really hard to increase the simulation time and try to see what will happen.
Small up and down movement of the autoshutoff level is quite common. As you mentioned, the purpose of autoshutoff is to estimate the remaining energy in the simulation region. The calculation is simplified to avoid severely impacting the calculation time. As a result, it does not account for the material as the light moves through the simulation region. hence you might observe that sometimes the autoshutoff goes from 0.1 to 0.2 and it does not necessarily mean something is wrong. Of course, if the autoshutoff goes from 0.1 to 5, you are most likely looking at diverging simulation
Q4. How can I tell if auto-shutoff was reached.
In addition to checking the log file, you can look at the status of the FDTD object. From script
getresult('FDTD','status'); will return an integer for the status after running the simulation. 1 = run to completion, 2 = ended due to auto-shutoff, 3 = diverged.
Q5. Are my results valid if auto-shutoff is not reached?
If the impulse response of the system is not allowed to properly decay the frequency monitors will have errors. As outlined in the Q factor workflow, the time monitors are correct and can provide, valuable insight. See this post on transmission greater than 1.