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.
Added utility function to determine if point is on line
Given a cut line, the XYMeshCutter deletes elements on one side of the
line.
When the line cuts through quad elements, those elements are converted
to tris and refined to form a new mesh boundary coincident with the cut
line.
To determine whether the cut line cuts through a given element, each
vertex of the element is plugged into the line equation f(x, y) = ax + by + c.
An (x, y) point is on the line if f(x, y) = 0.
Vertices residing on one side of the line have positive f(x, y) and
vertices residing on the other side of the line have negative f(x, y).
If two vertices of an element have differently signed f values, the
element is deemed to be cut by the line and is marked for conversion to
tri elements and further refinement.
This PR patches a bug in the above logic.
Previously, the mesh generator did not check if a given vertex lies on
the cut line.
These vertices were assigned to one side of the line.
In the case of a quad that is not cut by the line, but has an edge
coincident with the line, this can cause those elements to be
incorrectly marked for tri conversion and refinement.
While the final cut mesh was correct, this results in an irrelevant, confusing
warning that quad elements are being converted to tri elements.
This PR adds checks to determine and ignore vertices that lie on the
cut line.
These vertices are no longer used when determining whether an element is cut
by the line.
Closes #31795.