-
Notifications
You must be signed in to change notification settings - Fork 548
Fix Random Ray Solver Bug: Detect Multiple Point Sources in Same Subdivided Source Region #3471
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
base: develop
Are you sure you want to change the base?
Conversation
…ed region Co-authored-by: jtramm <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Maybe change the wording slightly but otherwise this looks good.
Co-authored-by: jtramm <[email protected]>
Curious about the Black Arts, |
@Copilot it looks like the formatting of the C++ files is failing the CI checks |
@Copilot it looks like the formatting of the C++ files is failing the CI checks, can you correct the formatting of the C++ files you changed |
Co-authored-by: Jon Shimwell <[email protected]>
Co-authored-by: jtramm <[email protected]>
@yrrepy - I had opened a github issue for this item as I was planning to fix it slightly later but didn't want to forget. I noticed that when creating the issue, it allowed me to "assign" the issue to copilot instead of a human user, so figured I'd give it a try. It looks like it will only respond to comments from the person who assigned it the task. |
This looks good to me. However, I think a good policy for agent generated PR's is to have the formal reviewer still be someone separate from the one who assigned the task and worked with the agent to make the PR. |
I would be tempted to add a test that shows this fatal_error is raised appropriately. |
Problem
The Random Ray Solver had a silent bug where multiple point sources placed in the same subdivided source region would overwrite each other, with only the source having the higher index in the
model::external_sources
array being used. This could lead to incorrect simulation results without any warning to the user.Root Cause
In
FlatSourceDomain::convert_external_sources()
, when mesh subdivision is enabled, point sources are mapped to aSourceRegionKey
in thepoint_source_map_
. The problematic line:This overwrites any existing entry for the same key, causing the silent loss of earlier point sources.
Solution
Added detection logic to identify when multiple point sources would map to the same
SourceRegionKey
and throw a clear error message instead of silently overwriting:Testing
The fix has been thoroughly tested with multiple scenarios:
Benefits
The fix is minimal (5 lines of code) and surgical, addressing exactly the issue described while preserving all existing functionality.
Fixes #3470.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
esm.ubuntu.com
/usr/lib/apt/methods/https
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.