Issue reading GEOM data from OP2 file

59 views
Skip to first unread message

Daniel

unread,
Dec 15, 2024, 5:39:32 AM12/15/24
to pyNastran Discuss
Hello,

I am trying to read in geometry data for a superelement from an OP2 file but am encountering an error, see below:

>>> import pyNastran
>>> pyNastran.__version__
'1.4.1'
>>> from pyNastran.op2.op2_geom import OP2Geom
>>> model = OP2Geom(mode='nx')
>>> model.read_op2('xxxxxx.op2')
INFO:    op2_scalar.py:1964           op2_filename = 'xxxxxx.op2'
WARNING: op2_common.py:2303           64-bit precision is poorly supported

ndata = 8:
  strings = (b'9\x00\x00\x00\x00\x00\x00\x00',)
  ints    = (57, 0)
  floats  = (7.987401246651457e-44, 0.0)
  doubles (float64) = (2.8e-322,)
  long long (int64) = (57,)

WARNING: op2_reader.py:616            0 XSOP2DIR
WARNING: op2_reader.py:614            skipping PVT0
WARNING: op2_reader.py:616            1 GEOM1EX
WARNING: op2_reader.py:616            2 GEOM2EX
WARNING: op2_reader.py:616            3 GEOM4EX
WARNING: op2_reader.py:616            4 GEOM1EXA
WARNING: op2_reader.py:616            5 GEOM2EXA
WARNING: op2_reader.py:616            6 GEOM4EXA
WARNING: op2_reader.py:616            7 MATK
WARNING: op2_reader.py:616            8 MATM
WARNING: op2_reader.py:616            9 MATV
WARNING: op2_reader.py:616            10 TUG1
WARNING: op2_reader.py:616            11 MUG1
WARNING: op2_reader.py:616            12 TEF1
WARNING: op2_reader.py:616            13 MEF1
INFO:    read_extdb.py:436            -3 A: name='GEOM1' -> 'GEOM1EX'
INFO:    read_extdb.py:548            name = 'GEOM1' size=8
INFO:    read_extdb.py:548            name = 'GEOM1' size=8
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyNastran\op2\op2_geom.py", line 318, in read_op2
    OP2.read_op2(self, op2_filename=op2_filename, combine=combine,
  File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyNastran\op2\op2.py", line 612, in read_op2
    OP2_Scalar.read_op2(self, op2_filename=self.op2_filename, mode=mode)
  File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyNastran\op2\op2_interface\op2_scalar.py", line 1999, in read_op2
    self._read_tables(table_name, table_names)
  File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyNastran\op2\op2_interface\op2_scalar.py", line 2188, in _read_tables
    func()
  File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyNastran\op2\op2_interface\read_extdb.py", line 578, in read_extdb
    read_extdb_geomx(op2_reader, data, endian, op2.reader_geom1.geom1_map)
  File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyNastran\op2\op2_interface\extdb.py", line 226, in read_extdb_geomx
    func(data, n)
  File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyNastran\op2\tables\geom\geom1.py", line 31, in _read_fake
    return self.op2._read_fake(data, n)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyNastran\op2\tables\geom\geom_common.py", line 38, in _read_fake
    self.log.info(f'geom skipping {self.card_name} in {self.table_name}; ndata={len(data)-12}')
                                   ^^^^^^^^^^^^^^
AttributeError: 'OP2Geom' object has no attribute 'card_name'


Any help would be appreciated. Thank you!

-Daniel

Daniel

unread,
Dec 15, 2024, 4:21:02 PM12/15/24
to pyNastran Discuss

Steven Doyle

unread,
Dec 17, 2024, 2:41:02 AM12/17/24
to pynastra...@googlegroups.com
Daniel,

I'll have to take a look at the crash, but op2 superelements are not supported. The goal is to skip them. I'm not the best at them and they're not documented in the manuals.

Steve


--
You received this message because you are subscribed to the Google Groups "pyNastran Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pynastran-disc...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pynastran-discuss/9634807e-f2b9-4ac7-a8bd-2e0aeaac604fn%40googlegroups.com.

Daniel

unread,
Dec 17, 2024, 1:15:32 PM12/17/24
to pyNastran Discuss
Ah, thanks for clarifying that. I also tried pulling the geometry data from a punch file but had trouble with that as well. I opened an issue regarding that in GitHub before I found this discussion forum. Here is a link to that issue: https://github.com/SteveDoyle2/pyNastran/issues/813 .

Thanks for taking the time to respond!

-Daniel
Reply all
Reply to author
Forward
0 new messages