I have faced a weird error I am trying to assemble my stiffness matrix through np.block which is work normally by running my script through my terminal but when I’m using that inside a fenics script this issue occurs.
Here I provide a simple examples of np.block:
import numpy as np
A = np.eye(2) * 2
B = np.eye(3) * 3
C = np.block([
[A, np.zeros((2, 3))],
[np.ones((3, 2)), B ]])
print(‘assembeled matrix =’, C)
I can get matrix C if I don’t use fenics and simply run the above lines.
But when I call fenics and then try to run this script this error occurs:
AttributeError: ‘module’ object has no attribute ‘block’
I appreciate any hint in this case.