← Back to team overview

ufl team mailing list archive

Re: extract unique elements

 

Fixed. FiniteElement didn't have __hash__ and __eq__, the default
behaviour just checks the object id.

Martin



On Wed, Jan 28, 2009 at 11:08 AM, Kristian Oelgaard
<k.b.oelgaard@xxxxxxxxxx> wrote:
>
>
> 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
> _______________________________________________
> UFL-dev mailing list
> UFL-dev@xxxxxxxxxx
> http://fenics.org/mailman/listinfo/ufl-dev
>


References