open-lasso-python / lasso-python

Home of the open-source CAE library lasso-python 🐍
BSD 3-Clause "New" or "Revised" License
50 stars 12 forks source link

D3plot state_array_filter does not include all valid options #45

Closed turnerjennings closed 5 months ago

turnerjennings commented 5 months ago

In lasso-dyna D3plot, when trying to apply a state_array_filter to a D3plot file being loaded, the option "element_solid_ids" is not recognized. The "element_solid_ids" is a valid ArrayType and is loaded when no state_array_filter is applied, but a ValueError is raised when trying to apply that ArrayType as a filter.

Loading without a state array filter

d3plot = D3plot(input_path, buffered_reading=True)
element_solid_ids = d3plot.arrays["element_solid_ids"]

Return: array of solid ids

loading with a state array filter

d3plot = D3plot(input_path, buffered_reading=True, state_array_filter=["element_solid_ids"])

Return: ValueError: Array 'element_solid_ids' is not a state array.
codie3611 commented 5 months ago

The reason is that solid ids are part of the geometry and are not as stated a state array. You can only filter for state arrays and not geometry arrays, which is usually not an issue as geometry is tiny compared to state arrays.