def A11(w): u = w["disp"] p = w["press"] eye = identity(u) F = grad(u) + eye J = det(F) Finv = inv(F) L = (p * J * np.einsum("lk...,ji...->ijkl...", Finv, Finv) - p * J * np.einsum("jk...,li...->ijkl...", Finv, Finv) + mu * np.einsum("ik...,jl...->ijkl...", eye, eye)) return L
def deformation_gradient(w): dudX = grad(w["displacement"]) F = dudX + identity(dudX) return F, inv(F)