Skip to content
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

handle case with no adjoint sources #1218

Merged
merged 1 commit into from
Oct 26, 2023
Merged

Conversation

tylerflex
Copy link
Collaborator

@tylerflex tylerflex commented Oct 26, 2023

This is a quick and dirty way of fixing things, but it should work. If no adjoint sources detected:

  • make a point dipole at the center of the simulation with amplitude=0
  • set the run time to something around 1/fwidth to avoid unnecessary long runtime.

This assumes that the simulation will still run if the only source has an amplitude of 0. @momchil-flex do you know? If there was some auto-detection of this case (or when no sources are present) that returned zero'd out data that could be another way to handle things.

Main downside of this is that it charges a useless simulation to the user, but I think to do this properly would require a lot of construction, so I wanted to throw this out there to discuss as a medium-short term fix to this relatively uncommon edge case.

I also am not sure how to set a reliably small run_time. Maybe something >0 but small like 1e-20 would be another approach?

#1217

@momchil-flex
Copy link
Collaborator

This assumes that the simulation will still run if the only source has an amplitude of 0. @momchil-flex do you know? If there was some auto-detection of this case (or when no sources are present) that returned zero'd out data that could be another way to handle things.

Yeah it will run, and it won't shortcut in any way, in fact it will always run for the full run_time because the auto shutoff will not detect field decay compared to previous field values (which just always stay at 0).

Main downside of this is that it charges a useless simulation to the user, but I think to do this properly would require a lot of construction, so I wanted to throw this out there to discuss as a medium-short term fix to this relatively uncommon edge case.

I also am not sure how to set a reliably small run_time. Maybe something >0 but small like 1e-20 would be another approach?

Yeah I'm not sure if there could be some issue with a very tiny run_time, maybe just setting it as 1/fwdith is fine. The other issue is that not only will it charge the user, it will also still go through all of the overhead in pre and post processing including the adjoint processing, so it will cost us server resources without the user being charged much (esp. with very low run_time). Ideally it would be great if it can be just skipped... but I can imagine it's not trivial so this is fine.

@tylerflex tylerflex merged commit c90e319 into pre/2.5 Oct 26, 2023
12 checks passed
@tylerflex tylerflex deleted the tyler/adjoint/fix/no_src branch October 26, 2023 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants