Skip to content

Skip page headers inside multi-line SET1 entries in pysu2_nastran - #2922

Open
ManasBagul23 wants to merge 1 commit into
su2code:developfrom
ManasBagul23:fix-nastran-set1-page-breaks
Open

ManasBagul23 wants to merge 1 commit into
su2code:developfrom
ManasBagul23:fix-nastran-set1-page-breaks

Conversation

@ManasBagul23

Copy link
Copy Markdown

Proposed Changes

The SET1 reader in SU2_PY/SU2_Nastran/pysu2_nastran.py assumes that the continuation line of an entry is the next line of the .f06 file. In the sorted bulk data echo, a new page can start in the middle of a long SET1, so the next lines are the page header (title, S O R T E D B U L K D A T A E C H O, ENTRY COUNT ruler) and the reader fails with ValueError: invalid literal for int() with base 10: 'NOVEMBER' (the date in the title line). This is the problem described in #2313 for 3D models with many nodes in the set.

The new __readContinuation method reads forward to the next line with a + in column 31, which is where the continuation marker is printed, and skips everything else in between. It stops with a clear message if it reaches the end of the file, or another entry of the echo, without finding the continuation.

The rest of the SET1 loop is unchanged, so the number of identifiers per line does not matter (the proposal in the issue hard-codes seven on the first line and eight on the others).

Related Work

Fixes the SET1 reading part of #2313. The second half of that issue (the diverging 3D wing) is a separate question and is not addressed here.

The tests are in test_pysu2_nastran.py, which is already part of the serial regression tests. They read a 30 point SET1 written on four lines, without a page header and with one after each of the first three lines. The page header test fails without this change with the error above. Another test checks the message when the continuation line is missing.

I did not have a .f06 file from a 3D model, so the header lines in the tests are copied from the excerpt in the issue. It would be good if @safadumanli could confirm with the real file.

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.

Copilot AI lite review requested due to automatic review settings September 20, 2026 08:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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