-
Notifications
You must be signed in to change notification settings - Fork 641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improved stop_when_dft_decayed #1711
Comments
Instead of checking the convergence of the DFT fields, what is your sense on how well it would work to check the decay of the instantaneous energy integrated over the entire sim volume (e.g. via Under reasonable circumstances, i.e. source pulses that cover a similar bandwidth sampled by the DFT frequencies, it seems like this might work pretty well. The check would be to call One potential advantage of this approach, vs looking at the convergence of fields from one or more DFT monitors, is that it takes into account information across the full simulation volume. For example, you might be optimizing overlaps from mode monitors that are far from the DFT monitor or that are influenced by other high-ish Q structures that are not covered by the DFT monitor. It seems like monitoring only the DFT fields for convergence would miss things like this. Although, for cases where the sim volume is dominated by a design region, the two approaches are probably similar. Is the calculation performed by |
One difficulty with using
Eigenmode monitors are DFT monitors. My proposal is to look at all the fields in the regions being DFT'ed. An even simpler approach would just to look the L2 norm of all of the fields in all of the DFT regions, rather than the norm of the DFTs. This is simpler to implement and maybe a bit cheaper.
Maybe, maybe not; it depends on the size of the DFT regions etc. However, I think that performance considerations are irrelevant here (at least, for anything implemented in C++ and parallelized), since convergence checks are only performed very infrequently (not every timestep). |
Currently the adjoint code has a
stop_when_dft_decayed
function by @smartalecH that checks whether the DTFT is converged at the center frequency, but it has one big problem — it callsget_dft_fields
, which collects all of the DFT data on every process. (It also seems like it looks at a single frequency, which might be a problem if there is a narrow-band resonance that decays very slowly.)It would be good to have a parallel, performant version of this, probably implemented in C++. I think a good approach would be to check convergence of the norm of all the spatial points for each frequency separately. That is, for each frequency you compute the L2 norm of all of the spatial points (and maybe all components, or maybe do this per DFT chunk). Then compare this to the norm from a previous timestep (every N timesteps for some N) to see if it is converged (similarly to
stop_when_fields_decayed
etcetera). This way the storage requirements (to cache the previous norm) are only proportional to the number of frequencies, not the number of spatial points.The text was updated successfully, but these errors were encountered: