← Back to team overview

dolfin team mailing list archive

Re: VariationalProblem interface(s)

 

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



Follow ups

References