← Back to team overview

ufl team mailing list archive

Re: UFL and Python built-in functions

 

For a quick fix could you not try:

from ufl import exp

or:

import ufl and use ufl.exp(T) instead of exp(T)?


Garth N. Wells wrote:
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


_______________________________________________
Mailing list: https://launchpad.net/~ufl
Post to     : ufl@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~ufl
More help   : https://help.launchpad.net/ListHelp


References