On 21. okt. 2010 00:34, Johan Hake wrote:

> Btw: 
>
> Is the rank function in ufl borked:
>
>   mesh = UnitSquare(1, 1)
>   V = FunctionSpace(mesh, "CG", 1)
>   v = TestFunction(V)
>   u = Function(V)
>   L = u*v*dx
>   rank(L)
>   => AttributeError: 'Form' object has no attribute 'shape'
>
> or do I need to preprocess the form first?
>   


rank operates on expr's (not on forms). An input check might be appropriate.

Try this instead

    from ufl.algorithms import compute_form_arities
    ranks = compute_form_arities(L)
   

--
Marie

_______________________________________________
Mailing list: https://launchpad.net/~dolfin
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp

Reply via email to