Open wd15 opened 1 year ago
Can work around in colab to restore functional solve_fe() if you copy the elastic_fe.py class from github into your notebook and change get_displacement(vec,shape) to the following (the attribute create_output_dict() needed to be changed to create_output() to be compatible with the new SfePy API): def get_displacement(vec, shape): """Extract the displacement data Args:
#shape: the grid shape
Returns:
#displacement field
"""
as_dict = (
lambda x: x.create_output()
if hasattr(x, "create_output()")
else x.create_output()
)
return pipe(
vec,
as_dict,
lambda x: x['u'].data,
lambda x: np.reshape(x, (tuple(x + 1 for x in shape) + x.shape[-1:])),
)
It looks like Sfepy has changed its API between version 2022.1 and 2022.3. Need to fix.