← Back to team overview

dolfin team mailing list archive

Pydolfin, builtin functions

 


Hi,

I have some problems using the Python interface to DOLFIN.

The two following form will not compile

element = FiniteElement("Discontinuous Lagrange", "triangle", 1)
mesh = UnitSquare(2,2)
v = TestFunction(element)
u = TrialFunction(element)

h = AvgMeshSize(mesh)
n = FacetNormal(mesh)

a = 1.0/h*dot(v('+'),u('-'))*dS

error:
Traceback (most recent call last):
  File "demo.py", line 70, in <module>
    a0 = 1.0/h*dot(v('+'),u('-'))*dS
TypeError: unsupported operand type(s) for /: 'float' and 'AvgMeshSize'

and
a = dot(jump(v,n),jump(u,n))*dS

error:
Traceback (most recent call last):
  File "demo.py", line 71, in <module>
    a1 = dot(jump(v,n),jump(u,n))*dS
  File "/home/oelgaard/fenics/ffc/src/ffc/compiler/language/operators.py", line
228, in jump
    raise FormError, ((v, n), "Jump operator with respect to normal vector does
not support tensors of this rank.")
ffc.common.exceptions.FormError

Should I use the interface differently?

Kristian



Follow ups