← Back to team overview

ufl team mailing list archive

[Bug 461775] Re: form errors related to zeros

 

A funny thing is that doing:

L = NS_a(U,v)*dx
#a = derivative(L, U, du)

compilation fails with:
ufl.log.UFLException: Form is not multilinear in basis function arguments.

And similarly if we do:

def NS_a(u,v):
  return inner(planarGrad(u), planarGrad(v))

L = NS_a(U,v)*dx
a = derivative(L, U, du)

compilation also fails with:
ufl.log.UFLException: Form is not multilinear in basis function arguments.

-- 
form errors related to zeros
https://bugs.launchpad.net/bugs/461775
You received this bug notification because you are subscribed to UFL.

Status in Unified Form Language: New

Bug description:
The following form crashes with

AttributeError: 'Zero' object has no attribute '_expressions'

element = VectorElement("Lagrange", triangle, 1)
v =  TestFunction(element)
du = TrialFunction(element)

U = Function(element)

def planarGrad(u):
  return as_matrix([[u[0].dx(0),      0     ,u[0].dx(1)],
                              [    0     ,          0     ,     0        ],
                              [u[1].dx(0),      0     ,u[1].dx(1)]])

def epsilon(u):
  return 0.5*(planarGrad(u)+planarGrad(u).T)

def NS_a(u,v):
  return inner(epsilon(u),epsilon(v))

L = NS_a(U,v)*dx
a = derivative(L, U, du)


References