← Back to team overview

ffc team mailing list archive

Re: mixed elements broken

 

It's not broken. It's a feature. :-)

You need to do

    element = MixedElement([U, C, E])

This is because we can have nested mixed elements. When you write

    element = U + C + E

you will get

    element = (U + C) + E

so it will be a mixed element consisting of two elements and the first of those will be mixed.

/Anders


Garth N. Wells wrote:
Mixed elements with more than two fields appear to be broken.

   C = FiniteElement("Lagrange", "triangle", 1)
   U = FiniteElement("Lagrange", "triangle", 1)
   E = FiniteElement("Lagrange", "triangle", 1)
   element = U + C + E

   (v0, v1, v2) = TestFunctions(element)

gives the error

   Traceback (most recent call last):
     File "/usr/bin/ffc", line 180, in <module>
       sys.exit(main(sys.argv[1:]))
     File "/usr/bin/ffc", line 107, in main
       execfile(outname, ns)
     File "test.py", line 15, in <module>
       (v0, v1, v2) = TestFunctions(element)
   ValueError: need more than 2 values to unpack

Garth
_______________________________________________
FFC-dev mailing list
FFC-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/ffc-dev


Follow ups

References