Skip page headers inside multi-line SET1 entries in pysu2_nastran - #2922
Open
ManasBagul23 wants to merge 1 commit into
Open
ManasBagul23 wants to merge 1 commit into
ManasBagul23 wants to merge 1 commit into
Conversation
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 SET1 reader in
SU2_PY/SU2_Nastran/pysu2_nastran.pyassumes 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 COUNTruler) and the reader fails withValueError: 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
__readContinuationmethod 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
pre-commit run --allto format old commits.