← Back to team overview

ufl team mailing list archive

Automatic differentiation

 

I've used the UFL automatic differentiation for a primal problem, and it worked great. Now I'd like to try it for the Cahn-Hilliard demo which is a mixed method. I'd like to do:

   a1 = derivative(L1, k1, dk) + derivative(L1, c1, dc)

but I get the below error. Is there are trick for mixed elements?

Garth



Traceback (most recent call last):
  File "/usr/local/bin/ffc", line 186, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/local/bin/ffc", line 130, in main
    execfile(script, {})
  File "CahnHilliard2D.py", line 68, in <module>
    a1 = derivative(L1, k1, dk) + derivative(L1, c1, dc)
File "/usr/local/lib/python2.6/dist-packages/ufl/formoperators.py", line 142, in derivative functions, basis_functions = _handle_derivative_arguments(function, basis_function) File "/usr/local/lib/python2.6/dist-packages/ufl/formoperators.py", line 128, in _handle_derivative_arguments
    functions       = Tuple(*functions)
UnboundLocalError: local variable 'functions' referenced before assignment


Follow ups