Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read XSOP2DIR for external superelements, error with table name length #718

Open
rico500 opened this issue Jan 4, 2023 · 2 comments
Open

Comments

@rico500
Copy link

rico500 commented Jan 4, 2023

Hi!

First of all, pynastran is an awesome tool! Thanks for sharing it with the world.

I've been using it regularly to read modal and frequency response results, which has always worked like a charm. But I'm hitting a roadblock now when attempting to read external superelements from op2 format.

Attached is a basic job demonstrating the issue.
job.zip

The error thrown by

from pyNastran.op2.op2 import OP2

this_op2=OP2(debug_file='f.txt')
this_op2.read_op2(r"./91_Dummy4_SEEXT_seid_01.op2")

is
image

The log file states :

read_mode = 1 (vectorized; 1st pass)
marker = 2 -> PARAM,POST,-2?
_read_table_name - rewind=True
get_nmarkers- [4, 0, 4]; macro_rewind=True
read_record - marker = [4, 2, 4]; macro_rewind=True
read_record - record = [8, recordi, 8]; macro_rewind=True
--------------------------------------------------------------------------------
table_name = b'XSOP2DIR'
_read_table_name - rewind=False
get_nmarkers- [4, 0, 4]; macro_rewind=False
marker = [4, 2, 4]
table_header = [8, b'XSOP2DIR', 8]

  read_markers -> [4, -1, 4]
get_nmarkers- [4, 0, 4]; macro_rewind=False
read_record - marker = [4, 7, 4]; macro_rewind=False
read_record - record = [28, recordi, 28]; macro_rewind=False
  read_markers -> [4, -2, 4]
  read_markers -> [4, 1, 4]
  read_markers -> [4, 0, 4]
get_nmarkers- [4, 0, 4]; macro_rewind=False
read_record - marker = [4, 2, 4]; macro_rewind=False
read_record - record = [8, recordi, 8]; macro_rewind=False
  read_markers -> [4, -3, 4]
  read_markers -> [4, 1, 4]
  read_markers -> [4, 0, 4]
get_nmarkers- [4, 0, 4]; macro_rewind=False
read_record - marker = [4, 4, 4]; macro_rewind=False
read_record - record = [16, recordi, 16]; macro_rewind=False
--------------------------------------------------------------------------------
f.tell()=224
done...

The hiccup happens on line 347 of op2_reader.py in function read_xsop2dir because the second table name (the first being "XSOP2DIR") has a length of 16 bytes instead of the expected 8 ("GEOM1X XXXXXXXX" instead of "GEOM1X " is suppose.). This has been verified for SE op2 files generated by Nastran MSC 2008.0 and 2018.2. All the following table names seem to maintain this same pattern of trailing Xs to pad the char array up to 16 bytes.

What I'm trying to extract are the MATM, MATK and MATK4 superelement matrices as well as the MUG1B (displacement) and MEF1 (force) translation tables.

Thank you!

@SteveDoyle2
Copy link
Owner

Do you have the op2? Access to running nastran is far more difficult now.

@rico500
Copy link
Author

rico500 commented Jan 5, 2023

Here are the results. The SE is in 91_Dummy4_SEEXT_seid_01.op2

job_results.zip

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

No branches or pull requests

2 participants