← Back to team overview

ufl team mailing list archive

[Bug 460956] [NEW] Invalid expression in Division

 

Public bug reported:


The following example gives a "this is an invalid expression" error. 
However, it runs nicely with E = 0.5*u instead of E = u/2.0 

from ufl import *

V = FiniteElement("CG", triangle, 1)
v  = TestFunction(V)
u  = Function(V)

E = u/2.0   # This fails
#E = 0.5*u   # This works
E = variable(E)

psi = E**2
S = diff(psi, E)

F = S*v*dx

A = derivative(F, u)

print lhs(A)

** Affects: ufl
     Importance: Undecided
         Status: New

-- 
Invalid expression in Division
https://bugs.launchpad.net/bugs/460956
You received this bug notification because you are subscribed to UFL.

Status in Unified Form Language: New

Bug description:

The following example gives a "this is an invalid expression" error. 
However, it runs nicely with E = 0.5*u instead of E = u/2.0 

from ufl import *

V = FiniteElement("CG", triangle, 1)
v  = TestFunction(V)
u  = Function(V)

E = u/2.0   # This fails
#E = 0.5*u   # This works
E = variable(E)

psi = E**2
S = diff(psi, E)

F = S*v*dx

A = derivative(F, u)

print lhs(A)


Follow ups

References