Warning for mode source not injecting any thing
So far a few users have reported simulation with mode source but it didn't inject anything as the mode solving didn't find any mode. This can happen when target_neff is not specified or far off from the real value. In this case, no source is injected and the field decay stays 0 and the simulation shuts off early after 4% of the time steps. The user still got charged 10% of the estimated cost. The biggest problem is that most users didn't realize what happened here.
If there is a source but field_decay is zero throughout the simulation, clearly something is wrong. Can we at least provide a warning for the user to say something like "No source is injected. Likely the mode source didn't find any modes." Potentially if a source doesn't find anymore, it can error but not sure if there are corner cases that we don't want to error.
@momchil-flex feel free to assign to anyone you see fit.
It's not very clear to me what to do about this. I am not sure if there are situations in which strictly zero fields will be injected. Do you have an example of such a case? Or is it more that the mode fields are wrong, so they're e.g. not localized in the waveguide, and dissipate quickly - but they're not nonzero? Because for such cases it seems hard to know whether what happened was intended or not.
There are cases where strictly no mode is found and nothing is injected so the field_decay reaches 0 immediately. If you look at the field monitor, all fields are zeros. If the FDTD took less than x steps and field_decay==0 at the end, it should be a good indication. I don't recall if x=0 , x=1, or some other values in these cases.
I can try to find such a case but not sure if it's easy to find immediately. Will update here if I find it.
Ok, yeah, if we're talking about strictly zero fields then I can add a warning.
@tomflexcompute was looking into this again but it would be nice to have a test case and I'm not sure how to construct one.
Yeah I tried a few things but didn't reproduce it. It's one of these things where it happens unexpectedly from time to time but when you try to trigger it intentionally it becomes hard.
Maybe we can postpone it until I find a good test case?
Ok actually I dug up some old email where a user reported this issue and shared his notebook with me. Let me share that with you as a test.