Use node_ptr_range() when scaling - #4510
Merged
Merged
Conversation
I'm guessing it's just a new C0Poly test that's triggering this because that gave us some node numbering gaps, but I still have no idea why it's only segfaulting for us in a --disable-exceptions build, I'm just thankful that I was able to replicate that. The worst thing Undefined Behavior can do is "what you expect, but not all the time".
GiudGiud
approved these changes
Aug 1, 2026
loganharbour
reviewed
Aug 1, 2026
Comment on lines
+1780
to
+1784
| for (Node * node : mesh.node_ptr_range()) | ||
| { | ||
| mesh.node_ref(p)(0) = (mesh.node_ref(p)(0))*(xmax-xmin) + xmin; | ||
| mesh.node_ref(p)(1) = (mesh.node_ref(p)(1))*(ymax-ymin) + ymin; | ||
| mesh.node_ref(p)(2) = (mesh.node_ref(p)(2))*(zmax-zmin) + zmin; | ||
| (*node)(0) = ((*node)(0))*(xmax-xmin) + xmin; | ||
| (*node)(1) = ((*node)(1))*(ymax-ymin) + ymin; | ||
| (*node)(2) = ((*node)(2))*(zmax-zmin) + zmin; |
Member
There was a problem hiding this comment.
Suggested change
| for (Node * node : mesh.node_ptr_range()) | |
| { | |
| mesh.node_ref(p)(0) = (mesh.node_ref(p)(0))*(xmax-xmin) + xmin; | |
| mesh.node_ref(p)(1) = (mesh.node_ref(p)(1))*(ymax-ymin) + ymin; | |
| mesh.node_ref(p)(2) = (mesh.node_ref(p)(2))*(zmax-zmin) + zmin; | |
| (*node)(0) = ((*node)(0))*(xmax-xmin) + xmin; | |
| (*node)(1) = ((*node)(1))*(ymax-ymin) + ymin; | |
| (*node)(2) = ((*node)(2))*(zmax-zmin) + zmin; | |
| for (auto & node : mesh.node_ref_range()) | |
| { | |
| node(0) = node(0)*(xmax-xmin) + xmin; | |
| node(1) = node(1)*(ymax-ymin) + ymin; | |
| node(2) = node(2)*(zmax-zmin) + zmin; |
Member
There was a problem hiding this comment.
There is no MeshBase::node_ref_range(), that's an Elem API.
loganharbour
approved these changes
Aug 1, 2026
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.
I'm guessing the reason it's just a new C0Poly test that's triggering this is because that gave us some node numbering gaps, but I still have no idea why it's only segfaulting for us in a --disable-exceptions build, I'm just thankful that I was able to replicate that.
The worst thing Undefined Behavior can do is "what you expect, but not all the time".
This fixes a unit test segfault in my --disable-exceptions build that seems to match the one in CI; hopefully it'll be enough for our stopped-up devel->master CI too.