Fix reading of paginated SET1 and CORD2R continuations in the Nastran modal solver - #2860
Open
gaoflow wants to merge 1 commit into
Open
Fix reading of paginated SET1 and CORD2R continuations in the Nastran modal solver#2860gaoflow wants to merge 1 commit into
gaoflow wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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:+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, sinceint("+000001") == 1— a corrupted FSI coupling surface with no error. User-named markers (+PB1) raiseValueError.THRU, legal on SET1 per the Quick Reference Guide (its Example 2), raisedValueError.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 tutorialmodal.f06of 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
pre-commit run --allto format old commits.