← Back to team overview

dolfin team mailing list archive

Re: VariationalProblem interface(s)

 

On 21. okt. 2010 17:10, Johan Hake wrote:
> On Thursday October 21 2010 01:34:08 Marie Rognes wrote:
>   
>> 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). 
>>     
> Ahh...
>
>   
>> An input check might be
>> appropriate.
>>     
> Yes!
>
>   
>> Try this instead
>>
>>     from ufl.algorithms import compute_form_arities
>>     ranks = compute_form_arities(L)
>>     
> It works on forms, but not on a linearized form
>
>   du = TrialFunction(V)
>   compute_form_arities(derivative(L, u, du))
>   => UFLException: Found basis function in ... this is an invalid expression.
>   
>

That would be a bug. File a report.

--
Marie




Follow ups

References