Hello,
I am trying to modifiy the undocumented elastodynamics demo which deals with a nonlinear weak form, to a linear weak form. However, post editing, I am stuck at the very first step, i.e., compiling the UFL form file. I have the following UFL but it won't compile.
element = VectorElement("Lagrange", triangle, 1)
DG0 = FiniteElement("Discontinuous Lagrange", triangle, 0)
r = TestFunction(element)
u = TrialFunction(element)
f = Coefficient(element) # body forces
# Fields from previous time step
u0 = Coefficient(element) # displacement
v0 = Coefficient(element) # velocity
a0 = Coefficient(element) # acceleration
# Material parameters
rho = Coefficient(DG0) # mass density
lmbda = Coefficient(DG0) # Lame coefficient
mu = Coefficient(DG0) # Lame coefficient
# Time stepping parameters (Newmark scheme)
beta = Coefficient(DG0)
gamma = Coefficient(DG0)
dt = Coefficient(DG0)
# Stress tensor
def sigma(r):
return 2.0*mu*sym(grad(r)) + lmbda*tr(sym(grad(r)))*Identity(r.geometric_dimension())
# Acceleration at t_n+1
def ddot_u(u):
return ((u - u0 - dt*v0)/(beta*dt*dt) - a0*(1 - 2*beta)/(2*beta))
a = (rho*inner(ddot_u(u), r) + inner(grad(r), sigma(u)))*dx
L = inner(r, f)*dx
I get the following error:
Compiler stage 1: Analyzing form(s)
*** FFC: Adding expressions with non-matching form arguments () vs (Argument(VectorElement('Lagrange', Domain(Cell('triangle', 2),
label=None, data=None), 1, dim=2, quad_scheme=None), 1, None),).