← Back to team overview

ufl team mailing list archive

Re: UFL and Python built-in functions

 


Anders Logg wrote:
> On Sat, Jan 23, 2010 at 10:35:03AM +0000, Garth N. Wells wrote:
>> I've run into an issue when using 'exp' on a Coefficient/Function. In a
>> .ufl file, I can use
>>
>>   M = exp(T)
>>
>> where T is a Coefficient without problems. Using PyDOLFIN, I get the error:
>>
>>   AttributeError: exp
>>
>> Could this be that the Python version of exp is being called, rather
>> than the UFL version? How can I check in Python which 'exp' function is
>> being called?
>>
>> Garth
> 
> print should work. With UFL, I expect you would get something like
> 
> # print exp
> <function exp at 0x2673aa0>
>

This is what I get when running ffc on a .ufl file and it works.

> Otherwise something like
> 
> # print exp
> <ufunc 'exp'>

This is what I get from PyDOLFIN and it breaks. Is this likely to be
what causes my problem? Any ideas on how to fix it?

Garth




Follow ups

References