You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🐛 Describe the bug
When reading binout data using binout.py, a bug is encountered when the user is requesting ELOUT data with eroding elements. Typically, data is stored in a rectangular list, which is then converted using np.array to be returned to the user. However, when the ELOUT data contains eroded elements, the data is stored in a list of tuples that are not all the same length. This results in a "inhomogeneous shape" error when calling np.array(data) in binout.py.
🔢 To Reproduce
Steps to reproduce the behavior:
I ran DYNA version R15 with Elout *DATABASE_HISTORY_BEAM_SET requested for both eroding and non eroding elements. The eroding elements are deleted during the analysis.
Request binout.read(xxx,elout,beam,axial)
Error occurs.
💘 Expected behavior
Elout data is returned as an array.
🖥️ Setup
lasso-python latest version as of 7/18/24
numpy version 2, latest release as of 7/18/24
ℹ️ Additional context
I feel like this was not a problem in the past, so maybe it's the numpy version or DYNA R15 changed how it stores the binout data. I was able to implement a workaround in binout.py by making a function which checks if the variable "data" is rectangular before calling np.array(data), and if it is not, padding it with zeros. I am not great with python so there is probably a better way to do this.
I am also sorry for the lack of details, this bug occurs on a computer with LS-DYNA that I cannot upload to Github from. If needed I can probably replicate the functions.
The text was updated successfully, but these errors were encountered:
I ran into the same problem and added a small piece of code to handle it.
In the file binout.py insert the following code between line 338 and 340. Make sure to keep the indent aligned (8 spaces):
# handle eroded elementstry:
new_data=np.zeros((len(data), len(data[0])))
forjinrange(len(data)):
iftype(data[j]) ==int:
new_data[j][0] =data[j]
else:
new_data[j][0:len(data[j])] =data[j]
new_data.astype(type(data[0][0])) # make sure type does not changedata=new_dataexcept:
pass
To find the location of your binout.py you can use:
🐛 Describe the bug
When reading binout data using binout.py, a bug is encountered when the user is requesting ELOUT data with eroding elements. Typically, data is stored in a rectangular list, which is then converted using np.array to be returned to the user. However, when the ELOUT data contains eroded elements, the data is stored in a list of tuples that are not all the same length. This results in a "inhomogeneous shape" error when calling np.array(data) in binout.py.
🔢 To Reproduce
Steps to reproduce the behavior:
💘 Expected behavior
Elout data is returned as an array.
🖥️ Setup
ℹ️ Additional context
I feel like this was not a problem in the past, so maybe it's the numpy version or DYNA R15 changed how it stores the binout data. I was able to implement a workaround in binout.py by making a function which checks if the variable "data" is rectangular before calling np.array(data), and if it is not, padding it with zeros. I am not great with python so there is probably a better way to do this.
I am also sorry for the lack of details, this bug occurs on a computer with LS-DYNA that I cannot upload to Github from. If needed I can probably replicate the functions.
The text was updated successfully, but these errors were encountered: