← Back to team overview

dolfin team mailing list archive

Expression class

 

The Expression class is coming along quite nicely. Simple tests like
this one works:

from dolfin import *

class MyExpression(Expression):
    def eval(self, values, x):
        values[0] = cos(x[0])

mesh = UnitSquare(3, 3)
V = FunctionSpace(mesh, "CG", 1)
f = Expression("sin(5*x[0])", degree=5)
g = MyExpression(element=V.ufl_element())
h = Function(V)

M1 = f*g*dx
print "M1 =", assemble(M1, mesh=mesh)

M2 = f*h*dx
print "M2 =", assemble(M2, mesh=mesh)

But the Poisson demo fails with

ufl.log.UFLException: Points must be equal to coordinates of
quadrature points

This is probably related to choosing the right quadrature element in
the function _adjust_quadrature_element in compiler.py in FFC.

I'll be offline for a couple of hours so feel free to have a look.

--
Anders

Attachment: signature.asc
Description: Digital signature