Hi!
I got a problem when I learn FEniCS demo - Lecture 6 - Hyperelasticity. In slide 7 about
Hyperelasticity - stress strain relationship, given u is displacement. I got error Expecting scalar arguments when solve second Piola-Kirchhoff stress tensor with diff. Could anyone give me some suggestion?
This is the code sample.
# -*- coding: utf-8 -*-
"""
@author: xy
"""
from fenics import *
from numpy import *
mesh = Mesh("lego_beam.xml")
# plot(mesh)
E, mu = 10.0, 0.3
nu, lmbda = E/(2*(1+mu)), E*mu/((1+mu)*(1-2*mu))
g = Constant((0, 0, -9.81))
V = VectorFunctionSpace(mesh, 'Lagrange', 1)
v = TestFunction(V)
u = TrialFunction(V)
I = Identity(3)
F = grad(u) + I
C = F.T*F
E = 0.5*(C - I)
E = variable(E)
W = 0.5*lmbda*(tr(E))*(tr(E)) + nu*tr(E*E)
S = diff(W, E)