Skip to content

Fix surface elements lost when several markers are plotted - #3027

Merged
rois1995 merged 4 commits into
developfrom
fix_surface_sort_markers
Dec 4, 2026
Merged

rois1995 merged 4 commits into
developfrom
fix_surface_sort_markers

Conversation

@rois1995

Copy link
Copy Markdown
Contributor

Problem

The surface output can miss elements when MARKER_PLOTTING lists more than one marker.
The surface sorter remembers the last element it visited. The element numbers restart at zero on each marker, but this memory was not reset between markers. So an element of the next marker could be taken as already visited and dropped.

Example: a 2x2x2 box mesh with all 6 faces as plotting markers writes only 1 face instead of 6.

All surface output formats are affected.

Fix

  • Reset the visited flags at the start of each marker, in the counting and in the packing loop of CSurfaceFVMDataSorter::SortSurfaceConnectivity.
  • CPhysicalGeometry already resets these flags per marker in the same kind of loop.

Tests

  • New unit test UnitTests/SU2_CFD/output/CSurfaceFVMDataSorter_tests.cpp. It counts the surface elements of a box mesh for several marker lists.
  • Without the fix, the test fails.

Related

PR Checklist

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary.

🤖 Generated with Claude Code

The duplicate-visit flags of the surface connectivity sort were kept across
markers, but boundary element indices restart at zero on each marker, so an
element could be taken as already visited and dropped from the surface output.
Reset the flags for each marker, and add a unit test with a box mesh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@bigfooted bigfooted left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, check my comment and see if it makes sense.

@rois1995

rois1995 commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, Nijso. I checked the simplification and replied in the inline thread.

@rois1995
rois1995 merged commit 318764e into develop Dec 4, 2026
37 checks passed
@rois1995
rois1995 deleted the fix_surface_sort_markers branch December 4, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants