-
Notifications
You must be signed in to change notification settings - Fork 24
Description
🐛 Describe the bug
When parsing a model that contains discrete elements (i.e. *DISCRETE_ELEMENT_SPHERE or any method to generate DEs), LASSO will generate an error with a message related to airbags, specifically:
File "Y:\model_dir\venv\Lib\site-packages\lasso\dyna\d3plot.py", line 2841, in _read_particle_geometry_data
raise RuntimeError("variable ngeom in the airbag header must be 4 or 5.")
RuntimeError: variable ngeom in the airbag header must be 4 or 5.
🔢 To Reproduce
- Attempt to parse any one of the attached sample files.
DEM_Test_Model.zip
Explaination
I dug into the codebase, and it looks like parsing for DEM was never added. The odd error comes from some, er, creative, database design on LSTC's part. LSTC uses the same control flag for airbag particles as DEM, mainly NPEFG. Only a single integer in a single place is the indicator for parsing airbag data or parsing DEM data. DEM formats are poorly documented in all versions of the database.
The big issue is that the DEM information is tacked onto the end of everything in the manua,l and there are no real indicators in the main body of the manual that one should look at the end of the manual for DEM. Further, the body of the manual was not updated to account for changes that would signal a switch to DEM. Specifically, for older solvers, having a 1 in the 7th spot of the NPEFG flag would indicate switching to DEM, but in newer versions, it could be 1 or 2, with different behaviour.
This has a knock-on effect when parsing, as the code continues parsing if the header is read incorrectly, which sets incorrect buffer lengths, which would impact reading other data. But you hit the error I documented above.
🖥️ Setup
- lasso-python version: development
- OS: win11
Resolution
DEM parsing would need to be integrated. This would involve editing the header and geometry parsing for particle data, which impacts both airbags and DEM. And, given the poor documentation, this is likely an endeavour. If it makes folks feel better, even PrePost seems to struggle with handling DEM data.
I ran into this error because a colleague had been struggling with a model that has some DEM in it, and we couldn't figure out the cause for a while. We are using DEM more than I expected in my group, so I may begin looking at writing some new code, but it would be a slow process.