UFL

BasisFunction and Function

Asked by Øystein Sørensen

I am working with the UFL tutorial, and when trying out BasisFunction and Function I get error message. An example code is

from ufl import *
element = FiniteElement("DG", tetrahedron, 0)
v = BasisFunction(element)

which gives the error message

Traceback (most recent call last):
  File "test.py", line 3, in <module>
    v = BasisFunction(element)
NameError: name 'BasisFunction' is not defined

and

from ufl import *
element = FiniteElement("DG", tetrahedron, 0)
f = Function(element)

which gives the error message

Traceback (most recent call last):
  File "test.py", line 4, in <module>
    f = Function(element)
NameError: name 'Function' is not defined

Does this mean that the functions BasisFunction and Function have been removed, or am I doing something wrong?

Question information

Language:
English Edit question
Status:
Solved
For:
UFL Edit question
Assignee:
No assignee Edit question
Solved by:
Garth Wells
Solved:
Last query:
Last reply:
Revision history for this message
Best Garth Wells (garth-wells) said :
#1

Try

   v = Coefficient(element)

The tutorial is a but out-of-date. It will eventually be updated.

Garth

On 20/07/10 16:41, Øystein Sørensen wrote:
> New question #118358 on UFL:
> https://answers.launchpad.net/ufl/+question/118358
>
> I am working with the UFL tutorial, and when trying out BasisFunction and Function I get error message. An example code is
>
> from ufl import *
> element = FiniteElement("DG", tetrahedron, 0)
> v = BasisFunction(element)
>
> which gives the error message
>
> Traceback (most recent call last):
> File "test.py", line 3, in<module>
> v = BasisFunction(element)
> NameError: name 'BasisFunction' is not defined
>
> and
>
> from ufl import *
> element = FiniteElement("DG", tetrahedron, 0)
> f = Function(element)
>
> which gives the error message
>
> Traceback (most recent call last):
> File "test.py", line 4, in<module>
> f = Function(element)
> NameError: name 'Function' is not defined
>
>
> Does this mean that the functions BasisFunction and Function have been removed, or am I doing something wrong?
>
>

Revision history for this message
Kent-Andre Mardal (kent-and) said :
#2

And BasisFunction is renamed Argument, but I guess you don't need to use it.
Use Trial or TestFunction instead.

Kent

> Try
>
> v = Coefficient(element)
>
> The tutorial is a but out-of-date. It will eventually be updated.
>
> Garth
>
> On 20/07/10 16:41, Øystein Sørensen wrote:
>> New question #118358 on UFL:
>> https://answers.launchpad.net/ufl/+question/118358
>>
>> I am working with the UFL tutorial, and when trying out BasisFunction
>> and Function I get error message. An example code is
>>
>> from ufl import *
>> element = FiniteElement("DG", tetrahedron, 0)
>> v = BasisFunction(element)
>>
>> which gives the error message
>>
>> Traceback (most recent call last):
>> File "test.py", line 3, in<module>
>> v = BasisFunction(element)
>> NameError: name 'BasisFunction' is not defined
>>
>> and
>>
>> from ufl import *
>> element = FiniteElement("DG", tetrahedron, 0)
>> f = Function(element)
>>
>> which gives the error message
>>
>> Traceback (most recent call last):
>> File "test.py", line 4, in<module>
>> f = Function(element)
>> NameError: name 'Function' is not defined
>>
>>
>> Does this mean that the functions BasisFunction and Function have been
>> removed, or am I doing something wrong?
>>
>>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~ufl
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~ufl
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Øystein Sørensen (oystein-sorensen) said :
#3

Thanks Garth Wells, that solved my question.