Skip to content

Conversation

@JamesMcClung
Copy link
Collaborator

Previously, the dive field of gauss output includes virtual surface charges, but rho only 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, rho is simply set to dive in 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 actual rho in 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_failure option for checks (that works in release builds!).

@JamesMcClung
Copy link
Collaborator Author

Ugg, I can't figure out how to make my formatter format those lines correctly.

Copy link
Contributor

@germasch germasch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, and thanks for the exit_on_failure.

@JamesMcClung JamesMcClung merged commit b8ebd61 into psc-code:main Jan 7, 2026
6 checks passed
@JamesMcClung JamesMcClung deleted the pr/fix-reflection branch January 7, 2026 20:41
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.

2 participants