Fix gauss output when there's a conductive wall#370
Merged
JamesMcClung merged 8 commits intopsc-code:mainfrom Jan 7, 2026
Merged
Fix gauss output when there's a conductive wall#370JamesMcClung merged 8 commits intopsc-code:mainfrom
JamesMcClung merged 8 commits intopsc-code:mainfrom
Conversation
this fixes 2 things: 1. postprocessing no longer has to manually ignore surface charges, which required knowing BCs 2. perhaps more importantly, the print_diffs helper now prints correct indices
Collaborator
Author
|
Ugg, I can't figure out how to make my formatter format those lines correctly. |
germasch
approved these changes
Jan 7, 2026
Contributor
germasch
left a comment
There was a problem hiding this comment.
LGTM, and thanks for the exit_on_failure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, the
divefield of gauss output includes virtual surface charges, butrhoonly includes the charge deposited by actual particles. The gauss check itself simply sliced out the layer with the surface charges, which would have been a correct way to handle them, except the slice caused indices of error-ful cells to be off by 1 when printed (I think). However, the dumped data were not sliced in this way. This made it necessary to manually ignore that layer in postprocessing, or else you would see massive apparent errors, obscuring any actual errors.Now,
rhois simply set todivein the layer with surface charges, so it is no longer necessary to skip the layer when looking for errors. Of course, this erases information about the actualrhoin that layer, but that can be obtained through multiple other means (pfd_moments or prt).This PR also does a few minor, related improvements, such as an
exit_on_failureoption for checks (that works in release builds!).