Skip to content

Wrong element_solid_history_variables after updating from 2.0.3 to 2.0.4 #99

@mwmmr

Description

@mwmmr

🐛 Describe the bug
History variables of solid elements are incorrect. The same script produced correct results with lasso 2.0.3 version. Updating to 2.0.4 was necessary due to bug when using buffered reading.

🔢 To Reproduce
d3plot of simulation with MAT224 and extended binary output, where elements are failing.
Analyzing history of failed elements:

#get part filter
mask = d3plot.get_part_filter(
FilterType.SOLID, [part_id]
)
#get array of alive/failure state of elements
alive = d3plot.arrays[ArrayType.element_solid_is_alive][:, mask]
#Create a boolean mask where True indicates failure
failure_mask = ~alive.astype(bool)
#get all elements that are deleted at the end of the simulation
failed_elements = np.where(failure_mask[-1])[0]
#get history values of all failed elements
hist_failed = np.squeeze(
d3plot.arrays[ArrayType.element_solid_history_variables][
:, mask
][:, failed_elements]
)

--> History values are wrong. e.g. history variable 12 (index 11) is a "damage" variable which is defined to be between 0 and 1, however it has negative values according to the hist_failed array

💘 Expected behavior
History variables are correctly read by lasso

📷 Screenshots
here is an array of all history values of a single element at a specific timestep. Obviously, the damage (index 11) is negative:

[ 0.00000000e+00 3.43736880e-01 -1.96636388e-02 4.72120359e-03
4.42427426e+02 7.03701697e-01 7.90452099e-02 2.00001989e+01
-1.69087653e-01 2.24070862e-03 1.67009592e-01 -1.34268094e-04
8.41131945e-05 -2.84149433e-01]

🖥️ Setup

  • lasso-python version: 2.0.4
  • OS: Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions