pyNastran
pyNastran copied to clipboard
failed when read KGG from op4 binary file
Hi. First of all, thank you for your support in advance. I've got following error when read KGG from binary op4. The size of sparse matrix KGG is 311,244 x 311,244.
File "\pyNastran\op4\op4.py", line 770, in _read_matrix_binary raise NotImplementedError(msg) NotImplementedError: record_length=0 filename='test.op4'
I need a small example to do anything.
Hello,
I get the same error. I attach the op4 file I am working with and the equivalent ascii file. I am trying to read the KAA and MAA matrices: KM.zip
This is my code for the extraction process:
----------------------------------------------------------------------
import os import time import pyNastran
pkg_path = pyNastran.path[0]
from pyNastran.utils import print_bad_path from pyNastran.op4.op4 import read_op4 import numpy as np from numpy import float32, float64, int32, int64, product
op4_filename = 'KM_binary.op4' assert os.path.exists(op4_filename), print_bad_path(op4_filename)
specify the file
matrices = read_op4(op4_filename)
extract a matrix
formK, K = matrices['KAA'] formM, M = matrices['MAA']
#---------------------------------------------------
This is the error I get:
Traceback (most recent call last): File "test_pyNastran.py", line 47, in get_pyNastran matrices = read_op4(op4_filename, precision='double') File "/pyNastran/op4/op4.py", line 95, in read_op4 return op4.read_op4(op4_filename, matrix_names, precision) File "/pyNastran/op4/op4.py", line 137, in read_op4 return self.read_op4_binary(op4_filename, matrix_names, precision) File "/pyNastran/op4/op4.py", line 686, in read_op4_binary (name, form, matrix) = self._read_matrix_binary(op4, precision, matrix_names) File "pyNastran/op4/op4.py", line 770, in _read_matrix_binary raise NotImplementedError(msg) NotImplementedError: record_length=1638401 filename='KM_binary.op4'
Let me know if you need extra information.
Thank you for your help,
Fabiola
Can you create a small example (under 100 KB)? It's too big to look at a binary file. One element is the ideal size. Also, I need the bdf/dat file that goes with it.
Beyond that, I'm super busy at work right now and have quite the backlog.