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
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:
#vec: the output from problem.solve()
#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.
The text was updated successfully, but these errors were encountered: