← Back to team overview

ufl team mailing list archive

extract unique elements

 


Hi,

I've added the following unit test to test/algorithms.py test_elements()

element1 = FiniteElement("CG", triangle, 1)
element2 = FiniteElement("CG", triangle, 1)

v = TestFunction(element1)
u = TrialFunction(element2)

a = u*v*dx
assert (element1, element2) == extract_elements(a)

# OK

assert set([element1]) == extract_unique_elements(a)

# Fails because element1 and element2 are different objects, but I think they
should be treated as identical elements??

Kristian


Follow ups