-
-
Notifications
You must be signed in to change notification settings - Fork 168
Description
Hi Steve,
I came across something that may be a bug. I am getting an error using the op2.read_op2() method to open an .op2 file with the results of a frequency response analysis with super elements and several subcases. I have a similar .op2 file with super elements but without subcases, and it opened without issue so I think it's a subcase thing.
Stack trace:
INFO: op2_scalar.py:1963 op2_filename = WindowsPath('<Path>/tests/01_raw_data/baseline_cb_sine_subcases.op2')
failed reading b'OUGV1' isubtable=-4
Traceback (most recent call last):
File "<Path>\test.py", line 10, in <module>
temp = read_op2_results(r"<Path>\tests\01_raw_data\baseline_cb_sine_subcases.op2", "tonne-mm-s")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>\src\<module>\read_op2_results.py", line 270, in read_op2_results
op2.read_op2(file_name, build_dataframe=True, combine=False)
File "<Path>\venv\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 "<Path>\venv\Lib\site-packages\pyNastran\op2\op2_interface\op2_scalar.py", line 1998, in read_op2
self._read_tables(table_name, table_names)
File "<Path>\venv\Lib\site-packages\pyNastran\op2\op2_interface\op2_scalar.py", line 2194, in _read_tables
op2_reader.read_results_table()
File "<Path>\venv\Lib\site-packages\pyNastran\op2\op2_interface\op2_reader.py", line 3510, in read_results_table
self.read_results_table4()
File "<Path>\venv\Lib\site-packages\pyNastran\op2\op2_interface\op2_reader.py", line 3535, in read_results_table4
self._read_subtables()
File "<Path>\venv\Lib\site-packages\pyNastran\op2\op2_interface\op2_reader.py", line 3751, in _read_subtables
self._read_subtable_3_4(table3_parser, table4_parser, passer)
File "<Path>\venv\Lib\site-packages\pyNastran\op2\op2_interface\op2_reader.py", line 3921, in _read_subtable_3_4
unused_n = op2._read_subtable_results(table4_parser, record_len)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>\venv\Lib\site-packages\pyNastran\op2\fortran_format.py", line 148, in _read_subtable_results
n = table4_parser(data, ndata)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>\venv\Lib\site-packages\pyNastran\op2\tables\oug\oug.py", line 717, in _read_oug_4
n = self._read_oug_acceleration(data, ndata)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>\venv\Lib\site-packages\pyNastran\op2\tables\oug\oug.py", line 962, in _read_oug_acceleration
n = op2._read_table_vectorized(data, ndata, result_name, storage_obj,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>\venv\Lib\site-packages\pyNastran\op2\op2_interface\op2_common.py", line 851, in _read_table_vectorized
n = self._read_complex_table_sort1_mag(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<Path>\venv\Lib\site-packages\pyNastran\op2\op2_interface\op2_common.py", line 1325, in _read_complex_table_sort1_mag
obj.node_gridtype[obj.itotal:itotal2, 0] = nids
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
ValueError: could not broadcast input array from shape (5,) into shape (4,)
I tried to trace the error and think I found perhaps a lead. Here's my notes:
-
Crash occurs when setting
obj.node_gridtypein_read_complex_table_sort1_mag()inop2_common.py(Line 1325)
nidsandgridtypearrays are length 5, whileobj.node_gridtypehas 4 rows (nidsandgridtypearrays appear correct) -
obj.node_gridtypeis set inbuild_data()intable_object.py(Line 371)
The number of rows innode_gridtypeis determined by thennodesparameter -
nnodesis computed byget_sort_node_sizes()in build intable_object.py(Line 341)
self._nnodesandself.ntimesdetermines thenndoesvalue
I believe self._nnodes isn't being set properly for some reason. Its value is 136 but would need to be 170 for the correct number of nodes to be determined.
Path to example op2 file: https://drive.google.com/file/d/1LZQ1y4XFV1sUtuiQ1608RUFX0WiMAiQH/view?usp=sharing
Any help would be greatly appreciated.
Thank you,
Daniel