Skip to content

Fix reading of paginated SET1 and CORD2R continuations in the Nastran modal solver - #2860

Open
gaoflow wants to merge 1 commit into
su2code:developfrom
gaoflow:fix-set1-continuation-pagination
Open

Fix reading of paginated SET1 and CORD2R continuations in the Nastran modal solver#2860
gaoflow wants to merge 1 commit into
su2code:developfrom
gaoflow:fix-set1-continuation-pagination

Conversation

@gaoflow

@gaoflow gaoflow commented Aug 4, 2026

Copy link
Copy Markdown

Proposed Changes

The mesh reader of the Nastran modal solver fails on the f06 output of larger models because the sorted bulk data echo is paginated: reading a SET1 whose continuations span a page break dies with ValueError: invalid literal for int() with base 10: 'NOVEMBER' — the page title is consumed as if it were the continuation line (issue #2313).

The root cause is that the SET1 and CORD2R readers take the next physical line as the logical continuation, and only recognise a bare + as marker. Auditing that code path turned up more of the same class:

  • Nastran-generated continuation markers such as +000001 (the automatic continuation the QRG recommends, and what the sorted echo prints for blank-field continuations) are silently appended to the marker set as grid point 1, since int("+000001") == 1 — a corrupted FSI coupling surface with no error. User-named markers (+PB1) raise ValueError.
  • A page break between the two lines of a CORD2R fails the same way as SET1.
  • THRU, legal on SET1 per the Quick Reference Guide (its Example 2), raised ValueError.

Continuation lines are now located by their marker field, skipping page titles, carriage control lines and column rulers; a truncated file or a missing continuation raises a clear error instead, and THRU ranges are expanded.

Related Work

Closes #2313. The page-header block in the new tests reproduces the one reported there verbatim: 8 of the 10 tests fail on current develop, all pass with the fix (python -m unittest discover -s SU2_PY/SU2_Nastran). The tutorial modal.f06 of the unsteady FSI tutorial parses bit-identically before and after (124 points, 123 in the moving marker).

#2859 fixes the small-field value parsing in the same file; the two branches are independent and merge cleanly (combined test suite passes locally).

PR Checklist

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (Python only, nothing compiled is touched).
  • 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.

…ader

The sorted bulk data echo of an f06 file is paginated: page titles,
carriage control lines and column rulers can interrupt an entry at any
point. The SET1 and CORD2R readers consumed the next physical line as
the continuation, so any page break inside an entry made the reader fail
(issue su2code#2313). Continuation markers other than a bare + were also
mishandled: Nastran generated markers such as +000001 were silently
appended to the marker set as grid point 1.

Continuation lines are now located by their marker field, skipping the
page furniture, and THRU ranges of the SET1 entry are supported.
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.

1 participant