Skip to content

Group CGNS boundary sections into markers using the ZoneBC of the file - #2976

Open
rois1995 wants to merge 5 commits into
developfrom
cgnsReaderMarkers
Open

rois1995 wants to merge 5 commits into
developfrom
cgnsReaderMarkers

Conversation

@rois1995

@rois1995 rois1995 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Proposed Changes

Meshers such as Pointwise often split one boundary into several CGNS sections. For example, a wing with triangles and quadrilaterals becomes tri_wing and quad_wing. The CGNS reader made one marker per section, so the config file had to list both names and set the same boundary condition twice.

With this PR, the reader uses the ZoneBC of the file:

  • Each boundary section gets a marker name from the BC that covers it:
    • If the BC has a family, the marker name is the family name.
    • If the BC has no family, the marker name is the BC name.
  • Sections with the same marker name become one marker.
  • Sections that no BC covers, and files without a ZoneBC, work as before: one marker per section, named after the section.
  • A section that is only partly covered by BCs, or covered by BCs with different names, also keeps its own name. A section cannot be split into two markers, so the reader prints a warning instead of guessing.
  • BCs given by elements are used: FaceCenter/EdgeCenter/CellCenter, or ElementRange/ElementList in older files. BCs given by points (Vertex) cannot be matched to a section and are ignored.
  • The reader prints which sections it grouped, e.g. Marker back groups the sections quad_back tri_back.
  • Only the finite volume reader groups sections. The FEM/DG reader still makes one marker per section.

So the grouping follows the names written by the mesher. The reader does not guess from similar names. For two BCs lower_wall and lower_WT:

Families in the file Markers
both in family lower one marker lower
family lower_wall and family lower_WT two markers lower_wall and lower_WT
no family two markers lower_wall and lower_WT

Meshers such as Pointwise usually give each BC its own family with the same name. So two BCs in the mesher stay two markers in SU2, unless the user puts them in the same family.

Test case

New regression test cgns_reader_sections (serial and parallel), TestCases/cgns_reader/channel_sections.cfg. The mesh is a small 3D channel with 96 cells, made of hexahedra and prisms. It covers each case:

Sections in the file BC in the ZoneBC Marker
lower_1, lower_2 lower_wall, family lower lower
quad_back, tri_back back, family back back
quad_front, tri_front front, family front front
upper_side upper, no family upper
inlet none inlet
  • With develop, the case stops with: The configuration file doesn't have any definition for marker lower_1.
  • With this PR, it runs.

I also checked a real Pointwise mesh of a wing (1.1M cells, 4 ranks):

  • develop stops on tri_back.
  • This PR gives 7 markers. For example, back has 4209 elements, which is tri_back (1002) + quad_back (3207).

The regression tests that already read CGNS meshes give the same results as with develop: wedge, bend, cylinder_split, MFR_coupling, flatplate_supersonic, flamelet, and the CGNS output/readback tests.

Related Work

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. (No new option.)

🤖 Generated with Claude Code

https://claude.ai/code/session_01L7oxzVir4zENrpy3K3W6Fm

rois1995 and others added 3 commits October 14, 2026 07:06
The CGNS mesh reader made one marker per boundary section, named after
the section. Meshers that split a boundary by element type (e.g. sections
tri_wall and quad_wall) therefore gave two markers, and the same boundary
conditions had to be set twice in the config file.

Name each boundary section after the boundary condition of the zone
(ZoneBC) that covers its elements: the family name of that BC if it has
one, otherwise the name of the BC. Sections sharing a name become one
marker, and their connectivity is concatenated. Sections that no BC
covers, and files without a ZoneBC node, keep the previous behaviour of
one marker named after the section. A BC given by points instead of
elements is ignored, since it cannot be matched to a section.

The sections grouped into a marker are printed to the console.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ctions

The mesh (su2code/TestCases, cgns_reader/) is a small 3D channel whose
boundaries are split in sections by element type and by block, grouped
by the ZoneBC. The markers of the config file are the names of the BCs,
so the case only runs if the reader groups the sections into markers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L7oxzVir4zENrpy3K3W6Fm
Temporary, for the mesh of the TestCases PR. To be reverted to develop
before merging.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L7oxzVir4zENrpy3K3W6Fm
Comment thread Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp Fixed
rois1995 and others added 2 commits October 14, 2026 08:18
…ne BC

- cg_famname_read copies the whole family name, which can be longer than
  32 characters (a path in the family tree of CGNS 4): use a buffer of
  the maximum size, and keep only the last part of a path.
- A section partly covered by a boundary condition, or covered by
  boundary conditions with different names, took the name of the last
  one. It is now kept as one marker named after the section, with a
  warning, since a section cannot be split.
- Boundary conditions given by ElementRange or ElementList without a
  GridLocation (older files) are also matched to the sections.
- The loop index of the markers has the type of their number (CodeQL).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L7oxzVir4zENrpy3K3W6Fm

This branch has not been deployed

No deployments
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