Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

derivative of conditional #87

Closed
tj-sun opened this issue Aug 3, 2016 · 0 comments · Fixed by #89
Closed

derivative of conditional #87

tj-sun opened this issue Aug 3, 2016 · 0 comments · Fixed by #89

Comments

@tj-sun
Copy link
Contributor

tj-sun commented Aug 3, 2016

from firedrake import *
# disable_performance_optimisations()

def huber(x, epsilon):
    return conditional(le(x,1),4,x)

m = RectangleMesh(3,3,3,3)
V = VectorFunctionSpace(m, 'CG', 1)

u = Function(V)
v = TestFunction(V)
u.interpolate(Constant((1.0,1.0)))
epsilon = 0.01
E = huber(u[0].dx(0),epsilon)*dx
dE = derivative(E,u,v)
print assemble(dE).vector()[:]

Running the code above in Firedrake throws runtime error:

RuntimeError: Fission error: found unknown node: (t9 ? 0 : (t11[j] * t6) + (t10[j] * t8))

Disabling optimisation fixes the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant